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

busybox modprobe incompatibility #2581

Closed
Geertsky opened this issue Dec 9, 2023 · 11 comments · Fixed by dracut-ng/dracut-ng#55
Closed

busybox modprobe incompatibility #2581

Geertsky opened this issue Dec 9, 2023 · 11 comments · Fixed by dracut-ng/dracut-ng#55
Labels
bug Our bugs iscsi Issues related to the iscsi module

Comments

@Geertsky
Copy link

Geertsky commented Dec 9, 2023

Describe the bug
Including busybox causes the emergency shell to get started due to incompatibility of modprobe.

Distribution used
Fedora38

Dracut version
059-5.fc38

Init system
systemd

To Reproduce

sudo dracut -NM -a "sshd busybox network lvm systemd-resolved" <path to initramfs> $(uname -r)

Expected behavior
Normal bootup

Additional context
It seems a problem with dropbox modprobe not supporting the --all flag. See rdsosreport.txt line 1099

rdsosreport.txt

@Geertsky Geertsky added the bug Our bugs label Dec 9, 2023
@LaszloGombos LaszloGombos added the iscsi Issues related to the iscsi module label Dec 9, 2023
@LaszloGombos
Copy link
Collaborator

@Geertsky
Copy link
Author

Geertsky commented Dec 9, 2023

Tried to exclude the iscsi module but the problem persists...

sudo dracut -NM -m bash systemd systemd-initrd systemd-resolved systemd-sysusers modsign busybox nss-softokn dbus-broker dbus i18n network-manager network ifcfg sshd drm plymouth bcache btrfs crypt dm dmraid kernel-modules kernel-modules-extra kernel-network-modules lvm mdraid nvdimm qemu qemu-net cifs  lunmask nfs resume rootfs-block terminfo udev-rules virtiofs dracut-systemd usrmount base fs-lib memstrack shutdown /tmp/initramfs-test.img 6.6.3-100.fc38.x86_64 --force

rdsosreport.txt

@LaszloGombos
Copy link
Collaborator

@Geertsky Are you in a position to help test #2582 ? Thanks !

@Geertsky
Copy link
Author

@LaszloGombos Seems to work. I'm still having problems with busybox mount not being able to mount xfs or vfat filesystems though...

@LaszloGombos
Copy link
Collaborator

@LaszloGombos Seems to work. I'm still having problems with busybox mount not being able to mount xfs or vfat filesystems though...

Try rd.driver.pre=xfs rd.driver.pre=vfat kernel command line. Thanks

@Geertsky
Copy link
Author

@LaszloGombos Sorry for the late reply... But you're right! That did it! Wondering why dracut with busybox doesn't autoload these modules though...

@dbnicholson
Copy link

It would be nice if you could provide an allowlist or denylist for the busybox programs. We recently ran into failures because the busybox blkid implementation is a toy that's nothing like the real thing. Something like busyboxapplets and omit_busyboxapplets. Would something like that be acceptable?

@LaszloGombos
Copy link
Collaborator

@dbnicholson In most cases blkid can be replaced by udevadm and dracut can be more portable with changes like this - #2033 .

@dbnicholson
Copy link

@dbnicholson In most cases blkid can be replaced by udevadm and dracut can be more portable with changes like this - #2033 .

In some cases, sure. In our case we have a dracut module that expands the root partition. In order to know what type of partitioning is needed, we use blkid -o value -s PTTYPE. We could switch to lsblk or similar, but that depends on udev setting the properties. That introduces a potential failure if that hasn't happened yet. Whereas blkid will probe the block device directly.

Anyways, that's just papering over the issue. The busybox implementations of several utilities (especially the util-linux ones) are very minimal. If you enable the busybox module, it will happily symlink any applet that's included by busybox. The only way to replace the busybox symlinks with the real thing is to manually delete the symlink and install again. If you enable the busybox module and you get a toy program, there's little you can do about it.

@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Feb 29, 2024

@dbnicholson this is good background, but we need to narrow this down for actionable improvements that is in scope for the dracut project to improve (and not the busybox project).

If you enable the busybox module and you get a toy program, there's little you can do about it.

Would --include help here as that would overwrite the symlink ?
dracut --include SOURCE TARGET

In our case we have a dracut module

Depending on the "ordering of your dracut module" are you not able to manually opt in to some util-linux binaries in your dracut module ?

@dbnicholson
Copy link

@dbnicholson this is good background, but we need to narrow this down for actionable improvements that is in scope for the dracut project to improve (and not the busybox project).

Of course. Here is a patch I wrote yesterday to workaround our specific breakage. That simply hardcodes blkid (with potential for later additions like modprobe) to be skipped. I'm confident you don't want busybox's blkid as it would break every usage within dracut except for the single bare blkid in rdsosreport.

What I suggested earlier was providing configuration options such as busyboxapplets/omit_busyboxapplets. In the busybox module setup you'd either use the list in busyboxapplets, start with busybox --list and trim out omit_busyboxapplets, or just use the full busybox --list like is done now.

If you enable the busybox module and you get a toy program, there's little you can do about it.

Would --include help here as that would overwrite the symlink ? dracut --include SOURCE TARGET

I don't think so. The --include processing happens after the modules and uses inst for files. That silently skips if the target already exists.

In our case we have a dracut module

Depending on the "ordering of your dracut module" are you not able to manually opt in to some util-linux binaries in your dracut module ?

We'd have to order our module before 05busybox, which is possible but not what I'd expect to do if I was just writing a regular dracut module. However, at present I'm pretty sure it wouldn't work since the busybox module doesn't check for a target that already exists and then forcefully overwrites with ln_r.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Our bugs iscsi Issues related to the iscsi module
Projects
None yet
3 participants