commit:     fa433b368a95deecfc4215f4aa89445ef199b753
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 28 22:04:31 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb 28 22:10:42 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa433b36

kernel-install.eclass: Fix bypassing dracut configs

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/kernel-install.eclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index b8109f47d0b..965001924e7 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -211,9 +211,15 @@ kernel-install_test() {
 
        local qemu_arch=$(kernel-install_get_qemu_arch)
 
+       # NB: if you pass a path that does not exist or is not a regular
+       # file/directory, dracut will silently ignore it and use the default
+       # https://github.com/dracutdevs/dracut/issues/1136
+       > "${T}"/empty-file || die
+       mkdir -p "${T}"/empty-directory || die
+
        dracut \
-               --conf /dev/null \
-               --confdir /dev/null \
+               --conf "${T}"/empty-file \
+               --confdir "${T}"/empty-directory \
                --no-hostonly \
                --kmoddir "${modules}" \
                "${T}/initrd" "${version}" || die

Reply via email to