diff options
author | Simon Rettberg | 2013-10-22 18:06:45 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-10-22 18:06:45 +0200 |
commit | 2b8b29eeb263eacf0ecd7393e98da6c80522f511 (patch) | |
tree | 4e21689cf17c36e3dbb68dad24d930523592818b /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) | |
download | tm-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-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | 12 |
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" |