permit to use a postprocessed nbdroot
When using a postprocessed nbdroot like: actions:
deploy: to: downloads postprocess: docker: image: debian:buster steps: - mkdir rootfs - cd rootfs && tar xpf ../rootfs* - mke2fs -d . -m 0 -t ext2 ../rootfs.ext2 1600M images: stage3: url: http://xxx/root.tar.xz compression: xz
deploy: protocols: lava-xnbd: - action: nbd-deploy request: set_port to: nbd nbdroot: url: downloads://rootfs.ext2
...LAVA fail with a keyerror on nbdroot.
Problem #1: This is due that only downloaded files(via class DownloadHandler) ran the spetial "nbdroot register": if "lava-xnbd" in self.parameters and nbdroot: self.parameters["lava-xnbd"]["nbdroot"] = nbdroot The solution is to register nbdroot also for pre-downloaded files. (via PreDownloadedAction)
Problem #2: But PreDownloadedAction only know full path to the nbdroot, so we need to add a check in XnbdAction() since "normal nbdroot" are stored via relative path.
Problem #3: The last problem is that when using a postprocessed NBD root, NBDSERVERIP and NBDSERVERPORT are not replaced. So the "use NBD" check in BootloaderCommandOverlay need to be replaced.