Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build-tests/x86/tumbleweed/test-image-live/appliance.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
<package name="kernel-default"/>
<package name="kernel-firmware-all"/>
<package name="timezone"/>
<package name="nbd"/>
<package name="nbdkit"/>
<package name="nbdkit-curl-plugin"/>
<package name="dracut-kiwi-live"/>
</packages>
<packages type="bootstrap">
Expand Down
10 changes: 9 additions & 1 deletion doc/source/working_with_images/network_live_iso_boot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions dracut/modules.d/55kiwi-live/kiwi-live-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
;;
Expand Down
4 changes: 3 additions & 1 deletion dracut/modules.d/55kiwi-live/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
2 changes: 1 addition & 1 deletion dracut/modules.d/55kiwi-live/parse-kiwi-live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
3 changes: 3 additions & 0 deletions package/python-kiwi-spec-template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading