summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
Diffstat (limited to 'remote')
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions12
1 files changed, 12 insertions, 0 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
index b0f606dd..da0cea5d 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
@@ -77,6 +77,18 @@ function mount_temp_fallback () {
}
fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition"
+# This is an ugly hack as sometimes this script is run too early,
+# and fdisk won't report any partitions then. I assumed this would be
+# solved by launching this script after udev-trigger finished, but
+# apparently then it can still happen that we run too soon. This should
+# be removed once someone figures out what fdisk really needs to work
+# properly.
+if [ ! -s "/etc/disk.partition" -a -n "$(ls /dev/sd?)" ]; then
+ sleep 2
+ echo "Retrying fdisk"
+ fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition"
+fi
+
echo "Partitions:"
cat "/etc/disk.partition"