summaryrefslogtreecommitdiff
path: root/src/initrd/grok-block
diff options
context:
space:
mode:
Diffstat (limited to 'src/initrd/grok-block')
-rwxr-xr-xsrc/initrd/grok-block15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/initrd/grok-block b/src/initrd/grok-block
index d3fe7a2..3ad0432 100755
--- a/src/initrd/grok-block
+++ b/src/initrd/grok-block
@@ -123,6 +123,14 @@ parent_device()
123 printf '%s' "$d" 123 printf '%s' "$d"
124} 124}
125 125
126wait_for_files_()
127{
128 local f
129 for f in "$@"; do
130 while ! [ -e "$f" ]; do sleep 0.1; done
131 done
132}
133
126grok_block() 134grok_block()
127{ 135{
128 local mountpoint="/mnt/${DEVNAME##*/}" 136 local mountpoint="/mnt/${DEVNAME##*/}"
@@ -140,7 +148,12 @@ grok_block()
140 case "$DEVNAME" in 148 case "$DEVNAME" in
141 # Avoid mouting this multiple times in case this script gets called multiple times, 149 # Avoid mouting this multiple times in case this script gets called multiple times,
142 # because while it's mounted, the dmsetup stuff will fail with device busy. 150 # because while it's mounted, the dmsetup stuff will fail with device busy.
143 /dev/nbd0) [ -e /bootwait/samizdat-nbd-dev ] && return ;; 151 /dev/nbd0)
152 if [ -e /bootwait/samizdat-nbd-dev ]
153 then return
154 else wait_for_files_ /sys/block/nbd0/pid
155 fi
156 ;;
144 esac 157 esac
145 case "$ID_PART_ENTRY_NAME" in 158 case "$ID_PART_ENTRY_NAME" in
146 samizdat-grub-incomplete|samizdat-plaintext-incomplete|samizdat-luks-encrypted-incomplete) return ;; 159 samizdat-grub-incomplete|samizdat-plaintext-incomplete|samizdat-luks-encrypted-incomplete) return ;;