Skip to content

Commit fb08452

Browse files
committed
redhat: Explicitly disable 'hostonly' mode on the dracut cmdline
Upstream Status: RHEL only JIRA: https://issues.redhat.com/browse/RHEL-109610 Despite the fact that we have hostonly="no" and also override /etc/dracut.conf.d directory with --confdir=$(mktemp -d), 'hostonly' mode still gets enabled in the builds. This can be seen in the logs: 00:30:55 dracut[W]: Running in hostonly mode in a container! This is undesired. In particular, 'hostonly' mode tries to grab /etc/shadow from the system and obviously fails. This leads to broken emergency shell in the UKI's initramfs. Other issues are also possible as in 'hostonly' mode the result depends a lot on the building environment. The reason for such behavior is that dracut has a *third' place where it gets its configuration (/usr/lib/dracut/dracut.conf.d/) and this one can't be overriden. Make sure we always disable 'hostonly' by adding 'no-hostonly' cmdline switch: this gets priority over any configuration file. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
1 parent b4df573 commit fb08452

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

redhat/kernel.spec.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,7 @@ BuildKernel() {
27622762

27632763
dracut --conf=%{SOURCE86} \
27642764
--confdir=$(mktemp -d) \
2765+
--no-hostonly \
27652766
--verbose \
27662767
--kver "$KernelVer" \
27672768
--kmoddir "$RPM_BUILD_ROOT/lib/modules/$KernelVer/" \

0 commit comments

Comments
 (0)