commit
d12390bb62
@ -4,7 +4,7 @@
|
|||||||
# === This file is part of Calamares - <https://github.com/calamares> ===
|
# === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
#
|
#
|
||||||
# Copyright 2014, Rohan Garg <rohan@kde.org>
|
# Copyright 2014, Rohan Garg <rohan@kde.org>
|
||||||
# Copyright 2015, Philip Müller <philm@manjaro.org>
|
# Copyright 2015,2019, Philip Müller <philm@manjaro.org>
|
||||||
# Copyright 2017, Alf Gaida <agaida@sidution.org>
|
# Copyright 2017, Alf Gaida <agaida@sidution.org>
|
||||||
# Copyright 2019, Adriaan de Groot <groot@kde.org>
|
# Copyright 2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
@ -22,6 +22,7 @@
|
|||||||
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import libcalamares
|
import libcalamares
|
||||||
|
from libcalamares.utils import debug, target_env_call
|
||||||
import os
|
import os
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
@ -100,6 +101,17 @@ 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():
|
||||||
|
"""
|
||||||
|
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
|
||||||
|
isPlymouth = target_env_call(["sh", "-c", "which plymouth"])
|
||||||
|
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):
|
||||||
"""
|
"""
|
||||||
@ -121,8 +133,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
|
|||||||
unencrypted_separate_boot = False
|
unencrypted_separate_boot = False
|
||||||
|
|
||||||
# It is important that the plymouth hook comes before any encrypt hook
|
# It is important that the plymouth hook comes before any encrypt hook
|
||||||
plymouth_bin = os.path.join(root_mount_point, "usr/bin/plymouth")
|
if detect_plymouth():
|
||||||
if os.path.exists(plymouth_bin):
|
|
||||||
hooks.append("plymouth")
|
hooks.append("plymouth")
|
||||||
|
|
||||||
for partition in partitions:
|
for partition in partitions:
|
||||||
|
Loading…
Reference in New Issue
Block a user