With compare-branch we can view if kernel is not in unstable branch
if not: it’s EOL
json branch-compare is too big to download so create with same (or other) cron a small eol.json (or txt)
After, A pacman hook or pamac / msm(or mntray) can use this file for alert user ?
yes, it’s not a EOL kernel but old kernel. isn’t it too late? to get the info we must already have done this update (-Sy) : before update, kernel exists in local database
me is for send warning before
I tried setting up something like this in pamac gnome integration some years ago, but repo compare would improve it. Also, I’m not sure if it actually ever worked…
python script test “proof of concept” x86 with branch-compare data (file too big to download in prod)
linux57 is in unstable : add linux58 for test output
#!/usr/bin/python
import subprocess
import urllib.request, json
# curl -s "https://manjaro.org/branch-compare/datas.x86_64.txt" | python3 -m json.tool | less
url = "https://manjaro.org/branch-compare/packages.x86_64.json"
response = urllib.request.urlopen(url)
data = json.loads(response.read())['data']
# 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
####### eofs.add('linux58') # for test
outk = subprocess.run('mhwd-kernel -li | grep -o "linux.*"',
stdout=subprocess.PIPE,
shell=True,
text=True).stdout.replace(')','')
kernels_user = set(outk.splitlines())
currentk = subprocess.run('mhwd-kernel -li | grep -o "(linux.*)"',
stdout=subprocess.PIPE,
shell=True,
text=True).stdout
currentk = currentk[1:-2]
print("EOF:", eofs, end="\n\n")
print("User kernels:", kernels_user)
print("current kernel:", currentk, end="\n\n")
diff = eofs.intersection(kernels_user)
if diff:
print("common packages:", diff, " Warning kernel installed and EOL")
if any([ currentk in i for i in eofs]):
print(f"ALERT, you use a EOL kernel {currentk}")
linux57 is in unstable : add linux58 for test output
EOF: {'linux58'}
User kernels: {'linux58', 'linux57', 'linux419'}
current kernel: linux58
common packages: {'linux58'} Warning kernel installed and EOL
ALERT, you use EOL kernel linux58