mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 02:52:00 +00:00
Fix for SELinux handling logic (#529)
* Fix for SELinux handling logic The old procedure was crashing with signal 9 SIGKILL, this should fix that problem
This commit is contained in:
@@ -43,4 +43,10 @@ def get_log_level() -> int:
|
|||||||
]
|
]
|
||||||
|
|
||||||
def get_selinux() -> bool:
|
def get_selinux() -> bool:
|
||||||
return os.getenv("DECKY_SELINUX", "0") == "1"
|
if ON_LINUX:
|
||||||
|
from subprocess import check_output
|
||||||
|
try:
|
||||||
|
if (check_output("getenforce").decode("ascii").strip("\n") == "Enforcing"): return True
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
return False
|
||||||
|
|||||||
+3
-2
@@ -209,8 +209,9 @@ class Updater:
|
|||||||
shutil.move(path.join(getcwd(), download_temp_filename), path.join(getcwd(), download_filename))
|
shutil.move(path.join(getcwd(), download_temp_filename), path.join(getcwd(), download_filename))
|
||||||
chmod(path.join(getcwd(), download_filename), 777, False)
|
chmod(path.join(getcwd(), download_filename), 777, False)
|
||||||
if get_selinux():
|
if get_selinux():
|
||||||
from subprocess import call
|
from asyncio.subprocess import create_subprocess_exec
|
||||||
call(["chcon", "-t", "bin_t", path.join(getcwd(), download_filename)])
|
process = await create_subprocess_exec("chcon", "-t", "bin_t", path.join(getcwd(), download_filename))
|
||||||
|
logger.info(f"Setting the executable flag with chcon returned {await process.wait()}")
|
||||||
|
|
||||||
logger.info("Updated loader installation.")
|
logger.info("Updated loader installation.")
|
||||||
await tab.evaluate_js("window.DeckyUpdater.finish()", False, False)
|
await tab.evaluate_js("window.DeckyUpdater.finish()", False, False)
|
||||||
|
|||||||
Reference in New Issue
Block a user