Skip to content

Instantly share code, notes, and snippets.

@kocogluali
Last active January 4, 2016 11:49
Show Gist options
  • Save kocogluali/8617694 to your computer and use it in GitHub Desktop.
Save kocogluali/8617694 to your computer and use it in GitHub Desktop.
Debian Python ile Driver Yedekleme
#super user olmadan çalışmaz ona göre :)
import os, zipfile
ZF=zipfile.ZipFile("modules.zip","w")
A=os.popen("lsmod").read()
M=A.split("\n")
for l in M[1:]:
ls=l.strip()
if ls:
m=ls.split()[0]
M=os.popen("modinfo %s" % m).read()
MF=M.split("\n")
for t in MF:
if t[:9]=='filename:':
tn=t.strip().split()[1]
print (tn,"Ekleniyor")
ZF.write(tn)
ZF.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment