summaryrefslogtreecommitdiff
path: root/archiso/hooks/archiso_pxe_nbd
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-08-25 15:14:51 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-08-25 15:14:51 -0300
commit6fae221c28cf677809f52dea7cecdd74406cc8ac (patch)
tree776ed1ff14a36ac72f8d472fb9bf6531e99707ce /archiso/hooks/archiso_pxe_nbd
parent0fdbf313415e28ebc96e1fb5da7577b996ab6aa1 (diff)
downloadarchiso32-6fae221c28cf677809f52dea7cecdd74406cc8ac.tar.xz
[archiso] Always copytoram for NBD
Avoid issues on shutdown (and during normal usage if network settings changed) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso/hooks/archiso_pxe_nbd')
-rw-r--r--archiso/hooks/archiso_pxe_nbd18
1 files changed, 5 insertions, 13 deletions
diff --git a/archiso/hooks/archiso_pxe_nbd b/archiso/hooks/archiso_pxe_nbd
index 6147d06..a9f84d5 100644
--- a/archiso/hooks/archiso_pxe_nbd
+++ b/archiso/hooks/archiso_pxe_nbd
@@ -15,6 +15,7 @@ archiso_pxe_nbd_mount_handler () {
# Module autoloading like with loop devices does not work, doing manually...
modprobe nbd 2> /dev/null
+
msg ":: Waiting for boot device..."
while ! poll_device /dev/nbd0 30; do
echo "ERROR: boot device didn't show up after 30 seconds..."
@@ -24,22 +25,13 @@ archiso_pxe_nbd_mount_handler () {
done
msg ":: Setup NBD from ${archiso_nbd_srv} at /dev/nbd0"
- if [[ "${copytoram}" = "y" ]]; then
- nbd-client ${archiso_nbd_srv} -N ${archiso_nbd_name} /dev/nbd0
- else
- nbd-client ${archiso_nbd_srv} -N ${archiso_nbd_name} /dev/nbd0 -persist
- fi
+ nbd-client ${archiso_nbd_srv} -N ${archiso_nbd_name} /dev/nbd0
+ copytoram="y"
archisodevice=/dev/nbd0
archiso_mount_handler ${newroot}
- if [[ "${copytoram}" = "y" ]]; then
- msg ":: Disconnect NBD from ${archiso_nbd_srv} at /dev/nbd0"
- nbd-client -d /dev/nbd0
- else
- mkdir -p /run/archiso
- pidof nbd-client > /run/archiso/nbd_client.pid
- cp /archiso_pxe_nbd ${newroot}/etc/rc.d/functions.d/
- fi
+ msg ":: Disconnect NBD from ${archiso_nbd_srv} at /dev/nbd0"
+ nbd-client -d /dev/nbd0
}