[archiso] Use poll_device() in _pxe_nbd and _loop_mnt hooks.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
1635eacfe7
commit
0ff40f153a
2 changed files with 12 additions and 4 deletions
|
@ -9,8 +9,12 @@ run_hook () {
|
||||||
archiso_loop_mount_handler () {
|
archiso_loop_mount_handler () {
|
||||||
newroot="${1}"
|
newroot="${1}"
|
||||||
|
|
||||||
while [ ! -b "${img_dev}" ]; do
|
msg ":: Waiting for boot device..."
|
||||||
sleep 1
|
while ! poll_device ${img_dev} 30; do
|
||||||
|
echo "ERROR: boot device didn't show up after 30 seconds..."
|
||||||
|
echo " Falling back to interactive prompt"
|
||||||
|
echo " You can try to fix the problem manually, log out when you are finished"
|
||||||
|
launch_interactive_shell
|
||||||
done
|
done
|
||||||
|
|
||||||
msg "::: Setup a loop device from ${img_loop} located at device ${img_dev}"
|
msg "::: Setup a loop device from ${img_loop} located at device ${img_dev}"
|
||||||
|
|
|
@ -64,8 +64,12 @@ archiso_pxe_nbd_mount_handler () {
|
||||||
|
|
||||||
# Module autoloading like with loop devices does not work, doing manually...
|
# Module autoloading like with loop devices does not work, doing manually...
|
||||||
modprobe nbd 2> /dev/null
|
modprobe nbd 2> /dev/null
|
||||||
while [ ! -b /dev/nbd0 ]; do
|
msg ":: Waiting for boot device..."
|
||||||
sleep 1
|
while ! poll_device /dev/nbd0 30; do
|
||||||
|
echo "ERROR: boot device didn't show up after 30 seconds..."
|
||||||
|
echo " Falling back to interactive prompt"
|
||||||
|
echo " You can try to fix the problem manually, log out when you are finished"
|
||||||
|
launch_interactive_shell
|
||||||
done
|
done
|
||||||
|
|
||||||
msg "::: Setup NBD from ${nbdserver} at /dev/nbd0"
|
msg "::: Setup NBD from ${nbdserver} at /dev/nbd0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue