1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00
build-container-installer/scripts/enroll-secureboot-key.sh
Kyle Gospodnetich ff58b2d122
fix: Ignore Valve Steam Deck hardware due to using EFI but having no keys enrolled by default and add extra boot parameters (#33)
* fix: Ignore Valve Steam Deck hardware due to using EFI but having no keys enrolled by default.

* fix: add extra boot parameters to fix steam deck resolution issue

---------

Co-authored-by: Noel Miller <noelmiller@protonmail.com>
2024-02-25 01:34:23 +00:00

25 lines
668 B
Bash
Executable file

#!/bin/sh
set -oue pipefail
readonly SECUREBOOT_KEY="/run/install/repo/ublue-os-akmods-public-key.der"
readonly ENROLLMENT_PASSWORD="ublue-os"
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
if [[ ":Jupiter:Galileo:" =~ ":$SYS_ID:" ]]; then
echo "Steam Deck hardware detected. Skipping key enrollment."
exit 0
fi
if [[ ! -d "/sys/firmware/efi" ]]; then
echo "EFI mode not detected. Skipping key enrollment."
exit 0
fi
if [[ ! -f "${SECUREBOOT_KEY}" ]]; then
echo "Secure boot key not found: ${SECUREBOOT_KEY}"
exit 1
fi
mokutil --timeout -1 || :
echo -e "${ENROLLMENT_PASSWORD}\n${ENROLLMENT_PASSWORD}" | mokutil --import "${SECUREBOOT_KEY}" || :