From 543d3e59cace58ed6343a2ea22257e0983a43d16 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 7 May 2023 01:22:17 +0200 Subject: [PATCH] Add scripts for installing secure boot --- profiles/ManuSurface/Arch/install.sh | 1 + scripts/Arch/Config/SecureBoot/install.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 scripts/Arch/Config/SecureBoot/install.sh diff --git a/profiles/ManuSurface/Arch/install.sh b/profiles/ManuSurface/Arch/install.sh index 122baaf3..3cd193e3 100755 --- a/profiles/ManuSurface/Arch/install.sh +++ b/profiles/ManuSurface/Arch/install.sh @@ -1,6 +1,7 @@ #!/bin/bash pushd "${BASH_SOURCE%/*}" > /dev/null; +. "../../../scripts/Arch/Conig/SecureBoot/install.sh"; . "../../../scripts/Arch/Devices/SurfaceBook2/install.sh"; . "../../../scripts/Arch/Software/sddm/install.sh"; . "../../../scripts/Arch/Config/ssh-agent/install.sh"; diff --git a/scripts/Arch/Config/SecureBoot/install.sh b/scripts/Arch/Config/SecureBoot/install.sh new file mode 100755 index 00000000..e9cea228 --- /dev/null +++ b/scripts/Arch/Config/SecureBoot/install.sh @@ -0,0 +1,18 @@ +#!/bin/bash +EFI_BOOT_DIR="${EFI_BOOT_DIR:-"/boot"}"; +BOOTLOADER_ID=${BOOTLOADER_ID:-"Arch"}; +bootNum="$(efibootmgr | sed "/$BOOTLOADER_ID/{ s/^.*Boot\([[:digit:]]\+\)\*.*$/\1/; p; }; d")"; + +echo $EFI_BOOT_DIR; + +yay --noconfirm -Syu secureboot-grub; +sudo efibootmgr --delete-bootnum --bootnum "$bootNum"; + +sudo sed -i \ + -e "/esp=/{" \ + -e "a esp=\"$EFI_BOOT_DIR\"" \ + -e "d" \ + -e "}" \ + /etc/secureboot.conf; + +sudo secure-grub-install;