From 950e9d1d0a1f28b39c2241125f4a7c3066606ba0 Mon Sep 17 00:00:00 2001 From: Boria138 Date: Sat, 19 Aug 2023 21:00:25 +0600 Subject: [PATCH] Added setfont check in mkinitcpiocfg --- src/modules/initcpiocfg/main.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index 4aae5a33e..381029415 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -39,11 +39,22 @@ def detect_plymouth(): def detect_systemd(): """ Checks existence (runnability) of systemd in the target system. + @return True if systemd exists in the target, False otherwise """ # Used to only check existence of path /usr/bin/systemd-cat in target return target_env_call(["sh", "-c", "which systemd-cat"]) == 0 + +def detect_setfont(): + """ + Checks existence (runnability) of setfont in the target system. + + @return True if setfont exists in the target, False otherwise + """ + # Used to only check existence of path /usr/bin/setfont in target + return target_env_call(["sh", "-c", "which setfont"]) == 0 + class cpuinfo(object): """ Object describing the current CPU's characteristics. It may be @@ -161,6 +172,7 @@ def find_initcpio_features(partitions, root_mount_point): "keyboard", ] uses_systemd = detect_systemd() + have_setfont = detect_setfont() if uses_systemd: hooks.insert(0, "systemd") @@ -175,9 +187,10 @@ def find_initcpio_features(partitions, root_mount_point): files = [] binaries = [] - # Fixes "setfont: KDFONTOP: Function not implemented" error - binaries.append("setfont") - + if have_setfont: + # Fixes "setfont: KDFONTOP: Function not implemented" error + binaries.append("setfont") + swap_uuid = "" uses_btrfs = False uses_zfs = False