A
A
Andrey2019-02-13 13:08:27
linux
Andrey, 2019-02-13 13:08:27

Is it possible to update the kernel in arch linux without rebooting?

Good day, I have been using Arch for a long time and noticed that one of its features is starting to piss me off. After each update pacman -Syuunder the condition, unless of course there is a more recent kernel, almost all kernel modules fall off. This manifests itself very simply, usb ports stop working, graphics stop working, etc., and errors of the same type, it is impossible to find the module in the kernel libraries folder. Actually, everything is clear, I uname -rasee, for example Linux 4.19.20-2, while the system is looking for kernel modules in the directory from the kernel Linux 4.19.20-1- not in order.
Previously, I used Slackware for a long time and such problems only appeared when updating the kernel + nvidia, everything else worked perfectly. There was also a period during which I used only Debian, and there were never any problems with it at all (in my opinion, this is the most stable distro).
As a result, I like arch, but I'm not ready to put up with this problem of his. At the moment, using pacman, I added the kernel and graphics to the ignore list and thereby prohibited the upgrade of the kernel and graphics, maybe there are other options for solving this problem, otherwise I don’t really want to demolish the OS?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitsliputsli, 2019-02-28
@Allepta

Allepta , did not find a beautiful solution, just add hooks with a backup of the removed kernel to / tmp with links to it, it is assumed that / tmp is cleaned after a reboot, and broken links are deleted at the next kernel update. Here are 2 hooks:
save-running-kernel-modules-pre.hook:

[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux

[Action]
Depends = bash
Depends = find
When = PreTransaction
Exec = /usr/bin/bash -c "/usr/bin/find . -type l -exec test ! -e {} \; -delete; /usr/bin/mkdir -p /tmp/save-running-kernel-modules && /usr/bin/cp -a /usr/lib/modules/$(uname -r) /tmp/save-running-kernel-modules"

save-running-kernel-modules-post.hook:
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux

[Action]
Depends = bash
When = PostTransaction
Exec = /usr/bin/bash -c "/usr/bin/ln -s /tmp/save-running-kernel-modules/$(uname -r) /usr/lib/modules/$(uname -r)"

Because I will not add a solution to the AUR after all.

D
Dmitry Logvinenko, 2019-02-13
@dmlogv

Never had a problem with the dump of modules after the update.
He also does it mkinitcpioby putting a fresh initialization of the kernel for the next boot (in any case, without a reboot anywhere), and the old backup, so that in case of a fail, you can boot from it.

V
Valentine, 2019-02-21
@ProFfeSsoRr

I have a counter question - why does this behavior cause problems? Arch is still created to be constantly updated, if you do it every day, then there are no problems. And the approach "launched the system - worked - updated before shutting down" does not cause problems.
If you use sleep mode instead of turning off your computer, can you just stop doing it? With an SSD, the system loads very quickly, and when I bought the first SSD, I got confused (systemd just appeared there), figured out the boot and, as a result, I have a cold start faster than exiting from hibernation. And all this does not interfere with constant updates.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question