/usr/lib/dracut/modules.d/95nbd/module-setup.sh is in dracut-network 040+1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/bash
# called by dracut
check() {
local _rootdev
# If our prerequisites are not met, fail.
require_binaries nbd-client || return 1
# if an nbd device is not somewhere in the chain of devices root is
# mounted on, fail the hostonly check.
[[ $hostonly ]] || [[ $mount_needs ]] && {
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
_rootdev=$(find_root_block_device)
[[ -b /dev/block/$_rootdev ]] || return 1
check_block_and_slaves is_nbd "$_rootdev" || return 255
}
return 0
}
# called by dracut
depends() {
# We depend on network modules being loaded
echo network rootfs-block
}
# called by dracut
installkernel() {
instmods nbd
}
# called by dracut
install() {
inst nbd-client
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot"
dracut_need_initqueue
}
|