Skip to content

Instantly share code, notes, and snippets.

@adlerweb
Created January 21, 2022 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adlerweb/5f90dff1615e30ad212dba0600e57ef9 to your computer and use it in GitHub Desktop.
Save adlerweb/5f90dff1615e30ad212dba0600e57ef9 to your computer and use it in GitHub Desktop.
Gentoo: Check if currently active kernel matches latest installed version of gentoo-sources (x86_64)
#!/usr/bin/python3
import os
tmp = os.popen('uname -r')
kernelO = tmp.read()
kernelO = kernelO.replace('-x86_64', '').strip()
tmp = os.popen('eselect kernel list | grep [1] | cut -d " " -f 6')
kernelN = tmp.read()
kernelN = kernelN.replace('linux-', '').strip()
if kernelO != kernelN:
print('Kernel update '+kernelO+' -> '+kernelN+' required')
else:
print('Kernel OK: ' + kernelN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment