archboot/usr/lib/initcpio/install/archboot_secure_boot

36 lines
1.2 KiB
Text
Raw Normal View History

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# Created by Tobias Powalowski <tpowa@archlinux.org>
build ()
{
# https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot
2022-01-31 08:28:53 +01:00
_RUNNING_ARCH="$(uname -m)"
2023-08-19 18:09:49 +02:00
map add_binary openssl sbattach sbkeysync sbsiglist sbsign sbvarsign sbverify mokutil sbctl
map add_file /etc/ssl/openssl.cnf /usr/share/licenses/sbctl/LICENSE
# add mkkeys.sh,
# curl -s -L -O https://www.rodsbooks.com/efi-bootloaders/mkkeys.sh
# modiiied to use uuidgen instead of python
add_file /usr/bin/archboot-mkkeys.sh /usr/bin/mkkeys.sh
2022-01-31 08:28:53 +01:00
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
2022-01-30 16:16:45 +01:00
for i in shimx64.efi mmx64.efi mmia32.efi shimia32.efi; do
2022-02-18 15:50:06 +01:00
add_file "/usr/share/archboot/bootloader/${i}"
2022-01-30 16:16:45 +01:00
done
2022-01-06 18:31:16 +01:00
fi
2022-01-31 08:28:53 +01:00
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
2022-02-18 15:50:06 +01:00
for i in mmaa64.efi shimaa64.efi; do
add_file "/usr/share/archboot/bootloader/${i}"
2022-01-30 16:16:45 +01:00
done
2022-01-06 18:31:16 +01:00
fi
# add generate keys script
add_file /usr/bin/archboot-secureboot-keys.sh /usr/bin/secureboot-keys.sh
}
help ()
{
cat<<HELPEOF
This hook includes secure boot tools on an archboot image.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et: