diff --git a/build-tests/x86/tumbleweed/test-image-live/appliance.kiwi b/build-tests/x86/tumbleweed/test-image-live/appliance.kiwi index a4c84eabcc7..ec6a513cba8 100644 --- a/build-tests/x86/tumbleweed/test-image-live/appliance.kiwi +++ b/build-tests/x86/tumbleweed/test-image-live/appliance.kiwi @@ -107,6 +107,9 @@ + + + diff --git a/doc/source/working_with_images/network_live_iso_boot.rst b/doc/source/working_with_images/network_live_iso_boot.rst index e3bc92b4a82..e41f313c6b8 100644 --- a/doc/source/working_with_images/network_live_iso_boot.rst +++ b/doc/source/working_with_images/network_live_iso_boot.rst @@ -78,7 +78,15 @@ the network: * The boot parameter `root=live:PROTOCOL://IP/PATH...` specifies the remote endpoint and protocol to find the live ISO file. So far, - `ftp`, `http`, `https`, and `dolly` are supported. + `ftp`, `http`, `https`, and `dolly` are supported. In these modes + the ISO file is copied into the RAM space of the system. + + * The boot parameter `root=live:nbd:PROTOCOL://IP/PATH...` can be + used to remote bind the specified remote file to a local NBD block + device. The kiwi-live dracut module is using the nbdkit-curl-plugin + to serve the ISO file and opens an nbd-client connection to a local + block storage device (/dev/nbd0). In this mode the ISO file is not + copied as a whole into the RAM space of the system. 4. Boot from the Network diff --git a/dracut/modules.d/55kiwi-live/kiwi-live-lib.sh b/dracut/modules.d/55kiwi-live/kiwi-live-lib.sh index e1ee15d0f62..0c94c58606f 100755 --- a/dracut/modules.d/55kiwi-live/kiwi-live-lib.sh +++ b/dracut/modules.d/55kiwi-live/kiwi-live-lib.sh @@ -63,6 +63,14 @@ function ProvideIso { echo "/dev/disk/by-label/CDROM" fi ;; + nbd:*) \ + { + modprobe nbd + nbdkit -r curl "$(echo "${iso_url}" | cut -f2- -d:)" + nbd-client -N live 127.0.0.1 /dev/nbd0 + } &>/dev/null + echo "/dev/nbd0" + ;; *) \ echo "${root}" ;; diff --git a/dracut/modules.d/55kiwi-live/module-setup.sh b/dracut/modules.d/55kiwi-live/module-setup.sh index 620f10db05e..62fd0f093e2 100755 --- a/dracut/modules.d/55kiwi-live/module-setup.sh +++ b/dracut/modules.d/55kiwi-live/module-setup.sh @@ -30,7 +30,9 @@ install() { umount dmsetup partx blkid lsblk dd losetup \ grep cut find wc fdisk tail mkfs.ext4 mkfs.xfs \ dialog cat mountpoint curl dolly dd cryptsetup veritysetup \ - flock udevadm sed + flock udevadm sed nbdkit nbd-client + inst_simple "/usr/lib64/nbdkit/plugins/nbdkit-curl-plugin.so" \ + "/usr/lib64/nbdkit/plugins/nbdkit-curl-plugin.so" dmsquashdir=$(find "${dracutbasedir}/modules.d" -name "*dmsquash-live") if [ -n "${dmsquashdir}" ] && \ diff --git a/dracut/modules.d/55kiwi-live/parse-kiwi-live.sh b/dracut/modules.d/55kiwi-live/parse-kiwi-live.sh index 79497d1c34a..19bf92a6e58 100755 --- a/dracut/modules.d/55kiwi-live/parse-kiwi-live.sh +++ b/dracut/modules.d/55kiwi-live/parse-kiwi-live.sh @@ -26,7 +26,7 @@ case "${liveroot}" in root="${root//\//\\x2f}" root="live:aoe:/dev/etherd/${root#AOEINTERFACE=}" rootok=1 ;; - live:ftp:*|live:http:*|live:https:*|live:dolly:*) \ + live:ftp:*|live:http:*|live:https:*|live:nbd:*|live:dolly:*) \ modprobe -q brd root="${root#live:}" root="live:net:${root}" diff --git a/package/python-kiwi-spec-template b/package/python-kiwi-spec-template index 5b8193c4d59..5bb2914bdb0 100644 --- a/package/python-kiwi-spec-template +++ b/package/python-kiwi-spec-template @@ -613,6 +613,9 @@ Requires: dialog Requires: xfsprogs Requires: e2fsprogs Requires: util-linux +Requires: nbd +Requires: nbdkit +Requires: nbdkit-curl-plugin # lsblk is part of util-linux-systemd on openSUSE %if 0%{?suse_version} Requires: util-linux-systemd