aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_local/bin
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:29 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:29 +0100
commitf5155f2137368405d6994a32ada6173b223bbb96 (patch)
tree838aebda4ef3ab5cf499db106f8e16c6abe03f85 /dot_local/bin
parent1e8276a8f39fe9c7b0a076692e8cff87162f8e45 (diff)
downloaddotfiles-f5155f2137368405d6994a32ada6173b223bbb96.tar.gz
dotfiles-f5155f2137368405d6994a32ada6173b223bbb96.tar.bz2
dotfiles-f5155f2137368405d6994a32ada6173b223bbb96.zip
refactor: move create-efi.sh into dot_local/bin/
Aligned with the other personal scripts; chezmoi will deploy it as ~/.local/bin/create-efi (executable, no .sh extension).
Diffstat (limited to 'dot_local/bin')
-rwxr-xr-xdot_local/bin/executable_create-efi56
1 files changed, 56 insertions, 0 deletions
diff --git a/dot_local/bin/executable_create-efi b/dot_local/bin/executable_create-efi
new file mode 100755
index 0000000..9a72263
--- /dev/null
+++ b/dot_local/bin/executable_create-efi
@@ -0,0 +1,56 @@
+#!/usr/bin/env sh
+set -e
+
+lsblk
+
+printf "Boot disk [sda]: " && read -r boot_disk
+if [ -z "$boot_disk" ]; then
+ boot_disk='sda'
+fi
+
+printf "Boot partition number [1]: " && read -r boot_partition_number
+if [ -z "$boot_partition_number" ]; then
+ boot_partition_number='1'
+fi
+
+printf "Root partition [sda2]: " && read -r root_partition
+if [ -z "$root_partition" ]; then
+ root_partition='sda2'
+fi
+root_uuid="UUID=$(blkid -s UUID -o value /dev/"$root_partition")"
+
+printf "Kernel name [linux]: " && read -r kernel_name
+if [ -z "$kernel_name" ]; then
+ kernel_name='linux'
+fi
+
+printf "CPU vendor (intel/amd) [intel]: " && read -r cpu_vendor
+if [ -z "$cpu_vendor" ]; then
+ cpu_vendor='intel'
+fi
+
+printf "ESP (boot/efi) [boot]: " && read -r esp
+if [ -z "$esp" ]; then
+ esp='boot'
+fi
+
+printf "extra kernel parameters (e.g. mitigations=off): " && read -r extra_kernel_params
+
+printf "label [archlinux]: " && read -r label
+if [ -z "$label" ]; then
+ label='archlinux'
+fi
+rel_path=""
+rel_path2=""
+if [ "$esp" = "efi" ]; then
+ rel_path="\\EFI\\arch"
+ rel_path2="/EFI/arch"
+fi
+
+
+unicode_arg="cryptdevice=$root_uuid:root root=/dev/mapper/root rw initrd=$rel_path\\$cpu_vendor-ucode.img initrd=$rel_path\\initramfs-$kernel_name.img quiet $extra_kernel_params"
+
+set -x
+pacman -S --needed "$cpu_vendor"-ucode
+pacman -S --asdeps --needed efibootmgr
+efibootmgr --disk /dev/"$boot_disk" --part "$boot_partition_number" --create --label "$label" --loader "$rel_path2"/vmlinuz-"$kernel_name" --unicode "$unicode_arg"