kernel-upgrade python script

This commit is contained in:
2020-12-10 15:21:53 +01:00
parent 4b73d6cdf0
commit b4b05f8f48
2 changed files with 27 additions and 0 deletions

26
kernel-upgrade Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/python
from distutils.version import LooseVersion
import glob
import os
import shutil
import subprocess
os.chdir("/usr/src")
try:
f = open("linux/.config")
f.close()
except FileNotFoundError:
lv = [LooseVersion(v) for v in glob.iglob("linux?*")]
lv.sort()
lv.reverse()
for i in lv:
try:
print(i)
path = str(i) + "/.config"
oldconfig = open(path)
oldconfig.close()
shutil.copyfile(path, 'linux/.config')
subprocess.call("make", "olddefconfig")
subprocess.call("kernel-build")
break
except FileNotFoundError:
u = 0

1
update
View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
emerge --sync emerge --sync
emerge -Du --with-bdeps=y @world emerge -Du --with-bdeps=y @world
kernel-upgrade
xbps-install -Su xbps-install -Su
sudo -u mrgeorgen yay sudo -u mrgeorgen yay