From 5ac64412489c0249059cd9051a2b9e5ec0a4de77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Tue, 19 Nov 2019 17:06:05 +0100 Subject: [PATCH] Fixed subsequent reboot of oem disk On a second reboot of an oem disk we check with gdisk's verification command if the disk needs to be resized. That command however mounts the disk in the background and therefore it's urgently required to mask the systemd rootfs service before. Otherwise systemd thinks this is evil and drops into a rescue shell --- .../modules.d/90kiwi-repart/kiwi-repart-disk.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dracut/modules.d/90kiwi-repart/kiwi-repart-disk.sh b/dracut/modules.d/90kiwi-repart/kiwi-repart-disk.sh index 253d306e..8caf53ff 100755 --- a/dracut/modules.d/90kiwi-repart/kiwi-repart-disk.sh +++ b/dracut/modules.d/90kiwi-repart/kiwi-repart-disk.sh @@ -279,14 +279,6 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin setup_debug -# initialize for disk repartition -initialize - -if ! disk_has_unallocated_space "${disk}";then - # already resized or disk has not received any geometry change - return -fi - # when repartitioning disks, parted and friends might trigger re-reads of # the partition table, in turn triggering systemd-fsck-root.service # repeatedly via udev events, which finally can cause booting to fail with @@ -303,6 +295,14 @@ trap unmask_fsck_root_service EXIT mask_fsck_root_service +# initialize for disk repartition +initialize + +if ! disk_has_unallocated_space "${disk}";then + # already resized or disk has not received any geometry change + return +fi + # prepare disk for repartition if [ "$(get_partition_table_type "${disk}")" = 'gpt' ];then relocate_gpt_at_end_of_disk "${disk}"