2021-10-12 10:08:10 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-01-27 08:08:28 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2021-10-12 10:08:10 +02:00
|
|
|
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
|
|
|
|
|
|
|
build ()
|
|
|
|
{
|
2021-10-12 11:55:47 +02:00
|
|
|
# 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
|
2022-04-07 17:54:56 +02:00
|
|
|
map add_file "/etc/ssl/openssl.cnf" "/usr/share/licenses/sbctl/LICENSE"
|
2022-02-03 22:05:49 +01:00
|
|
|
# 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
|
2021-10-14 15:12:56 +02:00
|
|
|
# add generate keys script
|
2021-10-15 11:11:37 +02:00
|
|
|
add_file "/usr/bin/archboot-secureboot-keys.sh" "/usr/bin/secureboot-keys.sh"
|
2021-10-12 10:08:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
help ()
|
|
|
|
{
|
|
|
|
cat<<HELPEOF
|
|
|
|
This hook includes secure boot tools on an archboot image.
|
|
|
|
HELPEOF
|
|
|
|
}
|
2023-01-27 08:08:28 +01:00
|
|
|
# vim: set ft=sh ts=4 sw=4 et:
|