Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (33 sloc) 1.37 KB
#!/bin/bash
build() {
add_module nbd
add_binary nbd-client
add_runscript
}
help() {
cat<<HELPEOF
This hook allows you to boot from a Network Block Device (NBD).
The 'nbd' hook depends on the 'net' hook, so make sure you add 'net'
before 'nbd' in the hook list in '/etc/mkinitcpio.conf'. You will also
have to remove 'autodetect' from the hook list because the initrd
image will be created on the server and not the client.
Kernel Parameters:
<nbd_host> The IP address of the machine running nbd-server.
This parameter is required.
<nbd_name> The name of the export to connect to as specified in
in /etc/nbd-server/config on the server.
This parameter is required.
<nbd_port> The port on which nbd-server is running. This parameter
is only required if nbd-server is not running on the
default port (10809).
Also make sure that you set 'root=/dev/nbd0' and the 'ip' parameter
from the 'net' hook (see 'mkinitcpio -H net' for details).
Your hook list may then look like this:
HOOKS="base udev net nbd filesystems"
If your NBD device is encrypted, set 'cryptdevice=/dev/nbd0:nbdcrypt' and
'root=/dev/mapper/nbdcrypt'. You also will have to add the hooks 'keyboard',
'keymap' and 'encrypt' to your hook list after the 'net' and 'nbd' hooks.
Your hook list may then look like this:
HOOKS="base udev net nbd keyboard keymap encrypt filesystems"
HELPEOF
}