Thanks, I didn’t pay attention and will upgrade to 5.14 too. (Just like I didn’t pay attention to the Qtile thing above there… man and that happens, even when I try to read these things and stay updated.)
Maybe a warning or a note from Pamac that the current Kernel is EOL would be good.
I just meant the information that is available at every post with the posts here anyway. It would be a good idea to include this in Pamac. Just a suggestion, nothing more.
But I see what you are saying. So my solution would be to write a script for automated check of EOL status. I just learned how to scrape websites in commandline. Execute the script each time I am updating should be enough I guess.
is not for EOL but same logic
Last paragraph tests if an installed kernel no longer exists (after EOL)
First, scrape websites
for eol, i have also a python script : test if kernel is not in testing or unstable. use branch-compare as data (so is not an manjaro announcement !)
url = "https://manjaro.org/branch-compare/packages.x86_64.json"
response = urllib.request.urlopen(url)
data = json.loads(response.read())['packages']
# pkg only in stable/testing and in "core" repo
data = [p for p in data if (p[1]['testing'] == "n/a" or p[1]['unstable'] == "n/a") and p[1]['repository'] == "core"]
eofs = set([p[0].split('#')[0] for p in data]) # want only names
print('EOL kernels:', eofs)
I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.
However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or or if you agree)
P.S. In the future, please don’t forget to come back to your question after your issue has been solved and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.
Thanks both of you. The solution seems to be doing what it is promise, so I have nothing against it. But I want to add a more simple way of getting current EOL Kernel from kernel.org. I had something in mind like this:
There is a program called xmllint which I use to scrape simple sites. But couldn’t make it work for this purpose.
As for your solution, I have no experience with creating pacman hooks for kernels and need to read more about these topics before diving in or commenting about it.
#!/usr/bin/bash
/usr/bin/curl -Ls https://forum.manjaro.org/c/announcements/stable-updates.rss | awk -F'>| ' '/\[EOL\]/ {print " "$2" is (was) EOL"}' | sort | uniq
# after can compare with mhwd-kernel -li and return error if installed EOL
# ...
Target = * : run for all packages (one time by transaction)
Exec : not possible to use pipe so call a script
z_eol_kernels.hook : hooks sorted by filenames (so i use z_xxxxx for run at end)
These hooks are pretty cool. I guess this is what kicks the nvidia related stuff too, after a Kernel update? Thank you for the explanation and examples. I will definitely read into it and make use of this system. Your Python script and the associated JSON packages file is probably exactly what I am looking for, as I am only concerned about EOL Kernels.
I also saw the Announcements - Manjaro Linux Forum ? The file is smaller, almost a fourth of the .json file. And because I can, here is an alternative to find EOL Kernels with shell script:
yes , /etc/ is for user hook, but we have /usr/share/libalpm/hooks/ for system (55 for me). So 55 good examples
man pacman-hooks
here, the only problem is that not exists local file with this data, nor a manjaro web api. so it is up to us to be creative…
best after, in same script, is to compare kernel installed to eol kernels and return error if installed not tested:
declare -a installed=($(mhwd-kernel -li | awk '/* / {print $2}'))
# installed=(linux510 linux512 linux514) # result example
declare -a eol=($(curl -Ls "https://forum.manjaro.org/c/announcements/stable-updates.rss" | awk -F'>| ' '/\[EOL\]/ {print " "$2}' | sort | uniq))
# eol=(linux511 linux512 linux513 linux57 linux58 linux59) # result today
echo " ${eol[*]}"
for k in "${installed[@]}"; do
if [[ $(printf "%s\n" "${eol[@]}"|grep ^$k$ -c) > 0 ]]; then
# oops linux512 is in EOL list
echo "Warning: kernel \"$k\" installed but is EOL"
#exit 5 # exit in hook not break pacman transaction but is big error for user
fi
done
result:
sudo pacman -S yad
[sudo] password for patrick:
warning: yad-10.1-1 is up to date -- reinstalling
...
:: Running post-transaction hooks...
(1/9) Arming ConditionNeedsUpdate...
(7/9) Updating the desktop file MIME type cache...
(9/9) list manjaro eol kernels (or dead)
linux511 linux512 linux513 linux57 linux58 linux59
Warning: kernel "linux512" installed but is EOL
ps: I prefer : Type = Path and Target = boot/linux*.kver or Type = Package and Target = linux* for run this hook only if we update/install kernel lest text in pacman.log