[initcpiocfg][plymouthcfg] Consistent find-plymouth code
- drop the debugging line because that has already been logged by the call to `runCommand()` that backs `target_env_call()`. - use the same (top-level) function rather than having a function and elsewhere a very-similar method.
This commit is contained in:
parent
039370d410
commit
cf0119ed4a
@ -92,6 +92,7 @@ def write_mkinitcpio_lines(hooks, modules, files, root_mount_point):
|
|||||||
with open(path, "w") as mkinitcpio_file:
|
with open(path, "w") as mkinitcpio_file:
|
||||||
mkinitcpio_file.write("\n".join(mklins) + "\n")
|
mkinitcpio_file.write("\n".join(mklins) + "\n")
|
||||||
|
|
||||||
|
|
||||||
def detect_plymouth():
|
def detect_plymouth():
|
||||||
"""
|
"""
|
||||||
Checks existence (runnability) of plymouth in the target system.
|
Checks existence (runnability) of plymouth in the target system.
|
||||||
@ -99,10 +100,8 @@ def detect_plymouth():
|
|||||||
@return True if plymouth exists in the target, False otherwise
|
@return True if plymouth exists in the target, False otherwise
|
||||||
"""
|
"""
|
||||||
# Used to only check existence of path /usr/bin/plymouth in target
|
# Used to only check existence of path /usr/bin/plymouth in target
|
||||||
isPlymouth = target_env_call(["sh", "-c", "which plymouth"])
|
return target_env_call(["sh", "-c", "which plymouth"]) == 0
|
||||||
debug("which plymouth exit code: {!s}".format(isPlymouth))
|
|
||||||
|
|
||||||
return isPlymouth == 0
|
|
||||||
|
|
||||||
def modify_mkinitcpio_conf(partitions, root_mount_point):
|
def modify_mkinitcpio_conf(partitions, root_mount_point):
|
||||||
"""
|
"""
|
||||||
|
@ -27,6 +27,16 @@ def pretty_name():
|
|||||||
return _("Configure Plymouth theme")
|
return _("Configure Plymouth theme")
|
||||||
|
|
||||||
|
|
||||||
|
def detect_plymouth():
|
||||||
|
"""
|
||||||
|
Checks existence (runnability) of plymouth in the target system.
|
||||||
|
|
||||||
|
@return True if plymouth exists in the target, False otherwise
|
||||||
|
"""
|
||||||
|
# Used to only check existence of path /usr/bin/plymouth in target
|
||||||
|
return target_env_call(["sh", "-c", "which plymouth"]) == 0
|
||||||
|
|
||||||
|
|
||||||
class PlymouthController:
|
class PlymouthController:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -42,14 +52,8 @@ class PlymouthController:
|
|||||||
plymouth_theme + '|', "-i",
|
plymouth_theme + '|', "-i",
|
||||||
"/etc/plymouth/plymouthd.conf"])
|
"/etc/plymouth/plymouthd.conf"])
|
||||||
|
|
||||||
def detect(self):
|
|
||||||
isPlymouth = target_env_call(["sh", "-c", "which plymouth"])
|
|
||||||
debug("which plymouth exit code: {!s}".format(isPlymouth))
|
|
||||||
|
|
||||||
return isPlymouth
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.detect() == 0:
|
if detect_plymouth():
|
||||||
if (("plymouth_theme" in libcalamares.job.configuration) and
|
if (("plymouth_theme" in libcalamares.job.configuration) and
|
||||||
(libcalamares.job.configuration["plymouth_theme"] is not None)):
|
(libcalamares.job.configuration["plymouth_theme"] is not None)):
|
||||||
self.setTheme()
|
self.setTheme()
|
||||||
|
Loading…
Reference in New Issue
Block a user