summaryrefslogtreecommitdiffstats
path: root/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
diff options
context:
space:
mode:
authorSimon Rettberg2013-10-22 18:06:45 +0200
committerSimon Rettberg2013-10-22 18:06:45 +0200
commit2b8b29eeb263eacf0ecd7393e98da6c80522f511 (patch)
tree4e21689cf17c36e3dbb68dad24d930523592818b /remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
parent[doc] Please expand! Overview of variables used in module conf- and build files (diff)
downloadtm-scripts-2b8b29eeb263eacf0ecd7393e98da6c80522f511.tar.gz
tm-scripts-2b8b29eeb263eacf0ecd7393e98da6c80522f511.tar.xz
tm-scripts-2b8b29eeb263eacf0ecd7393e98da6c80522f511.zip
[rootfs-stage32] Run fdisk again after two seconds if it fails the first time
Diffstat (limited to 'remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions')
-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"