You are not logged in.

#1 2022-07-21 18:24:08

Iron Squid
Member
From: earth
Registered: 2022-07-18
Posts: 19
Website

[Solved] How does Pacman handle Kernel updates and installation?

What does the pacman assisted installation process for a kernel look like? I've read through the wiki but am unsure of what exactly pacman does for kernel installs, or on which page to find that information.
From my interpretation of various articles online, it calls a hook and generates a new initramfs file for that kernel, but does not generate a new entry in /boot for it. I'm unsure if this is correct.

The reasons I want to know this are twofold: I want to create fallback boot profiles in case my main kernel breaks for whatever reason, and I want to know if I should worry about generating new initramfs files and whatnot for each kernel update.

If there is a wiki page or previous post that explains how pacman specifically handles Kernel updates/installs, please direct me to it.

Last edited by Iron Squid (2022-08-02 03:13:24)


"An idiot admires complexity, a genius admires simplicity."

-Terry A. Davis

Offline

#2 2022-07-21 20:53:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,527

Re: [Solved] How does Pacman handle Kernel updates and installation?

pacman itself doesn't do anything specific for the kernel, this is done by hooks provided by the packages themselves (or you)

The initramfs is generated by a pacman hook provided by the mkinitcpio package, https://wiki.archlinux.org/title/Mkinit … activation and it'll automatically create an initramfs for the kernels and place it next to them into /boot (where the kernel packages drop the kernel)

You could create a similar hook for the bootloader but
1. if you're loading the kernel from UEFI (no bootloader), this isn't necessary at all
2. An update to the bootloader is only required if you add or remove a kernel variant, not when you update an existing kernel (so: rarely or never)
3. The bootloader might be managed by a different OS (it preceeds the OS)
4. running eg. grub-mkconfig might not be desirable if you manually wrote or edited /boot/grub/grub.cfg

I want to create fallback boot profiles in case my main kernel breaks for whatever reason

Adding a second kernel will require you to update the bootloader config once.

and I want to know if I should worry about generating new initramfs files and whatnot for each kernel update.

No.
At least not as long as you want to add out-of-tree modules (eg. nvidia) to the initramfs (and there's a pacman hook suggestion for that, https://wiki.archlinux.org/title/NVIDIA#pacman_hook to do this automatically w/ nvidia package updates)

What you need to worry about is having the /boot partition (if any) mounted at least when running kernel updates (what can be a static mount or automizable in any number of ways, systemd-automount, pacman hook, …)

Offline

#3 2022-07-23 02:36:55

Iron Squid
Member
From: earth
Registered: 2022-07-18
Posts: 19
Website

Re: [Solved] How does Pacman handle Kernel updates and installation?

seth wrote:

pacman itself doesn't do anything specific for the kernel, this is done by hooks provided by the packages themselves (or you)

The initramfs is generated by a pacman hook provided by the mkinitcpio package, https://wiki.archlinux.org/title/Mkinit … activation and it'll automatically create an initramfs for the kernels and place it next to them into /boot (where the kernel packages drop the kernel)

You could create a similar hook for the bootloader but
1. if you're loading the kernel from UEFI (no bootloader), this isn't necessary at all
2. An update to the bootloader is only required if you add or remove a kernel variant, not when you update an existing kernel (so: rarely or never)
3. The bootloader might be managed by a different OS (it preceeds the OS)
4. running eg. grub-mkconfig might not be desirable if you manually wrote or edited /boot/grub/grub.cfg

I want to create fallback boot profiles in case my main kernel breaks for whatever reason

Adding a second kernel will require you to update the bootloader config once.

and I want to know if I should worry about generating new initramfs files and whatnot for each kernel update.

No.
At least not as long as you want to add out-of-tree modules (eg. nvidia) to the initramfs (and there's a pacman hook suggestion for that, https://wiki.archlinux.org/title/NVIDIA#pacman_hook to do this automatically w/ nvidia package updates)

What you need to worry about is having the /boot partition (if any) mounted at least when running kernel updates (what can be a static mount or automizable in any number of ways, systemd-automount, pacman hook, …)

This was very insightful, and thank you for taking the time to gather this information and their associated articles.


"An idiot admires complexity, a genius admires simplicity."

-Terry A. Davis

Offline

#4 2022-07-23 05:49:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,527

Re: [Solved] How does Pacman handle Kernel updates and installation?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB