]> git.ipfire.org Git - thirdparty/dracut-ng.git/commit
feat(dracut): add a DRACUT_EXTRA_ARGS environment variable
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 10 Apr 2026 13:21:51 +0000 (09:21 -0400)
committerBenjamin Drung <bdrung@ubuntu.com>
Mon, 13 Apr 2026 13:03:50 +0000 (15:03 +0200)
commit99738e526b7e17ebc0e18bbf51037cb4d0d82304
tree5e02d61e212d72227dbe37c4d9d0c811cf020f1a
parent8a82565e364b915fa9578e4658312e9c3389de3f
feat(dracut): add a DRACUT_EXTRA_ARGS environment variable

Some build tools (e.g. autopkgtest-build-qemu) invoke dracut indirectly
through update-initramfs via dpkg triggers, making it impossible to pass
extra flags directly on the command line.

Add a DRACUT_EXTRA_ARGS environment variable whose contents are
word-split and prepended to the dracut argument list before option
parsing.  This allows callers to inject arbitrary flags without modifying
the configuration on disk:

  DRACUT_EXTRA_ARGS=--no-hostonly autopkgtest-build-qemu ...

The variable is intentionally word-split (like MAKEFLAGS), so arguments
that themselves contain spaces must be shell-quoted within the value:

  DRACUT_EXTRA_ARGS='--add "mod1 mod2"' dracut

Changed test 13 to provide test coverage for DRACUT_EXTRA_ARGS variable.
dracut.sh
man/dracut.8.adoc
test/TEST-13-SYSROOT/test.sh