Skip to content

Commit

Permalink
fix(nbd): assume nbd version >= 3.8
Browse files Browse the repository at this point in the history
This reduces the quirks.
  • Loading branch information
haraldh committed May 14, 2021
1 parent 66b920c commit 6209ede
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions modules.d/95nbd/nbdroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,14 @@ EOF
# to create the /sysroot mount.
fi

# supported since nbd 3.8 via 77e97612
if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then
preopts="-systemd-mark $preopts"
fi

if ! [ "$nbdport" -gt 0 ] 2> /dev/null; then
nbdport="-name $nbdport"
fi

if ! nbd-client -check /dev/nbd0 > /dev/null; then
# shellcheck disable=SC2086
nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1
nbd-client -p -systemd-mark "$nbdserver" $nbdport /dev/nbd0 $opts || exit 1
fi

# NBD doesn't emit uevents when it gets connected, so kick it
echo change > /sys/block/nbd0/uevent
udevadm settle
need_shutdown
exit 0

0 comments on commit 6209ede

Please sign in to comment.