From f5155f2137368405d6994a32ada6173b223bbb96 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 21 Apr 2026 01:23:29 +0100 Subject: 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). --- .github/copilot-instructions.md | 2 +- create-efi.sh | 56 ------------------------------------- dot_local/bin/executable_create-efi | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 57 deletions(-) delete mode 100755 create-efi.sh create mode 100755 dot_local/bin/executable_create-efi diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fa1c75d..9fee793 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -16,7 +16,7 @@ The repo root is a chezmoi source directory. Files targeting `$HOME` use chezmoi - `etc/` contains system-level configs (`/etc/` targets) — systemd units, pacman hooks, sysctl tunables, kernel module loading. Deployed by `run_onchange_after_deploy-etc.sh.tmpl`. - `meta/` contains plain text package lists for Arch Linux (one package per line, `#` comments). Each `.txt` file represents a group (e.g. `base.txt`, `dev.txt`, `wayland.txt`). Install with `just install base dev` or `just install-all`. Detect drift with `just status`. - `firefox/` contains Firefox/LibreWolf hardening overrides (`user-overrides.js`) and custom CSS (`chrome/userChrome.css`). Deployed by `run_onchange_after_deploy-firefox.sh.tmpl`. -- `create-efi.sh` is an interactive EFI boot entry creation script using `efibootmgr`. +- `dot_local/bin/executable_create-efi` is an interactive EFI boot entry creation script using `efibootmgr` (deployed to `~/.local/bin/create-efi`). - `.chezmoiignore` excludes non-home files (`etc/`, `meta/`, `firefox/`, docs) from deployment to `$HOME`. - `.githooks/` contains git hooks (notably `post-commit` which runs `chezmoi apply`). Activated by `just init`. - `justfile` provides recipes: `init` (first-time setup), `sync` (apply + fix), `apply`, `fix`, `status`, `pkg-drift`, `dotfile-drift`, `undeclared`, `diff`, `merge`, `groups`, `install`, `install-all`, `add`. Run `just` or `just --list` to see them. diff --git a/create-efi.sh b/create-efi.sh deleted file mode 100755 index 9a72263..0000000 --- a/create-efi.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/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" 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" -- cgit v1.2.3-70-g09d2