You are not logged in.

#1 2021-07-18 22:49:46

ashwin.vbs
Member
Registered: 2016-02-04
Posts: 5

Multi boot Archlinux with single initramfs/kernel = potential issues?

I want to setup two copies of the archlinux distribution in the following way.

USB key:
partition 1: boot (systemd boot + initramfs)
partition 2: usbroot1 (base + linux + linux-firmware)

HDD:
partition 1: hddroot2 (base only)


Boot configuration in USB partition 1 will have two entries (allowing booting into two different installations with same kernel/initramfs)
1. root=usbroot1
2. root=hddroot2

Booting into usbroot1 allows upgrading packages installed into usb key + kernel, firmware and initramfs
Booting into hddroot2 allows upgrading packages installed into hdd (But leaves kernel, firmware and initramfs untouched)

Partitions on usb key will not be mounted when booting into hddroot2 (fstab will contain only entry for / = hddroot2)

QUESTION:
This setup will introduce version mismatch between kernel and packages in hddroot2.

Could this version mismatch break booting hddroot2?
If yes, is there a way to mitigate this potential issue (like always upgrade kernel before packages in hddroot2 or the other way around)?

Last edited by ashwin.vbs (2021-07-18 22:50:43)

Offline

#2 2021-07-19 12:23:49

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

Re: Multi boot Archlinux with single initramfs/kernel = potential issues?

The version mismatch should not break booting, but will break dynamic module loading.

This will likely lead to hardware not working.

You will need to have all modules for all hardware you intend to use in the initramfs or make sure those modules are built into the kernel.


What are you trying to achieve with this setup ?


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)

Offline

#3 2021-07-19 17:53:00

ashwin.vbs
Member
Registered: 2016-02-04
Posts: 5

Re: Multi boot Archlinux with single initramfs/kernel = potential issues?

Thanks for the reply!

Lone_Wolf wrote:

You will need to have all modules for all hardware you intend to use in the initramfs or make sure those modules are built into the kernel.

If I install a module from the default repositories, are they not all included into initramfs by default?
If this is not the case, could you point me to documentation that explains how to manually load a module to initramfs?

Lone_Wolf wrote:

What are you trying to achieve with this setup ?

I plan to encrypt hddroot2 and store the keys in usb key boot partition. This way I can use usb key as both a boot/decryption device as well as a recovery device.

I also plan to scale this setup to multiple devices - ie. A single usb stick able to boot and unlock multiple devices.
As usb boot partition is not mounted after boot, and kernel and initramfs etc will be loaded to ram during boot, I believe I can unplug the boot drive after boot (I have not tested this though).

Not a production setup, but an experiment for home lab security.

Offline

#4 2021-07-20 21:24:02

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

Re: Multi boot Archlinux with single initramfs/kernel = potential issues?

ashwin.vbs wrote:

If I install a module from the default repositories, are they not all included into initramfs by default?

No, initramfs focuses on bootstrapping the system so it can access the real root .
Check https://wiki.archlinux.org/title/Arch_b … #initramfs

ashwin.vbs wrote:

If this is not the case, could you point me to documentation that explains how to manually load a module to initramfs?

https://wiki.archlinux.org/title/Mkinitcpio

Things are more complicated though.
many kernel modules require firmware at some point. If linux-firmware is not installed they will fail or - best case - have minimal functionality .

systemd uses generators to automate lots of things .

man systemd-gpt-auto-generator wrote:

]
Generator for automatically discovering and mounting root, /home/, /srv/, /var/ and /var/tmp/
       partitions, as well as discovering and enabling swap partitions, based on GPT partition type GUIDs

That generator runs before fstab. (It can be disabled) .


I have little xp with encrypted drives, but think you may be better off with a fully encrypted system .
https://wiki.archlinux.org/title/Dm-cry … ire_system has an overview .

Last edited by Lone_Wolf (2021-07-20 21:24:26)


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)

Offline

Board footer

Powered by FluxBB