Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dracut needs /proc and /dev mounts #1867

Closed
Vogtinator opened this issue Jun 26, 2021 · 6 comments · Fixed by #1871
Closed

Dracut needs /proc and /dev mounts #1867

Vogtinator opened this issue Jun 26, 2021 · 6 comments · Fixed by #1871
Assignees

Comments

@Vogtinator
Copy link
Collaborator

Using python3-kiwi-9.23.31-1.1, the generated initrd is incomplete because dracut fails to run some commands due to missing mounts:

[  116s] [ DEBUG   ]: 22:30:05 | EXEC: [chroot /usr/src/packages/KIWI-vmx/build/image-root dracut --verbose --no-hostonly --no-hostonly-cmdline --xz --install /.profile --omit  multipath  --install /config.partids openSUSE-MicroOS.x86_64-16.0.0.initrd.xz 5.12.12-1-default]
[  191s] [ DEBUG   ]: 22:31:20 | findmnt: can't read /proc/mounts: No such file or directory
[  191s] dracut: Executing: /usr/bin/dracut --verbose --no-hostonly --no-hostonly-cmdline --xz --install /.profile --omit " multipath " --install /config.partids openSUSE-MicroOS.x86_64-16.0.0.initrd.xz 5.12.12-1-default
...
[  191s] dracut: *** Including module: systemd ***
[  191s] /usr/lib/dracut/modules.d/00systemd/module-setup.sh: line 168: /dev/fd/63: No such file or directory
...
[  191s] dracut: *** Including module: url-lib ***
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 35: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 37: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 35: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 37: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 35: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 37: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 35: /dev/fd/63: No such file or directory
[  191s] /usr/lib/dracut/modules.d/45url-lib/module-setup.sh: line 37: /dev/fd/63: No such file or directory
[  191s] dracut: Couldn't find SSL CA cert bundle or libnssckbi.so; HTTPS won't work.
...
[  191s] dracut: *** Including module: kernel-modules-extra ***
[  191s] dracut:   kernel-modules-extra: configuration source "/run/depmod.d" does not exist
[  191s] dracut:   kernel-modules-extra: configuration source "/lib/depmod.d" does not exist
[  191s] /usr/lib/dracut/modules.d/90kernel-modules-extra/module-setup.sh: line 77: /dev/fd/63: No such file or directory
[  191s] dracut:   kernel-modules-extra: parsing configuration file "00-system.conf//etc/depmod.d/00-system.conf"
[  191s] /usr/lib/dracut/modules.d/90kernel-modules-extra/module-setup.sh: line 82: 00-system.conf//etc/depmod.d/00-system.conf: No such file or directory
@schaefi
Copy link
Collaborator

schaefi commented Jun 29, 2021

Hmm, it looks up stuff in /dev and /proc on the host the image is created on. I fear even if we mount this it could lead to wrong results. dracut is called in "--no-hostonly" mode, can we first clarify what it looks up on the host ?

You said the generated initrd is incomplete, what exactly is missing that harms on the image when used as such later on ?
and does it really require us to mount host filesystems when creating a no-host-only initrd ?

Thanks

@Vogtinator
Copy link
Collaborator Author

Bash needs /dev/fd/XX for expressions such as cat <(echo hi). So without /dev/ being present, core bash features are simply not working.

@schaefi
Copy link
Collaborator

schaefi commented Jun 29, 2021

makes sense and let me wonder why it was not an issue before... I'll check on the code

@Vogtinator
Copy link
Collaborator Author

I guess that before the update to dracut 55, it didn't make use of that feature or only in places where it didn't cause any issues.

@schaefi schaefi self-assigned this Jun 29, 2021
schaefi added a commit that referenced this issue Jun 29, 2021
In newer versions of dracut /dev and /proc must be mounted
for dracut to work correctly. If not present the resulting
initrd is incomplete. This Fixes #1867
@schaefi
Copy link
Collaborator

schaefi commented Jun 29, 2021

PR open for review

@Vogtinator
Copy link
Collaborator Author

Hmm, it looks up stuff in /dev and /proc on the host the image is created on. I fear even if we mount this it could lead to wrong results. dracut is called in "--no-hostonly" mode, can we first clarify what it looks up on the host ?

I think this particular error message is just from checking whether /tmp is mounted noexec, which should be fine. There are various other places where dracut calls findmnt to look at /proc/self/mounts, but in theory those should be unused in non-hostonly mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants