-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnbd_install
41 lines (33 loc) · 1.37 KB
/
nbd_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/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
}