mirror of
https://gitlab.com/prism7/archery.git
synced 2026-04-28 01:17:35 +02:00
Change: Systemd-boot > If an 'Extended Bootloader (XBOOTLDR)' partition is being used along with a very small ESP (usually when Dual-booting with Windows),
then the installer will now create sd-boot entries instead of UKIs, to save as much space as possible on the ESP.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Amelia Installer
|
# Amelia Installer
|
||||||
# Source: https://gitlab.com/prism7/archery
|
# Source: https://gitlab.com/prism7/archery
|
||||||
# Version: 9.9.5
|
# Version: 9.9.6
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
@@ -221,7 +221,7 @@ stage_fail() {
|
|||||||
sleep 0.2
|
sleep 0.2
|
||||||
NC "
|
NC "
|
||||||
|
|
||||||
==> [${red}[!] ${stage_prompt} ${yellow}FAILED!${nc}]
|
==> [${red}[!] ${yellow}${stage_prompt} ${red}FAILED!${nc}]
|
||||||
"
|
"
|
||||||
failure
|
failure
|
||||||
}
|
}
|
||||||
@@ -3429,6 +3429,7 @@ Enter [y/n]: "
|
|||||||
|
|
||||||
case "${multibooting}" in
|
case "${multibooting}" in
|
||||||
y)
|
y)
|
||||||
|
uki="n"
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
@@ -6499,7 +6500,11 @@ btldrcfg() {
|
|||||||
if [[ "${xbootloader}" == "no" ]]; then
|
if [[ "${xbootloader}" == "no" ]]; then
|
||||||
if arch-chroot /mnt <<-SDBOOT_INSTL > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-SDBOOT_INSTL > "${void}" 2>&1 2> "${log}" ; then
|
||||||
bootctl install || exit
|
bootctl install || exit
|
||||||
sed -i "/^#timeout 3/s/^#//" ${btldr_esp_mount}/loader/loader.conf || exit
|
cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf || exit
|
||||||
|
timeout 3
|
||||||
|
console-mode auto
|
||||||
|
editor no
|
||||||
|
LOADER_CFG
|
||||||
systemctl enable systemd-boot-update || exit
|
systemctl enable systemd-boot-update || exit
|
||||||
SDBOOT_INSTL
|
SDBOOT_INSTL
|
||||||
stage_ok
|
stage_ok
|
||||||
@@ -6509,7 +6514,18 @@ SDBOOT_INSTL
|
|||||||
elif [[ "${xbootloader}" == "yes" ]]; then
|
elif [[ "${xbootloader}" == "yes" ]]; then
|
||||||
if arch-chroot /mnt <<-SD_XBOOTLDR_INSTL > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-SD_XBOOTLDR_INSTL > "${void}" 2>&1 2> "${log}" ; then
|
||||||
bootctl --esp-path=/efi --boot-path=/boot install || exit
|
bootctl --esp-path=/efi --boot-path=/boot install || exit
|
||||||
sed -i "/^#timeout 3/s/^#//" ${btldr_esp_mount}/loader/loader.conf || exit
|
cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf || exit
|
||||||
|
default arch.conf
|
||||||
|
timeout 3
|
||||||
|
console-mode auto
|
||||||
|
editor no
|
||||||
|
LOADER_CFG
|
||||||
|
cat <<-ENTRY_CFG > /boot/loader/entries/arch.conf || exit
|
||||||
|
title Arch Linux
|
||||||
|
linux /vmlinuz-${kernel}
|
||||||
|
initrd /initramfs-${kernel}.img
|
||||||
|
options rw ${boot_opts[*]}
|
||||||
|
ENTRY_CFG
|
||||||
systemctl enable systemd-boot-update || exit
|
systemctl enable systemd-boot-update || exit
|
||||||
SD_XBOOTLDR_INSTL
|
SD_XBOOTLDR_INSTL
|
||||||
stage_ok
|
stage_ok
|
||||||
@@ -6748,7 +6764,7 @@ var_opts() {
|
|||||||
|
|
||||||
if [[ "${sb_sign}" == "y" && "${setrescue}" == "y" ]]; then
|
if [[ "${sb_sign}" == "y" && "${setrescue}" == "y" ]]; then
|
||||||
local stage_prompt="Rescue Entry Creation"
|
local stage_prompt="Rescue Entry Creation"
|
||||||
if [[ "${bootloader}" == "1" ]]; then
|
if [[ "${bootloader}" == "1" && "${uki}" == "y" ]]; then
|
||||||
if arch-chroot /mnt <<-SDBOOT_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-SDBOOT_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then
|
||||||
echo "systemd.unit=rescue.target rw ${boot_opts[*]}" | tee /etc/cmdline.d/rescued.conf || exit
|
echo "systemd.unit=rescue.target rw ${boot_opts[*]}" | tee /etc/cmdline.d/rescued.conf || exit
|
||||||
cat <<-PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit
|
cat <<-PRESET > /etc/mkinitcpio.d/${kernel}.preset || exit
|
||||||
@@ -6766,6 +6782,19 @@ SDBOOT_RESCUE_ENTRY
|
|||||||
else
|
else
|
||||||
stage_fail
|
stage_fail
|
||||||
fi
|
fi
|
||||||
|
elif [[ "${bootloader}" == "1" && "${uki}" == "n" ]]; then
|
||||||
|
if arch-chroot /mnt <<-SD_XBOOTLDR_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then
|
||||||
|
cat <<-XBOOTLDR_RESCUE_CONF > /boot/loader/entries/rescue.conf || exit
|
||||||
|
title Arch Rescue
|
||||||
|
linux /vmlinuz-${kernel}
|
||||||
|
initrd /initramfs-${kernel}.img
|
||||||
|
options rw systemd.unit=rescue.target ${boot_opts[*]}
|
||||||
|
XBOOTLDR_RESCUE_CONF
|
||||||
|
SD_XBOOTLDR_RESCUE_ENTRY
|
||||||
|
stage_ok
|
||||||
|
else
|
||||||
|
stage_fail
|
||||||
|
fi
|
||||||
elif [[ "${bootloader}" == "2" ]]; then
|
elif [[ "${bootloader}" == "2" ]]; then
|
||||||
if arch-chroot /mnt <<-GRUB_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-GRUB_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then
|
||||||
touch /boot/grub/custom.cfg
|
touch /boot/grub/custom.cfg
|
||||||
@@ -7098,7 +7127,7 @@ secboot_sign() {
|
|||||||
|
|
||||||
if [[ "${sb_sign}" == "y" ]]; then
|
if [[ "${sb_sign}" == "y" ]]; then
|
||||||
local stage_prompt="Secure-Boot Signing"
|
local stage_prompt="Secure-Boot Signing"
|
||||||
if [[ "${bootloader}" == "1" ]]; then
|
if [[ "${bootloader}" == "1" && "${uki}" == "y" ]]; then
|
||||||
if arch-chroot /mnt <<-SDBOOT_SEC_SIGN > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-SDBOOT_SEC_SIGN > "${void}" 2>&1 2> "${log}" ; then
|
||||||
pacman -S --noconfirm sbctl || exit
|
pacman -S --noconfirm sbctl || exit
|
||||||
sbctl create-keys || exit
|
sbctl create-keys || exit
|
||||||
@@ -7123,6 +7152,20 @@ SDBOOT_RESCUE_SEC_SIGN
|
|||||||
stage_fail
|
stage_fail
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
elif [[ "${bootloader}" == "1" && "${uki}" == "n" ]]; then
|
||||||
|
if arch-chroot /mnt <<-SD_XBOOTLDR_SEC_SIGN > "${void}" 2>&1 2> "${log}" ; then
|
||||||
|
pacman -S --noconfirm sbctl || exit
|
||||||
|
sbctl create-keys || exit
|
||||||
|
sbctl enroll-keys -m || exit
|
||||||
|
sbctl sign -s /boot/vmlinuz-${kernel} || exit
|
||||||
|
sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI || exit
|
||||||
|
sbctl sign -s ${btldr_esp_mount}/EFI/systemd/systemd-bootx${bitness}.efi || exit
|
||||||
|
sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi || exit
|
||||||
|
SD_XBOOTLDR_SEC_SIGN
|
||||||
|
stage_ok
|
||||||
|
else
|
||||||
|
stage_fail
|
||||||
|
fi
|
||||||
elif [[ "${bootloader}" == "2" ]]; then
|
elif [[ "${bootloader}" == "2" ]]; then
|
||||||
if [[ "${path}" == "1" ]]; then
|
if [[ "${path}" == "1" ]]; then
|
||||||
if arch-chroot /mnt <<-GRUB_SEC_SIGN > "${void}" 2>&1 2> "${log}" ; then
|
if arch-chroot /mnt <<-GRUB_SEC_SIGN > "${void}" 2>&1 2> "${log}" ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user