switch lima improvements

This commit is contained in:
cuu 2019-06-17 18:18:18 +08:00
parent c559728454
commit 29cbe9297a

View File

@ -11,7 +11,7 @@ from libs.roundrects import aa_round_rect
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
from UI.page import Page,PageSelector from UI.page import Page,PageSelector
from UI.label import Label from UI.label import Label
from UI.util_funcs import midRect,FileExists from UI.util_funcs import midRect,FileExists,ArmSystem
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.scroller import ListScroller from UI.scroller import ListScroller
from UI.icon_pool import MyIconPool from UI.icon_pool import MyIconPool
@ -170,12 +170,16 @@ class GPUDriverPage(Page):
self._Screen._MsgBox.Draw() self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow() self._Screen.SwapAndShow()
if "modesetting" in cur_li._Value: if "modesetting" in cur_li._Value: ## enable lima
os.system("touch %s/.lima" % os.path.expanduser('~') ) os.system("touch %s/.lima" % os.path.expanduser('~') )
os.system("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima /usr/lib/xorg/modules/drivers/modesetting_drv.so") ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima /usr/lib/xorg/modules/drivers/modesetting_drv.so")
else: ArmSystem("sudo sed -i '/^#.*lima/s/^#//' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf")
ArmSystem("sudo ldconfig")
else: #disable lima
os.system("rm %s/.lima" % os.path.expanduser('~') ) os.system("rm %s/.lima" % os.path.expanduser('~') )
os.system("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima") ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima")
ArmSystem("sudo sed -i 's/^[^#]*lima/#&/' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf")
ArmSystem("sudo ldconfig")
pygame.time.delay(800) pygame.time.delay(800)
os.system("sudo reboot") os.system("sudo reboot")