From 4d45708187165c62ed28ec92474a132b40c3f6ba Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Mon, 30 Dec 2024 12:23:58 -0300 Subject: [PATCH] fix: COPR build for ublue-setup-services + allow sb-check-key to be disabled (#91) --- ublue/setup-services/src/scripts/check-sb-key.sh | 5 +++++ ublue/setup-services/ublue-setup-services.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ublue/setup-services/src/scripts/check-sb-key.sh b/ublue/setup-services/src/scripts/check-sb-key.sh index e8d5e8b..90b9512 100755 --- a/ublue/setup-services/src/scripts/check-sb-key.sh +++ b/ublue/setup-services/src/scripts/check-sb-key.sh @@ -22,6 +22,7 @@ get_config() { WARNING_MSG="This machine has secure boot turned on, but you haven't enrolled Universal Blue's keys. Failing to enroll these before rebooting **may cause your system to fail to boot**. Follow [the documentation](https://docs.projectbluefin.io/introduction#secure-boot) ~for key enrollment information." KEY_WARN_FILE="/run/user-motd-sbkey-warn.md" KEY_DER_FILE="$(get_config '."der-path"' "/etc/pki/akmods/certs/akmods-ublue.der")" +IS_THIS_ENABLED="$(get_config '."check-secureboot"' "true")" mokutil --sb-state | grep -q enabled SB_ENABLED=$? @@ -31,6 +32,10 @@ if [ $SB_ENABLED -ne 1 ]; then exit 0 fi +if [ "$IS_THIS_ENABLED" == "false" ] ; then + exit 0 +fi + if mokutil --test-key "$KEY_DER_FILE"; then echo "$WARNING_MSG" > $KEY_WARN_FILE else diff --git a/ublue/setup-services/ublue-setup-services.spec b/ublue/setup-services/ublue-setup-services.spec index effeb18..b15c204 100644 --- a/ublue/setup-services/ublue-setup-services.spec +++ b/ublue/setup-services/ublue-setup-services.spec @@ -10,6 +10,8 @@ URL: https://github.com/ublue-os/packages VCS: {{{ git_dir_vcs }}} Source: {{{ git_dir_pack }}} +BuildRequires: systemd-rpm-macros + %description Universal Blue setup scripts