From f4040d96791c032690f49b63aff841183761f0d4 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 17 Apr 2022 00:04:42 +0200 Subject: [PATCH] feat: save minimal scripts in boot partition to easily create a new initramfs or efiboot entry --- scripts/main.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/main.sh b/scripts/main.sh index 3b8d3af..12c113c 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -147,6 +147,23 @@ function generate_initramfs() { --add "bash ${modules[*]}" \ --force \ "$output" + + # Create script to repeat initramfs generation + cat > "$(dirname "$output")/generate_initramfs.sh" <" >&2; exit 1; } +dracut \\ + --conf "/dev/null" \\ + --confdir "/dev/null" \\ + --kver "\$kver" \\ + --no-compress \\ + --no-hostonly \\ + --ro-mnt \\ + --add "bash ${modules[*]}" \\ + --force \\ + "$output" +EOF } function get_cmdline() { @@ -186,6 +203,12 @@ function install_kernel_efi() { gptdev="$(resolve_device_by_id "${DISK_ID_PART_TO_GPT_ID[$DISK_ID_EFI]}")" \ || die "Could not resolve device with id=${DISK_ID_PART_TO_GPT_ID[$DISK_ID_EFI]}" try efibootmgr --verbose --create --disk "$gptdev" --part "$efipartnum" --label "gentoo" --loader '\vmlinuz.efi' --unicode 'initrd=\initramfs.img'" $(get_cmdline)" + + # Create script to repeat adding efibootmgr entry + cat > "/boot/efi/efibootmgr_add_entry.sh" <