Do you use hibernation ? Then you may have used kernel-alive while absent without knowing. After an Update it seems hibernation needs to access /lib/modules/${_kernver}/vmlinuz
to wake up with the right kernelimage
see @ line 162
Do you use hibernation ? Then you may have used kernel-alive while absent without knowing. After an Update it seems hibernation needs to access /lib/modules/${_kernver}/vmlinuz
to wake up with the right kernelimage
see @ line 162
Go back to bed. Don’t forget to take your vitamins…
Because you are right:
It’s tried-and-true, and makes moot any hack’ish solutions.
The only “cost” is extra storage used on your OS partition. But that’s only if you don’t prune older kernels after much time in the future.
I must reiterate. With Ubuntu, Fedora, Mint, and openSUSE, the issues that affect Arch-based distros don’t exist in regards to any kernel updates; especially those with the same base version, such as 513, 514, 515, etc.
I realize it won’t change anytime soon, but why on earth Arch Linux decided to arbitrarily go this route from their inception is simply odd. There is no justification for it.
It can be possible if the extraneous file(s) (such as config file keeping track of live/old modules) was written under /etc/
instead of directly inside of /usr/lib/
.
You are right. This is the best solution.
But as long as that takes, we can repair kernel-alive in the meantime
But as long as that takes, we can repair kernel-alive in the meantime
I’m no developer, but here is what kernel-alive
should do, as simply as possible:
Triggered upon any kernel update (regardless of major/minor version)
– protect the directory under /usr/lib/modules/
that matches the live kernel via uname -r
Do this with any indefinite number of kernel updates between reboots
Upon reboot, double-check with uname -r
and then simply delete the obsolete directory
Use a file/log under /etc/kernel-alive/
if neccessary to keep track of old directories to be pruned
The last step might not be necessary. All we’re concerned about is preventing an update from “pulling the rug from underneath our feet.”
I am a developer since 1985 When looking into the sources, it does:
After rebooting it will:
So maybe it is necessary to make sure that .old never has anything other then one filename
Maybe the right name for .old would be:
/etc/keep-alive-old-modules
If it contains the package-name, it would be save from other usage, and it would be easy to find where it comes from.
Then the files linux-module-cleanup.*
need renaming too. Maybe:
kernel-keepalive-cleanup.*
then there will be no furter double usage of the same hooks.
Nevertheless it should be kept conflicting to kernel-modules-hook
, because it does the same thing.
What you wrote seems like a safe(r) approach in the meantime. It would be up to @Ste74 to make the changes in the next release. It would also more closely honor the "don’t play around in /usr/lib/
" concern.
Maybe the right name for .old would be:
/etc/keep-alive-old-modules
That’s too vague.
It should be something like,
/etc/keep-alive-old-modules-per-andreas85-suggestion-as-to-avoid-future-conflicts
Suggestion for the
kernel-alive-post.script
#!/bin/bash
msg() {
ALL_OFF="\\e[1;0m"
BOLD="\\e[1;1m"
GREEN="${BOLD}\\e[1;32m"
local mesg=$1; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&2
}
#post transaction : check if still present old kernel if yes warning the user and do nothing
if [ ! -e /lib/modules/.old ]; then
KVER=$(uname -r)
if test -e "/lib/modules/backup/${KVER}"; then
rsync -AHXal --ignore-existing "/lib/modules/backup/${KVER}" /lib/modules/
touch /lib/modules/.old && echo "${KVER}" > /lib/modules/.old
fi
#cd /lib/modules
#oldkern=$(ls backup)
#touch .old && echo "$oldkern" > .old
rm -rf /lib/modules/backup
#Inform user
echo
msg "Warning:
-> Kernel has been updated. Modules of the current kernel
-> have been backed up so you can continue to use your
-> computer. However, the new kernel will only work
-> at next boot.
"
else
echo
msg "Warning:
-> This computer hasn't been restarted for a while.
-> You are running an old kernel. In order to use a
-> new version of the kernel, please restart your
-> computer as soon as possible.
"
fi
Only
if test -e "/lib/modules/backup/${KVER}"; then
rsync -AHXal --ignore-existing "/lib/modules/backup/${KVER}" /lib/modules/
cd /lib/modules
touch .old && echo "${KVER}" > .old
fi
#cd /lib/modules
#oldkern=$(ls backup)
#touch .old && echo "$oldkern" > .old
Do you use hibernation ?
No I don’t use it much and that point of yours is a good one. Suspend to RAM is what I use in general, but most time my laptop is just on and running – not too much power thanks to U Intel processor.
It can be possible if the extraneous file(s) (such as config file keeping track of live/old modules) was written under
/etc/
How are you going to tell the running kernel that it must look for its modules under /etc
? The kernel is hard-coded to look for its modules under /lib/modules
, which in Arch-based distributions ─ as well as in any other distribution that has implemented the /usr
merge ─ is a symlink to /usr/lib/modules
.
How are you going to tell the running kernel that it must look for its modules under
/etc
?
I was referring to the service/config files (the extraneous ones created by kernel-alive
.)
The modules would remain under /usr/lib/modules/
as always.
The only difference is that the obsolete/non-live kernel will have its folder safely removed after a reboot and/or service trigger and/or update. (All for the sake of freeing up space and “pruning” for housekeeping.)
Let’s say you’re currently running on a live system with kernel 5.16.10
.
The command uname -r
outputs:
5.16.10
The directory listing under /usr/lib/modules/
outputs:
5.16.10
You run an update with Pamac, and the package linux516
pulls in an update, which jumps from 5.16.10
→ 5.16.11
.
You continue to use your computer without rebooting.
The command uname -r
outputs:
5.16.10
The directory listing under /usr/lib/modules/
outputs:
5.16.10 <--- currently used by live kernel (vanilla Arch would delete this)
5.16.11
Some time passes.
You run an update with Pamac, and the package linux516
pulls in an update, which jumps from 5.16.11
→ 5.16.12
.
You continue to use your computer without rebooting.
The command uname -r
outputs:
5.16.10
The directory listing under /usr/lib/modules/
outputs:
5.16.10 <--- currently used by live kernel (vanilla Arch would delete this)
5.16.12
You reboot. Perhaps a service is triggered from the reboot that checks if it can safely “prune” the unneeded obsolete modules directory.
And so now…
The command uname -r
outputs:
5.16.12
The directory listing under /usr/lib/modules/
outputs:
5.16.12
We’re back full circle. Rinse and repeat.
The workaround (such as kernel-alive
or whatever solution) gracefully needs to prevent the rug from being pulled from underneath your feet (i.e, the live kernel) until the next reboot.
EDIT: Or we simply take the honorable route and start a grassroots campaign to convince everyone to switch to Ubun- user account has been suspended
What a weird package. I’m glad I figured this out while switching to stable-staging because I can imagine a host of others complaining endlessly in stable again when the new kernels get pushed. I believe this is another case of good intentions with backing up modules, but backfires in reality when items like nvidia
loads.
@Devs: I suggest also nuking this package before pushing kernel updates to stable. Programmatically in manjaro-system
?
The command
uname -r
outputs:5.16.10
For me, uname -r is a little more expressive:
uname -r
5.10.70-1-MANJARO
It certainly should be … folks may remove the extra for aesthetic purposes (or because they want to hide they are not actually running manjaro) … but it actually could be important for troubleshooting.
For me, uname -r is a little more expressive:
It certainly should be … folks may remove the extra for aesthetic purposes (or because they want to hide they are not actually running manjaro) … but it actually could be important for troubleshooting.
The Discourse forum software limits the length of visible horizontal lines (for common display resolutions). If you exceed it, it breaks the flow, such as when appending notes to the end of a line.
We truncate versions all the time for the sake of making a post easier to read and follow. It’s why you see members comparing “Plasma 5.22 vs 5.23” instead always specifying the precise minor version and package, such as “Plasma 5.22.5-1 vs 5.23.1-1”.
Besides, I wasn’t troubleshooting.
use kernel-modules-hook instead of kernel-alive
Great side-by-side comparison!
I think your investigation (perhaps backed with using kernel-modules-hook
successfully) denotes a much better solution for this thread.