#!/bin/sh version () { echo "genefi by fxqnlr v$1" } generate () { efi_path=/efi/EFI/Linux cd $efi_path select efi_file in *; do break; done; echo "creating EFI entry for $efi_file" readarray -d "-" -t file_arr <<< $efi_file kernel_version=${file_arr[1]} echo "recognized kernel version $kernel_version" efi_label="gentoo-$kernel_version" echo "assigned label '$efi_label'" doas efibootmgr --create --disk=/dev/nvme0n1 --part=1 --label="$efi_label" --loader="\\EFI\\Linux\\$efi_file" --unicode } if [[ "$1" = "-v" ]] || [[ "$1" = "-V" ]] || [[ "$1" = "--version" ]]; then version "0.2.0" else generate fi