Created
January 21, 2022 13:10
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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