|
|
|
@ -21,7 +21,7 @@ import os
|
|
|
|
|
from os import path
|
|
|
|
|
from os import access,R_OK
|
|
|
|
|
from subprocess import PIPE
|
|
|
|
|
from shutil import rmtree
|
|
|
|
|
from shutil import rmtree,copy2
|
|
|
|
|
|
|
|
|
|
class KernelConfig:
|
|
|
|
|
"""Object for work with kernel config
|
|
|
|
@ -175,8 +175,28 @@ class InitRamFs:
|
|
|
|
|
initrd.close()
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def cleanInitRamFs(self,newinitrd=None):
|
|
|
|
|
def cleanInitRamFs(self,newinitrd=None,video=None):
|
|
|
|
|
"""Unpack initramfs clean and pack"""
|
|
|
|
|
if not newinitrd:
|
|
|
|
|
return True
|
|
|
|
|
if not video:
|
|
|
|
|
copy2(self.initrdFile,newinitrd)
|
|
|
|
|
return True
|
|
|
|
|
if not self._unpackInitRamfs():
|
|
|
|
|
return False
|
|
|
|
|
calcPath = path.join(self.tmpPath,"etc/calculate")
|
|
|
|
|
if not path.exists(calcPath):
|
|
|
|
|
os.mkdir(calcPath)
|
|
|
|
|
f = open(path.join(calcPath,"calculate.ini"),'w')
|
|
|
|
|
f.write('VIDEODRV="{0}"'.format(video))
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
res = self._packInitRamfs(newinitrd)
|
|
|
|
|
rmtree(self.tmpPath,ignore_errors=True)
|
|
|
|
|
return res
|
|
|
|
|
|
|
|
|
|
def cleanInitRamFsOld(self,newinitrd=None):
|
|
|
|
|
"""Unpack initramfs, clean needless modules and pack"""
|
|
|
|
|
if not self._unpackInitRamfs():
|
|
|
|
|
return False
|
|
|
|
|
importantModules = KernelModules().getWorkModules(
|
|
|
|
|