From 0ccca6902bb8a58203e2fd8b7b26225d8d1f8185 Mon Sep 17 00:00:00 2001 From: Gabriel Craciunescu Date: Mon, 11 Jun 2018 15:25:26 +0200 Subject: [PATCH] [grubcfg] fix inter-module dependency with plymouthcfg modules The plymouthcfg Calamares module is optional. Distributions which write filesystems with a full plymouth configuration won't even want to use it (see plymouthcfg docs). However, now grubcfg depends on plymouthcfg to run because the globalstorage value to trigger setting 'splash' in grub, is set in the plymouthcfg module. Just check for plymouth existence separately in the grub module. Fixes ea1c8a0e5ddfc6b72311cf744e2ac514c6630009 --- src/modules/grubcfg/main.py | 13 +++++++++---- src/modules/plymouthcfg/main.py | 7 +------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index 197a22edf..419aa67c1 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -44,16 +44,21 @@ def modify_grub_default(partitions, root_mount_point, distributor): dracut_bin = libcalamares.utils.target_env_call( ["sh", "-c", "which dracut"] ) - have_dracut = dracut_bin == 0 # Shell exit value 0 means success + plymouth_bin = libcalamares.utils.target_env_call( + ["sh", "-c", "which plymouth"] + ) + + # Shell exit value 0 means success + have_plymouth = plymouth_bin == 0 + have_dracut = dracut_bin == 0 use_splash = "" swap_uuid = "" swap_outer_uuid = "" swap_outer_mappername = None - if libcalamares.globalstorage.contains("hasPlymouth"): - if libcalamares.globalstorage.value("hasPlymouth"): - use_splash = "splash" + if have_plymouth: + use_splash = "splash" cryptdevice_params = [] diff --git a/src/modules/plymouthcfg/main.py b/src/modules/plymouthcfg/main.py index 2cb4f6dac..0bbd80de4 100644 --- a/src/modules/plymouthcfg/main.py +++ b/src/modules/plymouthcfg/main.py @@ -40,14 +40,9 @@ class PlymouthController: "/etc/plymouth/plymouthd.conf"]) def detect(self): - isPlymouth = target_env_call(["which", "plymouth"]) + isPlymouth = target_env_call(["sh", "-c", "which plymouth"]) debug("which plymouth exit code: {!s}".format(isPlymouth)) - if isPlymouth == 0: - libcalamares.globalstorage.insert("hasPlymouth", True) - else: - libcalamares.globalstorage.insert("hasPlymouth", False) - return isPlymouth def run(self):