chore(sb): use systemd kernel cmdline condition

This commit is contained in:
Lars Sjöström 2025-03-19 15:03:15 +01:00
parent 6819565d79
commit c748e17279
No known key found for this signature in database
4 changed files with 11 additions and 30 deletions

View file

@ -1,23 +1,9 @@
#!/bin/bash
#!/bin/sh
set -ex -uo pipefail
enroll=
for o in $(< /proc/cmdline); do
case $o in
patos.secureboot=*)
enroll=${o#*=}
;;
esac
done
if [ -z "$enroll" ]; then
echo 'No patos.secureboot= parameter on the kernel command line' >&2
exit 0
fi
SETUP_MODE=$(sbctl status --json | jq -r '.setup_mode')
[ "$SETUP_MODE" = "false" -o "$enroll" != "true" ] && exit 0
[ "$SETUP_MODE" = "false" ] && exit 0
cat <<EOL> /run/sbctl.yml
---