You are not logged in.

#1 2022-09-11 12:51:27

Cvlc
Member
Registered: 2020-03-26
Posts: 273

[improvement / idea] Mkinitcpio / pacstrap / (dracut ?) --uefi flag

Hi,

I'm not sure where to post this, because even though it's mostly mkinitpcio stuff, it does span multiple projects (Arch installation Guide / pacstrap / possibly Dracut)

I would like to suggest an idea for the initramfs generation workflow. Basically, the idea would be to include some kind of a switch during the installation process (and in mkinitcpio), to choose between standard initramfs images and unified kernel images, and remember that choice. That switch would stay in that position unless switched to the other position.

For example, one would be able to run something similar to

# mkinitcpio -P --uefi --save 

This would be the equivalent of the current mkinitcpio command in the Installation Guide, except that :
* an EFI bundle is generated instead of an initramfs image
* the setting is saved (possibly in mkinitcpio.conf, or elsewhere) so that the next time mkinitcpio is triggered, it automatically generates an EFI bundle again.

pacstrap could have a similar switch :

# pacstrap --uefi /mnt base linux linux-firmware

This would pass on the switch to mkinitcpio, and possibly to dracut as well if this is used instead, so that the very first generation can be an EFI bundle (currently not easily feasible to my knowledge)

Without changing any of Arch's defaults or forcing anything onto anybody, this would would be a very easy way for a fresh install to use a unified kernel image instead of a regular initramfs. There's no reason for EFI bundles to become the default, but they're still very convenient and should be easier to use.

Right now mkinitpcio only understands

# mkinitcpio--uefi *filename*

which is nice, but needs to be run manually every time. Alternatively, the preset file must be manually modified, which is a very strange thing to do during the installation process. As a result, there is no simple way to perform a fresh install which leaves you with an EFI bundle instead of an initramfs img, even though an EFI bundle is a very convenient thing (automatic discovery by systemd-boot, future use with Secure Boot...)

Thanks for reading through this, hope to read your comments and ideas !

[extra]
Jotting down other ideas

--save could be optional (automatic switching, but needs another flag for regular initrds)
--uefi yes/no

Last edited by Cvlc (2022-09-11 12:57:39)

Offline

#2 2022-09-12 12:17:12

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [improvement / idea] Mkinitcpio / pacstrap / (dracut ?) --uefi flag

The arch wiki page mentions 2 options for booting a unified kernel image, systemd-boot and directly from efi firmware .
Can other bootloaders like ReFind and grub work with this ?

I feel this doesn't fit with pacstrap but should be dealt with in the "bootloader install" part of an installation .

Adding templates or presets for creating unified kernel images to mkinitcpio does seem like a reasonable idea.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#3 2022-09-12 12:53:04

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [improvement / idea] Mkinitcpio / pacstrap / (dracut ?) --uefi flag

It shouldn't be a problem for any bootloader.
See https://wiki.archlinux.org/title/GRUB#C … rnel_image

The problem is in making that unified kernel image.

The only issue with pacstrap (not really pacstrap related) is that when mkinitcpio is installed it will be run for the first time and a very first initramfs will be generated, before there's a chance to configure it.

Offline

#4 2022-09-29 11:06:05

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [improvement / idea] Mkinitcpio / pacstrap / (dracut ?) --uefi flag

Not a solution but I've written up a dm-crypt example scenario which includes using efi images straight from installation.

I still think that editing linux.preset files in arch-chroot is far from ideal and can lead to mistakes.

Lone_Wolf wrote:

Adding templates or presets for creating unified kernel images to mkinitcpio does seem like a reasonable idea.

Actually, it's been done here : https://github.com/archlinux/mkinitcpio … ple.preset

But I don't think this has ever made its way anywhere. There are a couple of interesting PRs waiting and this is still relatively new.

Offline

Board footer

Powered by FluxBB