summaryrefslogtreecommitdiff
path: root/src/initrd/grok-block
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-03-28 16:07:09 -0400
committerAndrew Cady <d@jerkface.net>2017-03-28 16:12:28 -0400
commit5160fd50cf2bf09700c20236cac992a7a85fc943 (patch)
treec4bef4cc1b8a0635222cf83b4927f5fdcdedf635 /src/initrd/grok-block
parent2a575328ac1432c21e0b983d2432f1f64dff0f96 (diff)
Use pxelinux "ipappend" option to choose rootfs source
This fixes the issue described in the first 'netkeys' commit, where the network would need to be available even when it was not used. The "ipappend" option results in a $BOOTIF variable in the initrd environment. This variable is now used to determine whether to wait on the network for a rootfs & keys, or to wait on the boot device becoming available to determine whether it has the keys. That is, there may or may not be a boot device which may or may not have keys and/or rootfs, but we will always know for sure whether it does, therefore there are no races and no waiting on the network unnecessarily. The qemu.sh script was updated to provide the BOOTIF variable when PXE boot is emulated.
Diffstat (limited to 'src/initrd/grok-block')
-rwxr-xr-xsrc/initrd/grok-block7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/initrd/grok-block b/src/initrd/grok-block
index 3ad0432..f44ed19 100755
--- a/src/initrd/grok-block
+++ b/src/initrd/grok-block
@@ -150,8 +150,11 @@ grok_block()
150 # 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.
151 /dev/nbd0) 151 /dev/nbd0)
152 if [ -e /bootwait/samizdat-nbd-dev ] 152 if [ -e /bootwait/samizdat-nbd-dev ]
153 then return 153 then
154 else wait_for_files_ /sys/block/nbd0/pid 154 return
155 else
156 bootwait nbd-script
157 wait_for_files_ /sys/block/nbd0/pid
155 fi 158 fi
156 ;; 159 ;;
157 esac 160 esac