-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add initramfs-tools implementation for cpio firmware loading #30
base: main
Are you sure you want to change the base?
Conversation
- Add initramfs hooks and boot scripts to extract and mount firmware - Add initramfs and ubuntu make targets - busybox mount doesn't support PARTUUID= so use /dev/disk/by-partuuid Signed-off-by: Tobias Heider <[email protected]>
#!/usr/bin/sh | ||
# SPDX-License-Identifier: MIT | ||
|
||
PREREQ="udev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this script run before udev? From https://github.com/AsahiLinux/docs/wiki/Open-OS-Ecosystem-on-Apple-Silicon-Macs#linux-specific:
Firmware must be located and loaded before udev starts up. This is because udev can arbitrarily cause modules to load and devices to probe (even if not triggered directly, the kernel can e.g. discover PCI devices while the initramfs is already running), and this creates race conditions where firmware might not be available when it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rename the directory initramfstools
as initramfs
is not descriptive enough?
install-fedora: install install-dracut | ||
|
||
install-ubuntu: install install-initramfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be install-debian
.
@@ -75,4 +91,6 @@ uninstall-arch: uninstall-mkinitcpio | |||
|
|||
uninstall-fedora: uninstall-dracut | |||
|
|||
uninstall-ubuntu: uninstall-initramfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be uninstall-debian
.
@@ -54,8 +54,19 @@ install-arch: install install-mkinitcpio | |||
install -dD $(DESTDIR)$(PREFIX)/share/libalpm/hooks | |||
install -m0644 -t $(DESTDIR)$(PREFIX)/share/libalpm/hooks libalpm/hooks/95-m1n1-install.hook | |||
|
|||
install-initramfs: install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use initramfstools
here instead of initramfs
? Otherwise it's confusing to people...
@@ -67,6 +78,11 @@ uninstall-mkinitcpio: | |||
uninstall-dracut: | |||
rm -f $(DESTDIR)$(DRACUT_CONF_DIR)/10-asahi.conf | |||
|
|||
uninstall-initramfs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here wrt initramfs
.
This PR adds our Ubuntu implementation for firmware loading with initramfs-tools. I am sharing this here because I think it might also be useful for other initramfs-tools based distros such as Debian or Pop!_Os.
The changes added are:
The initramfs scripts are pretty much identical to the dracut and initcpio versions.
The only change I had to make to the existing code is because of a limitation in busybox which we use in our initrd.
busybox mount does not support
PARTUUID
so I am using/dev/disk/by-partuuid
instead. As I understand it that approach should be fairly portable but I wouldn't mind making it a Ubuntu-only quirk either.