Skip to content

Commit

Permalink
fix: COPR build for ublue-setup-services + allow sb-check-key to be d…
Browse files Browse the repository at this point in the history
…isabled (#91)
  • Loading branch information
tulilirockz authored Dec 30, 2024
1 parent 2a2c927 commit 4d45708
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ublue/setup-services/src/scripts/check-sb-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ublue/setup-services/ublue-setup-services.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4d45708

Please sign in to comment.