OSInside/kiwi-boxed-plugin

`--config` option is not passed to the Kiwi instance inside the box

Closed this issue · 2 comments

I'm trying to make use of the boxed plugin to build Ubuntu images, but I'm running into a problem with trying to pass through the Kiwi configuration file. Building Ubuntu images requires the following configuration passed to Kiwi using --config:

runtime_checks:
  - disable:
      - "check_dracut_module_for_disk_overlay_in_package_list"

However, this configuration does not seem to be passed to the Kiwi instance running inside of the box (note that I added the --config flag before system boxbuild, but it is not a part of the argument list shown by "Building with"):

$ kiwi  --debug --profile development --config nemos-images-reference-lunar/kiwi.yaml  system boxbuild --box ubuntu  --box-memory=$(( 6 * 1024))  --box-smp-cpus=2 -- --description nemos-images-reference-lunar/qemu-amd64
/ --target-dir ~/tmp/kiwi-amd64
[ INFO    ]: 14:01:02 | Reading runtime config file: 'nemos-images-reference-lunar/kiwi.yaml'
[ INFO    ]: 14:01:02 | Reading box plugin config file: /usr/lib/python3.11/dist-packages/kiwi_boxed_plugin/config/kiwi_boxed_plugin.yml
[ INFO    ]: 14:01:02 | Validating kiwi_build_command_args:
    ['system', 'build', '--description', 'nemos-images-reference-lunar/qemu-amd64/', '--target-dir', '/home/itrue/tmp/kiwi-amd64']
[ INFO    ]: 14:01:02 | Building with:
    ['--debug', '--profile', 'development', 'system', 'build', '--description', 'nemos-images-reference-lunar/qemu-amd64/', '--target-dir', '/home/itrue/tmp/kiwi-amd64']

This results in the following build error:

[ DEBUG   ]: 11:58:18 | EXEC: [mkdir -p /result/build]
[ INFO    ]: 11:58:18 | Loading XML description
[ INFO    ]: 11:58:18 | Support for XML markup available
[ INFO    ]: 11:58:32 | --> loaded /description/appliance.kiwi
[ INFO    ]: 11:58:32 | --> Selected build type: oem
[ INFO    ]: 11:58:32 | --> Selected profiles: development
[ ERROR   ]: 11:58:32 | KiwiRuntimeError:

Required dracut module package missing in package list

The package 'dracut-kiwi-overlay' is required for the selected
overlayroot activated image type. Please add the
following in your <packages type="image"> section to
your system XML description:

<package name="dracut-kiwi-overlay"/>

yes there is no automatic transport of a custom kiwi config into the box. You can solve this as follows:

  • In your image description create a directory called boxroot
  • Place the kiwi config of your choice to boxroot/etc/kiwi.yml
  • Now run boxbuild again

If the boxbuild plugin finds a boxroot it incorporates this extra boxroot tree into the box. The kiwi process running inside of the box now sees an /etc/kiwi.yml file and that makes your settings effective in the box. This is also the way we add any other arbitrary data into the box

Let me know if that worked for you

Thanks

Thanks @schaefi! That's exactly what I needed. It works perfectly.