2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
7 # If our prerequisites are not met, fail.
8 type -P nbd-client >/dev/null || return 1
10 # if an nbd device is not somewhere in the chain of devices root is
11 # mounted on, fail the hostonly check.
12 [[ $hostonly ]] || [[ $mount_needs ]] && {
13 is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
16 _rootdev=$(find_root_block_device)
17 [[ -b /dev/block/$_rootdev ]] || return 1
18 check_block_and_slaves is_nbd "$_rootdev" || return 1
25 # We depend on network modules being loaded
26 echo network rootfs-block
35 inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
37 inst "$moddir/nbdroot" "/sbin/nbdroot"