Review: enroll keeps foreign db keys, configurable paths, on-demand eac-run, launcher ebuild, db dedupe tool
This commit is contained in:
Executable → Regular
+26
-7
@@ -3,6 +3,8 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit toolchain-funcs
|
||||
|
||||
MY_PV=${PV/_p/-}
|
||||
MY_KV=${MY_PV}-cachyos-eac
|
||||
SDBOOT_PV=262.2_1-1
|
||||
@@ -28,6 +30,7 @@ KEYWORDS="~amd64"
|
||||
RESTRICT="mirror strip"
|
||||
|
||||
RDEPEND="
|
||||
app-crypt/efitools
|
||||
app-crypt/sbctl
|
||||
app-crypt/sbsigntools
|
||||
app-crypt/tpm2-tools
|
||||
@@ -36,7 +39,11 @@ RDEPEND="
|
||||
sys-boot/efibootmgr
|
||||
sys-kernel/dracut
|
||||
"
|
||||
BDEPEND="app-arch/zstd"
|
||||
BDEPEND="
|
||||
app-arch/zstd
|
||||
sys-apps/kmod
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
src_unpack() {
|
||||
local f
|
||||
@@ -47,21 +54,32 @@ src_unpack() {
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -i 's#esp=$(bootctl --print-esp-path 2>/dev/null || echo /boot)#esp=$(eac-boot esp)#' \
|
||||
# eac-status takes the ESP, kernel and boot loader locations from eac-boot.
|
||||
sed -i \
|
||||
-e 's#esp=$(bootctl --print-esp-path 2>/dev/null || echo /boot)#esp=$(eac-boot esp)#' \
|
||||
-e 's#"$esp/$(cat /etc/machine-id)/linux-cachyos-eac#"$(eac-boot kernel-dir)#' \
|
||||
-e 's#"$esp/EFI/cachyos-eac/systemd-bootx64.efi"#"$(eac-boot loader)"#' \
|
||||
usr/bin/eac-status || die
|
||||
grep -q 'esp=$(eac-boot esp)' usr/bin/eac-status || die "eac-status: ESP patch did not apply"
|
||||
[[ $(grep -c '$(eac-boot kernel-dir)' usr/bin/eac-status) == 2 ]] || die "eac-status: kernel-dir patch did not apply"
|
||||
grep -q '"$(eac-boot loader)"' usr/bin/eac-status || die "eac-status: loader patch did not apply"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dodir /lib/modules
|
||||
cp -a "usr/lib/modules/${MY_KV}" "${ED}/lib/modules/" || die
|
||||
fowners -R root:root "/lib/modules/${MY_KV}"
|
||||
# Wherever this system's kmod looks for modules (/lib/modules on Gentoo).
|
||||
MODULES_DIR=$($(tc-getPKG_CONFIG) --variable=module_directory kmod)
|
||||
: "${MODULES_DIR:=/lib/modules}"
|
||||
|
||||
dodir "${MODULES_DIR}"
|
||||
cp -a "usr/lib/modules/${MY_KV}" "${ED}${MODULES_DIR}/" || die
|
||||
fowners -R root:root "${MODULES_DIR}/${MY_KV}"
|
||||
|
||||
insinto /usr/lib/cachyos-eac
|
||||
doins usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed
|
||||
|
||||
insinto /usr/share/cachyos-eac
|
||||
doins usr/share/cachyos-eac/cachyos-eac-ca.{crt,der}
|
||||
# Only used by `sbctl enroll-keys --custom` with sbctl's default keydir; eac-boot enroll reads the copy above.
|
||||
insinto /var/lib/sbctl/keys/custom/db
|
||||
doins var/lib/sbctl/keys/custom/db/cachyos-eac-ca.der
|
||||
|
||||
@@ -72,7 +90,7 @@ src_install() {
|
||||
pkg_postinst() {
|
||||
depmod -b "${EROOT:-/}" "${MY_KV}" || die
|
||||
|
||||
if [[ -z ${ROOT} && -d $(eac-boot esp 2>/dev/null)/EFI/cachyos-eac ]]; then
|
||||
if [[ -z ${ROOT} && -f $(eac-boot loader 2>/dev/null) ]]; then
|
||||
eac-boot update || ewarn "eac-boot update failed, run it by hand"
|
||||
else
|
||||
elog "First-time setup: eac-boot enroll, eac-boot setup, then enable Secure Boot."
|
||||
@@ -83,5 +101,6 @@ pkg_postinst() {
|
||||
|
||||
pkg_postrm() {
|
||||
# depmod output is not owned by the package
|
||||
[[ -d ${EROOT}/lib/modules/${MY_KV}/kernel ]] || rm -rf "${EROOT}/lib/modules/${MY_KV}"
|
||||
[[ -n ${MODULES_DIR} && ! -d ${EROOT}${MODULES_DIR}/${MY_KV}/kernel ]] || return 0
|
||||
rm -rf "${EROOT}${MODULES_DIR}/${MY_KV}"
|
||||
}
|
||||
@@ -4,10 +4,10 @@ Repackages the CachyOS Easy Anti-Cheat Linux v2 boot chain unchanged:
|
||||
|
||||
| From CachyOS | Installed to |
|
||||
|---|---|
|
||||
| `linux-cachyos-eac` (kernel + signed modules) | `/lib/modules/<ver>-cachyos-eac/` (kernel at `vmlinuz`) |
|
||||
| `linux-cachyos-eac` (kernel + signed modules) | `<modules>/<ver>-cachyos-eac/` (kernel at `vmlinuz`); `<modules>` is kmod's `module_directory`, `/lib/modules` on Gentoo |
|
||||
| `systemd-boot-cachyos-signed` | `/usr/lib/cachyos-eac/systemd-bootx64.efi.signed` |
|
||||
| `cachyos-eac-signing-key` (CachyOS EAC CA) | `/usr/share/cachyos-eac/`, `/var/lib/sbctl/keys/custom/db/` |
|
||||
| `eac-status` from `cachyos-settings` | `/usr/sbin/eac-status` (ESP lookup patched to `eac-boot esp`) |
|
||||
| `eac-status` from `cachyos-settings` | `/usr/sbin/eac-status` (ESP, kernel and loader paths patched to ask `eac-boot`) |
|
||||
|
||||
The kernel is not handled by installkernel or uefi-mkconfig, and nothing is
|
||||
re-signed. A second signature, or a kernel started without the CachyOS-signed
|
||||
@@ -17,37 +17,57 @@ systemd-boot, fails the EAC checks.
|
||||
|
||||
| Command | Does |
|
||||
|---|---|
|
||||
| `eac-boot enroll` | rewrites the Secure Boot db as: your sbctl db key, the Microsoft certificates, the CachyOS EAC CA |
|
||||
| `eac-boot setup [bootnum]` | `update`, then creates the `CachyOS EAC` firmware entry and puts it at the end of BootOrder; `bootnum` (4 hex digits) replaces the entry with that number |
|
||||
| `eac-boot enroll` | appends the CachyOS EAC CA to the Secure Boot db, signed with your KEK; every other entry stays |
|
||||
| `eac-boot setup [bootnum]` | `update`, then creates the firmware entry and puts it at the end of BootOrder; `bootnum` (4 hex digits) replaces the entry with that number |
|
||||
| `eac-boot update` | dracut initramfs, kernel and systemd-boot to the ESP, writes the loader entry |
|
||||
| `eac-boot boot` | sets BootNext to the EAC entry and reboots |
|
||||
| `eac-boot cmdline` | prints the EAC entry's kernel command line |
|
||||
| `eac-boot esp` | prints the ESP mount point |
|
||||
| `eac-boot boot` | starts the EAC entry once (BootNext, and systemd-boot's one-shot entry) and reboots |
|
||||
| `eac-boot cmdline`, `esp`, `kernel-dir`, `loader` | print the command line and the paths in use |
|
||||
|
||||
ESP layout (same as CachyOS with Limine, which `eac-status` checks):
|
||||
ESP layout with the defaults:
|
||||
|
||||
```
|
||||
<esp>/<machine-id>/linux-cachyos-eac/{vmlinuz,initramfs}
|
||||
<esp>/EFI/cachyos-eac/systemd-bootx64.efi
|
||||
<esp>/<machine-id>/linux-cachyos-eac/{vmlinuz,initramfs} KERNEL_DIR
|
||||
<esp>/EFI/cachyos-eac/systemd-bootx64.efi LOADER_DIR
|
||||
<esp>/loader/entries/cachyos-eac.conf ENTRY
|
||||
<esp>/loader/loader.conf
|
||||
<esp>/loader/entries/cachyos-eac.conf
|
||||
```
|
||||
|
||||
Settings:
|
||||
`<esp>/loader/` is where every systemd-boot looks, whatever its own directory.
|
||||
If the ESP already has a `loader.conf` from another systemd-boot, it is kept;
|
||||
`eac-boot boot` then picks the EAC entry through `LoaderEntryOneShot`.
|
||||
|
||||
- `EAC_ESP`: ESP mount point. Default: the first vfat mount of `/efi`, `/boot/efi`, `/boot`.
|
||||
- `/etc/kernel/cmdline`: base kernel command line. Default: `/proc/cmdline`.
|
||||
The EAC options are appended.
|
||||
## Settings: `/etc/eac-boot.conf`
|
||||
|
||||
Shell `KEY=value` lines, all optional:
|
||||
|
||||
| Key | Default |
|
||||
| --- | --- |
|
||||
| `ESP` | first vfat mount of `/efi`, `/boot/efi`, `/boot` |
|
||||
| `KERNEL_DIR` | `<machine-id>/linux-cachyos-eac` (relative to the ESP) |
|
||||
| `LOADER_DIR` | `EFI/cachyos-eac` (relative to the ESP) |
|
||||
| `ENTRY` | `cachyos-eac.conf` |
|
||||
| `LABEL` | `CachyOS EAC` (firmware entry name) |
|
||||
| `CMDLINE` | `/etc/kernel/cmdline`, else `/proc/cmdline`; the EAC options are appended |
|
||||
| `MODULES_DIR` | kmod's `module_directory` |
|
||||
| `KEK_KEY`, `KEK_CERT` | `KEK/KEK.key`, `KEK/KEK.pem` in sbctl's `keydir` (`/etc/sbctl/sbctl.conf`, default `/var/lib/sbctl/keys`) |
|
||||
| `OWNER_GUID` | sbctl's GUID file, else random |
|
||||
|
||||
`eac-status` checks the kernel only under `KERNEL_DIR` and the loader only
|
||||
under `LOADER_DIR`, and expects the kernel modules where kmod looks for them.
|
||||
|
||||
After the first `setup`, every package update runs `eac-boot update` from
|
||||
`pkg_postinst`.
|
||||
`pkg_postinst`. Changing `KERNEL_DIR`, `LOADER_DIR`, `ENTRY` or `LABEL` after
|
||||
`setup` leaves the old files and firmware entry behind: remove them by hand.
|
||||
|
||||
## One-time setup
|
||||
|
||||
1. `eac-boot enroll`: the db needs your own `Database Key`, the Microsoft
|
||||
certificates and `CachyOS EAC CA`. It is written with your sbctl KEK, so
|
||||
Setup Mode is not needed. Do not use `sbctl enroll-keys --append`: it adds
|
||||
every key again, and the firmware keeps the duplicates.
|
||||
1. `eac-boot enroll`: appends `CachyOS EAC CA` to db with an authenticated
|
||||
write signed by your KEK, so Setup Mode is not needed and nothing else in
|
||||
db changes: your own keys, Microsoft's and any other vendor's stay. Run it
|
||||
again and it sees the CA and does nothing. Do not use
|
||||
`sbctl enroll-keys --append`: it re-adds sbctl's keys and the Microsoft
|
||||
certificates, and the firmware keeps the duplicates. To remove duplicates
|
||||
that are already there, see the troubleshooting doc.
|
||||
`sbctl list-enrolled-keys` prints the issuer of each certificate, so some
|
||||
names appear twice in a correct db.
|
||||
2. Your normal kernels must be signed with the sbctl db key. With `USE=secureboot`
|
||||
|
||||
@@ -1,34 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# Boot chain for linux-cachyos-eac: CachyOS-signed systemd-boot on the ESP,
|
||||
# started once through its own firmware entry (BootNext).
|
||||
# Settings: /etc/eac-boot.conf (KEY=value), documented in the README.
|
||||
set -euo pipefail
|
||||
|
||||
EAC_OPTS="lockdown=integrity lsm=landlock,lockdown,yama,integrity,bpf iommu.passthrough=0 intel_iommu=on module.sig_enforce=1 sysctl.kernel.kexec_load_disabled=1"
|
||||
LABEL="CachyOS EAC"
|
||||
SDBOOT=/usr/lib/cachyos-eac/systemd-bootx64.efi.signed
|
||||
CA=/usr/share/cachyos-eac/cachyos-eac-ca
|
||||
LOADER_GUID=4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
|
||||
EFIVARS=/sys/firmware/efi/efivars
|
||||
|
||||
die() { echo "eac-boot: $*" >&2; exit 1; }
|
||||
|
||||
sbctl_conf() { sed -n "s/^$1: *//p" /etc/sbctl/sbctl.conf 2>/dev/null | head -n1; }
|
||||
|
||||
ESP= KERNEL_DIR= LOADER_DIR=EFI/cachyos-eac ENTRY=cachyos-eac.conf LABEL="CachyOS EAC" CMDLINE=
|
||||
MODULES_DIR=$(pkg-config --variable=module_directory kmod 2>/dev/null || true)
|
||||
KEYDIR=$(sbctl_conf keydir)
|
||||
KEK_KEY=${KEYDIR:-/var/lib/sbctl/keys}/KEK/KEK.key
|
||||
KEK_CERT=${KEYDIR:-/var/lib/sbctl/keys}/KEK/KEK.pem
|
||||
OWNER_GUID=
|
||||
[[ -r /etc/eac-boot.conf ]] && . /etc/eac-boot.conf
|
||||
MODULES_DIR=${MODULES_DIR:-/lib/modules}
|
||||
KERNEL_DIR=${KERNEL_DIR:-$(</etc/machine-id)/linux-cachyos-eac}
|
||||
[[ $ENTRY =~ ^[A-Za-z0-9._-]+\.conf$ ]] || die "ENTRY must be a file name ending in .conf: $ENTRY"
|
||||
|
||||
esp() {
|
||||
local d
|
||||
for d in ${EAC_ESP:-} /efi /boot/efi /boot; do
|
||||
for d in $ESP /efi /boot/efi /boot; do
|
||||
[[ $(findmnt -no FSTYPE --mountpoint "$d" 2>/dev/null) == vfat ]] && { echo "$d"; return; }
|
||||
done
|
||||
die "no mounted vfat ESP found, set EAC_ESP"
|
||||
die "no mounted vfat ESP found, set ESP in /etc/eac-boot.conf"
|
||||
}
|
||||
|
||||
kernel_dir() { echo "$(esp)/$KERNEL_DIR"; }
|
||||
loader() { echo "$(esp)/$LOADER_DIR/systemd-bootx64.efi"; }
|
||||
|
||||
kver() {
|
||||
local k
|
||||
k=$(ls -d /lib/modules/*-cachyos-eac 2>/dev/null | sort -V | tail -n1) || true
|
||||
[[ -f $k/vmlinuz ]] || die "no linux-cachyos-eac kernel in /lib/modules"
|
||||
k=$(ls -d "$MODULES_DIR"/*-cachyos-eac 2>/dev/null | sort -V | tail -n1) || true
|
||||
[[ -f $k/vmlinuz ]] || die "no linux-cachyos-eac kernel in $MODULES_DIR"
|
||||
echo "${k##*/}"
|
||||
}
|
||||
|
||||
# Base command line from /etc/kernel/cmdline or the running system, plus the EAC options.
|
||||
# Base command line (CMDLINE, /etc/kernel/cmdline or the running system), plus the EAC options.
|
||||
cmdline() {
|
||||
local src=/proc/cmdline opt out=()
|
||||
[[ -f /etc/kernel/cmdline ]] && src=/etc/kernel/cmdline
|
||||
for opt in $(<"$src"); do
|
||||
local base=$CMDLINE opt out=()
|
||||
if [[ -z $base ]]; then
|
||||
if [[ -f /etc/kernel/cmdline ]]; then base=$(</etc/kernel/cmdline); else base=$(</proc/cmdline); fi
|
||||
fi
|
||||
for opt in $base; do
|
||||
case $opt in BOOT_IMAGE=*|initrd=*) continue ;; esac
|
||||
[[ " $EAC_OPTS " == *" $opt "* ]] && continue
|
||||
out+=("$opt")
|
||||
@@ -41,28 +62,60 @@ bootnum() {
|
||||
}
|
||||
|
||||
update() {
|
||||
local esp kv mid dir
|
||||
local esp kv dir conf
|
||||
esp=$(esp)
|
||||
kv=$(kver)
|
||||
mid=$(</etc/machine-id)
|
||||
dir=$esp/$mid/linux-cachyos-eac
|
||||
mkdir -p "$dir" "$esp/EFI/cachyos-eac" "$esp/loader/entries"
|
||||
dir=$esp/$KERNEL_DIR
|
||||
mkdir -p "$dir" "$esp/$LOADER_DIR" "$esp/loader/entries"
|
||||
|
||||
dracut --force --hostonly --kver "$kv" "$dir/initramfs.new"
|
||||
install -m644 "/lib/modules/$kv/vmlinuz" "$dir/vmlinuz.new"
|
||||
install -m644 "$MODULES_DIR/$kv/vmlinuz" "$dir/vmlinuz.new"
|
||||
mv -f "$dir/initramfs.new" "$dir/initramfs"
|
||||
mv -f "$dir/vmlinuz.new" "$dir/vmlinuz"
|
||||
install -m644 "$SDBOOT" "$esp/EFI/cachyos-eac/systemd-bootx64.efi"
|
||||
install -m644 "$SDBOOT" "$esp/$LOADER_DIR/systemd-bootx64.efi"
|
||||
|
||||
printf 'title CachyOS (EAC)\nlinux /%s/linux-cachyos-eac/vmlinuz\ninitrd /%s/linux-cachyos-eac/initramfs\noptions %s\n' \
|
||||
"$mid" "$mid" "$(cmdline)" > "$esp/loader/entries/cachyos-eac.conf"
|
||||
printf 'default cachyos-eac.conf\ntimeout 0\n' > "$esp/loader/loader.conf"
|
||||
printf 'title CachyOS (EAC)\nlinux /%s/vmlinuz\ninitrd /%s/initramfs\noptions %s\n' \
|
||||
"$KERNEL_DIR" "$KERNEL_DIR" "$(cmdline)" > "$esp/loader/entries/$ENTRY"
|
||||
|
||||
# loader.conf is shared by every systemd-boot on this ESP: only write our own.
|
||||
conf=$(printf 'default %s\ntimeout 0\n' "$ENTRY")
|
||||
if [[ ! -e $esp/loader/loader.conf || $(<"$esp/loader/loader.conf") == "$conf" ]]; then
|
||||
printf '%s\n' "$conf" > "$esp/loader/loader.conf"
|
||||
else
|
||||
echo "eac-boot: kept the existing $esp/loader/loader.conf; eac-boot boot selects $ENTRY once"
|
||||
fi
|
||||
echo "eac-boot: $kv installed to $dir"
|
||||
}
|
||||
|
||||
# The whole db is rewritten: sbctl --append adds every key again, and firmware keeps duplicates.
|
||||
# Same file contents as a certificate in a signature database variable?
|
||||
in_sigdb() {
|
||||
local var=$1 der=$2 f
|
||||
efi-readvar -v "$var" -o "$tmp/$var.esl" >/dev/null
|
||||
(cd "$tmp" && sig-list-to-certs "$var.esl" "$var" >/dev/null 2>&1) || true
|
||||
for f in "$tmp/$var"-*.der; do
|
||||
[[ -f $f ]] && cmp -s "$f" "$der" && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Appends only the CachyOS EAC CA. Every other db entry stays, and nothing is added twice.
|
||||
enroll() {
|
||||
sbctl enroll-keys --partial db --microsoft --custom --ignore-immutable
|
||||
tmp=$(mktemp -d)
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
if in_sigdb db "$CA.der"; then
|
||||
echo "eac-boot: the CachyOS EAC CA is already in db, nothing to do"
|
||||
return
|
||||
fi
|
||||
[[ -r $KEK_KEY && -r $KEK_CERT ]] || die "KEK key or certificate not found ($KEK_KEY, $KEK_CERT); set KEK_KEY and KEK_CERT in /etc/eac-boot.conf"
|
||||
openssl x509 -in "$KEK_CERT" -outform DER -out "$tmp/kek.der"
|
||||
in_sigdb KEK "$tmp/kek.der" || die "$KEK_CERT is not enrolled in KEK, so the firmware would reject the update"
|
||||
local guid=${OWNER_GUID:-$(cat "$(sbctl_conf guid)" 2>/dev/null || cat /proc/sys/kernel/random/uuid)}
|
||||
cert-to-efi-sig-list -g "$guid" "$CA.crt" "$tmp/ca.esl" >/dev/null
|
||||
sign-efi-sig-list -a -g "$guid" -c "$KEK_CERT" -k "$KEK_KEY" db "$tmp/ca.esl" "$tmp/ca.auth" >/dev/null
|
||||
chattr -i "$EFIVARS/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f" 2>/dev/null || true
|
||||
efi-updatevar -a -f "$tmp/ca.auth" db
|
||||
in_sigdb db "$CA.der" || die "the firmware did not take the CachyOS EAC CA"
|
||||
echo "eac-boot: appended the CachyOS EAC CA to db; existing entries were kept"
|
||||
}
|
||||
|
||||
# With a boot number, the entry is created there and replaces the entry that has it.
|
||||
@@ -93,7 +146,7 @@ create() {
|
||||
local have=$1 want=$2 old esp src
|
||||
[[ -n $have ]] && efibootmgr -b "$have" -B >/dev/null
|
||||
if [[ -n $want ]]; then
|
||||
old=$(efibootmgr | sed -n "s/^Boot$want\*\{0,1\} \([^ ]*\).*/\1/p")
|
||||
old=$(efibootmgr | sed -n "s/^Boot$want\*\{0,1\} \([^\t]*\).*/\1/p")
|
||||
if [[ -n $old ]]; then
|
||||
efibootmgr -b "$want" -B >/dev/null
|
||||
echo "eac-boot: removed Boot$want \"$old\""
|
||||
@@ -103,24 +156,37 @@ create() {
|
||||
src=$(findmnt -no SOURCE --mountpoint "$esp")
|
||||
efibootmgr --create-only ${want:+--bootnum "$want"} --disk "/dev/$(lsblk -no PKNAME "$src")" \
|
||||
--part "$(<"/sys/class/block/${src##*/}/partition")" \
|
||||
--label "$LABEL" --loader '\EFI\cachyos-eac\systemd-bootx64.efi' >/dev/null
|
||||
--label "$LABEL" --loader "\\${LOADER_DIR//\//\\}\\systemd-bootx64.efi" >/dev/null
|
||||
echo "eac-boot: created firmware entry Boot$(bootnum) \"$LABEL\""
|
||||
}
|
||||
|
||||
# systemd-boot reads LoaderEntryOneShot (UTF-16LE, NUL-terminated) and deletes it.
|
||||
oneshot() {
|
||||
local var=$EFIVARS/LoaderEntryOneShot-$LOADER_GUID tmp i data='\x07\x00\x00\x00'
|
||||
for ((i = 0; i < ${#ENTRY}; i++)); do data+="${ENTRY:i:1}\\x00"; done
|
||||
tmp=$(mktemp)
|
||||
printf "$data"'\x00\x00' > "$tmp"
|
||||
[[ -e $var ]] && chattr -i "$var" 2>/dev/null
|
||||
cat "$tmp" > "$var"
|
||||
rm -f "$tmp"
|
||||
}
|
||||
|
||||
boot() {
|
||||
local n
|
||||
n=$(bootnum)
|
||||
[[ -n $n ]] || die "no \"$LABEL\" firmware entry, run: eac-boot setup"
|
||||
oneshot
|
||||
efibootmgr --bootnext "$n" >/dev/null
|
||||
reboot
|
||||
}
|
||||
|
||||
case ${1:-} in
|
||||
esp|cmdline) "$1"; exit ;;
|
||||
esp|cmdline|loader) "$1"; exit ;;
|
||||
kernel-dir) kernel_dir; exit ;;
|
||||
esac
|
||||
[[ $(id -u) == 0 ]] || die "run as root"
|
||||
case ${1:-} in
|
||||
enroll|update|boot) "$1" ;;
|
||||
enroll|update|boot|oneshot) "$1" ;;
|
||||
setup) setup "${2:-}" ;;
|
||||
*) echo "usage: eac-boot {enroll|setup [bootnum]|update|boot|cmdline|esp}" >&2; exit 2 ;;
|
||||
*) echo "usage: eac-boot {enroll|setup [bootnum]|update|boot|cmdline|esp|kernel-dir|loader}" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user