summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-08-21 11:30:50 +0200
committerfxqnlr <[email protected]>2024-08-21 11:30:50 +0200
commit5d3b6fe143d7daad1802b8935de60eae48cae465 (patch)
tree71b821eb6bb18435d4cb2a2704c9c45a44b2b1f6
downloadgenefi-5d3b6fe143d7daad1802b8935de60eae48cae465.tar
genefi-5d3b6fe143d7daad1802b8935de60eae48cae465.tar.gz
genefi-5d3b6fe143d7daad1802b8935de60eae48cae465.zip
initial commit
-rwxr-xr-xgenefi.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/genefi.sh b/genefi.sh
new file mode 100755
index 0000000..5e3ad14
--- /dev/null
+++ b/genefi.sh
@@ -0,0 +1,27 @@
1#!/bin/sh
2version () {
3 echo "genefi by fxqnlr v$1"
4}
5
6generate () {
7 efi_path=/efi/EFI/Linux
8 cd $efi_path
9
10 select efi_file in *; do break; done;
11 echo "creating EFI entry for $efi_file"
12
13 readarray -d "-" -t file_arr <<< $efi_file
14 kernel_version=${file_arr[1]}
15 echo "recognized kernel version $kernel_version"
16
17 efi_label="gentoo-$kernel_version"
18 echo "assigned label '$efi_label'"
19
20 doas efibootmgr --create --disk=/dev/nvme0n1 --part=1 --label="$efi_label" --loader="\\EFI\\Linux\\$efi_file" --unicode
21}
22
23if [[ "$1" = "-v" ]] || [[ "$1" = "-V" ]] || [[ "$1" = "--version" ]]; then
24 version "0.2.0"
25else
26 generate
27fi