Improve upgrade process (especially kernels)

Yes, right here:

:: Running pre-transaction hooks...
(1/2) Removing linux initcpios...

/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook is ran, which in turn executes /usr/share/libalpm/scripts/mkinitcpio-remove.

So feel free to improve this process by modifying the script. Another option is having some kernel that doesn’t get touched by update. Or have an iso image in your grub. :man_shrugging:

Sure. But are you saying that that can only happen on arch/-based distros?

Anyway, there is/was a lot of topics about that and we are still where we are. Example from 8 years ago: Autoremoval of old kernel-stuff on kernel update / Pacman & Package Upgrade Issues / Arch Linux Forums

No this is not a problem of the distro itself. It is a problem of the update-process.
When you handle kernel-updates using the same methods as for every other package, you end in a process where even the use of several kernels lead to an easily breakable update.

When you think of the kernel and modules as of a very valuable resource, you need to take special care of them during the update.

For example you could make the update for kernels in an serial fashion.

  • Delete ONE kernel
  • and modules,
  • update them,
  • recreate initrd and grub
    Then after this is completed (and synced) do the next kernel. This is by far not unbreakable, but it is better than now.

Der Krug geht zum Brunnen bis er bricht.

2 Likes

I think we can all agree that update process could be better. But can someone come up with an actual practical implementation that won’t require rewriting 10 other packages and changing who-knows-what? Just being realistic here. :slight_smile:

What about

Including the existing mhwd-kernel into the startup of the update-process ?

  • When there is only ONE kernel, do the normal update
  • When there is more than one kernel:
    • prefer to first update a non-running kernel !
    • prefer to first update a LTS kernel
    • prefer to first update the newest of them
    • Do a kernel update of this selected kernel with mhwd-kernel
      Yes this is a partial update, but it is inside the complete Update-process
  • While there is another updateable (non-running) kernel
    • Do a kernel update of this selected kernel with mhwd-kernel

Then do the rest of the update (including the running kernel)

  • The update-process then will not touch the already updated kernels, so they are save from harm while doing the rest of the update

It even may be possible to do this as a form of pre-update-script

Yes i did not realy look into the update-programms. If desired, I can take a look at the programs and then suggest a more realistic design. :bowing_man:

Yes rewriting would not be a good idea. Because there would be new errors in this critical process.

mhwd-kernel is just a bash script that calls pacman.

You can write another script that does multiple pacman updates and uses --ignore <find whatever kernel and any other package that "depends" on it like headers, modules and whatnot> - you can probably just repurpose some of mhwd-kernel script.

Anyway, this is a lame solution and you need at least two kernels installed. So it’s easier to just install linux-mainline or any other linux kernel from AUR (beside kernels from repo) and then just update repo first and after AUR. This alone will ensure a working kernel. Simple. :stuck_out_tongue:

recursion: → see recursion