Skip to content
Snippets Groups Projects
Commit 18962785 authored by Tiago Ramos Biasotto's avatar Tiago Ramos Biasotto
Browse files

Merge branch 'issue/2954' into 'develop'

Issue/2954

fix bug in removepart

See merge request !5
parents aa154cc3 7d1ab32a
Branches
No related tags found
No related merge requests found
[Unit] [Unit]
Description=Runs the OpenSLX Partitioning Tool Description=Runs the OpenSLX Removepart Tool
After=killsplash.service After=killsplash.service
After=systemd-vconsole-setup.service After=systemd-vconsole-setup.service
Before=display-manager.service getty@tty1.service getty@ttyUSB0.service partitioner.service setup-partitions.service Before=display-manager.service getty@tty1.service getty@ttyUSB0.service
Before=serial-getty@ttyS0.service serial-getty@ttyO0.service serial-getty@ttyO2.service Before=serial-getty@ttyS0.service serial-getty@ttyO0.service serial-getty@ttyO2.service
Before=serial-getty@ttyAMA0.service serial-getty@ttymxc0.service serial-getty@ttymxc3.service Before=serial-getty@ttyAMA0.service serial-getty@ttymxc0.service serial-getty@ttymxc3.service
Conflicts=killsplash.service Conflicts=killsplash.service
...@@ -10,7 +10,7 @@ ConditionKernelCommandLine=removepart ...@@ -10,7 +10,7 @@ ConditionKernelCommandLine=removepart
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/opt/openslx/scripts/removepart ExecStart=/opt/openslx/scripts/systemd-removepart
TimeoutSec=0 TimeoutSec=0
RemainAfterExit=yes RemainAfterExit=yes
SysVStartPriority=99 SysVStartPriority=99
......
[Unit] [Unit]
Description=Runs the OpenSLX Partitioning Tool Description=Runs the OpenSLX Removepart Tool
After=killsplash.service After=killsplash.service
After=systemd-vconsole-setup.service After=systemd-vconsole-setup.service
Before=display-manager.service getty@tty1.service getty@ttyUSB0.service partitioner.service setup-partitions.service Before=display-manager.service getty@tty1.service getty@ttyUSB0.service
Before=serial-getty@ttyS0.service serial-getty@ttyO0.service serial-getty@ttyO2.service Before=serial-getty@ttyS0.service serial-getty@ttyO0.service serial-getty@ttyO2.service
Before=serial-getty@ttyAMA0.service serial-getty@ttymxc0.service serial-getty@ttymxc3.service Before=serial-getty@ttyAMA0.service serial-getty@ttymxc0.service serial-getty@ttymxc3.service
Conflicts=killsplash.service Conflicts=killsplash.service
...@@ -10,7 +10,7 @@ ConditionKernelCommandLine=removepart ...@@ -10,7 +10,7 @@ ConditionKernelCommandLine=removepart
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/opt/openslx/scripts/removepart ExecStart=/opt/openslx/scripts/systemd-removepart
TimeoutSec=0 TimeoutSec=0
RemainAfterExit=yes RemainAfterExit=yes
SysVStartPriority=99 SysVStartPriority=99
......
...@@ -12,7 +12,7 @@ perror () { ...@@ -12,7 +12,7 @@ perror () {
dialog --title "ERROR" --stdout --msgbox "$@" 15 60 dialog --title "ERROR" --stdout --msgbox "$@" 15 60
else else
dialog --title "ERROR" --no-cancel --stdout --pause "$@\n\nReboot in:" 15 60 600 dialog --title "ERROR" --no-cancel --stdout --pause "$@\n\nReboot in:" 15 60 600
#reboot reboot
fi fi
exit 1 exit 1
} }
...@@ -36,6 +36,7 @@ pwarning () { ...@@ -36,6 +36,7 @@ pwarning () {
# param $2 is the format of the $1 disk # param $2 is the format of the $1 disk
# param $3 is the number of the partition to be removed # param $3 is the number of the partition to be removed
remove_part_delete () { remove_part_delete () {
unmount -f $1$3 > /dev/null 2>&1
if [ "$2" != "gpt" ]; then if [ "$2" != "gpt" ]; then
echo "[REMOVE] Remove partition $3 from msdos disk $1" echo "[REMOVE] Remove partition $3 from msdos disk $1"
(echo d; echo ${3}; echo w) | fdisk $disk &>/dev/null (echo d; echo ${3}; echo w) | fdisk $disk &>/dev/null
...@@ -204,12 +205,12 @@ for disk in $DISKS; do ...@@ -204,12 +205,12 @@ for disk in $DISKS; do
255) 255)
echo "ESC pressed";; echo "ESC pressed";;
esac esac
else else
# automatic remove all # automatic remove all
# basically manual mode and remove all except it does not ask for permission # basically manual mode and remove all except it does not ask for permission
echo "Removing all partitions "$disk_partitions" from $disk" echo "Removing all partitions "$disk_partitions" from $disk"
pwarning "Removing all partitions from $disk"
for disk_part in $disk_partitions; do for disk_part in $disk_partitions; do
remove_part $disk $disk_format $disk_type $disk_part remove_part $disk $disk_format $disk_type $disk_part
done done
...@@ -220,3 +221,6 @@ done ...@@ -220,3 +221,6 @@ done
rm $OUTPUT rm $OUTPUT
pwarning "Removepart executed successfully"
reboot
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment