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

Unbootable initramfs with --sysroot #893

Closed
ahesford opened this issue Aug 11, 2020 · 5 comments
Closed

Unbootable initramfs with --sysroot #893

ahesford opened this issue Aug 11, 2020 · 5 comments
Labels
stale communication is stuck

Comments

@ahesford
Copy link
Contributor

On a Void Linux system with a mostly stock configuration (for the distribution), dracut --sysroot does not produce bootable initramfs images. The major problem seems to be the omission of important udev rules that prevent device recognition.

Steps to reproduce:

  1. From a stock dracut-050 installation, try to build an image from the root of desired sysroot:
cd / && dracut -N -q --sysroot . tmp/initramfs-$(uname -r).img $(uname -r)
  1. Confirm that the following files are missing from the resulting initramfs, when they are present in images built without the --sysroot . argument:
etc/udev/rules.d/10-console.rules
etc/udev/rules.d/59-persistent-storage.rules
etc/udev/rules.d/61-persistent-storage.rules
usr/lib/dracut/need-initqueue
usr/lib/udev/ata_id
usr/lib/udev/cdrom_id
usr/lib/udev/rules.d/50-udev-default.rules
usr/lib/udev/rules.d/60-block.rules
usr/lib/udev/rules.d/60-persistent-storage.rules
usr/lib/udev/rules.d/75-net-description.rules
usr/lib/udev/rules.d/80-drivers.rules
usr/lib/udev/rules.d/80-net-name-slot.rules
usr/lib/udev/scsi_id
  1. Attempt to boot the image.

  2. Attempt to resolve the sysroot to an absolute path:

cd / && dracut -N -q --sysroot $(readlink -f .) tmp/initramfs-$(uname -r).img $(uname -r)
  1. Watch a cascade of installation errors flood the screen.

Expected behavior

The image proeduced with --sysroot . should include the missing udev files and allow the system to boot, and the --sysroot $(readlink -f .) (which, in this example, should resolve to --sysroot /) should produce a similarly bootable image.

Actual behavior

The image produced wth --sysroot . lacks the udev configuration necessary to identify root devices, so the image will not be capable of booting the system. Attempting to use --sysroot $(readlink -f .) causes numerous errors that prevent an image from being created in the first place.

Motivation

In Void Linux, we have automatic post-installation hooks that generate initramfs images for newly installed kernels. The XBPS package manager can support installing to alternate roots; the hooks are always executed with the CWD as the target root. Running dracut without --sysroot will ignore the difference between the "host" installation and the target root (when the two differ), so the resulting images will be built against the wrong root fs (the host and target roots might not even have the same collection of kernel modules). Proper support for --sysroot would allow the installation hook to change to the target root and run dracut --sysroot . and build an image against files in the target root.

@johannbg
Copy link
Collaborator

Out of curiosity does Void Linux use the system management framework ( systemd ) or is Void Linux a non-systemd system?

@ahesford
Copy link
Contributor Author

Void uses runit instead of systemd.

@stale
Copy link

stale bot commented Dec 16, 2020

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Dec 16, 2020
@ahesford
Copy link
Contributor Author

This issue is not stale.

@stale stale bot removed the stale communication is stuck label Dec 17, 2020
@stale
Copy link

stale bot commented Jan 16, 2021

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Jan 16, 2021
@stale stale bot closed this as completed Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale communication is stuck
Projects
None yet
Development

No branches or pull requests

2 participants