#!/usr/bin/env bash # ───────────────────────────────────────────────────────────────────────────── # Arcline OS — secure boot: MOK key generation # # scripts/secureboot/gen-keys.sh [--keydir build/keys] # # Generates a Machine Owner Key (MOK) signing keypair for self-signing the # kernel and EFI boot chain. MOK is the pragmatic secure-boot path for a # self-hosted distro: you enroll the key once (one-time prompt at first boot) # and then every Arcline update is verified against it. No third-party CA. # # Outputs (default build/keys/): # MOK.priv — private signing key (keep this secret, back it up) # MOK.pem — certificate in PEM form (for sbsign) # MOK.der — certificate in DER form (for mokutil enrollment) # # Requires openssl. Enrollment on a target system is handled by # arcline-mok-enroll.service (see overlays/base). # ───────────────────────────────────────────────────────────────────────────── set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/common.sh" KEYDIR="${1:-$BUILD_DIR/keys}" [[ "${1:-}" == "--keydir" ]] && KEYDIR="${2:?usage: gen-keys.sh [--keydir