New comment by sgn on void-packages repository https://github.com/void-linux/void-packages/pull/24079#issuecomment-669887298 Comment: Simplified refind, no complicated logic, what do you think? ```sh #!/bin/sh # # Kernel hook for refind. # # Arguments passed to this script: $1 pkgname, $2 version. # PKGNAME="$1" VERSION="$2" . "${ROOTDIR}/etc/default/refind-kernel-hook.conf" if [ "z$UPDATE_REFIND_CONF" != "z1" ]; then exit 0; fi # Default refind.conf : "${REFIND_CONF:=boot/EFI/refind/refind.conf}" REFIND_CONF=${REFIND_CONF#/} [ -n "${REFIND_CONF}" ] || exit 0 # refind-install only supports those two paths refind_dir= case "$REFIND_CONF" in */EFI/[Bb][Oo][Oo][Tt]/refind.conf) refind_dir="/EFI/BOOT" ;; */EFI/refind/refind.conf) refind_dir="/EFI/refind" ;; *) echo >&2 "unsupported \$REFIND_CONF: $REFIND_CONF" exit 1 ;; esac tmpfile=$(mktemp /tmp/refind.XXXXXXX) zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g') ( # Clean itself if this is force reconfigure sed "/^menuentry \"Void Linux $zversion\" [{]\$/,/[}]/d" <"$REFIND_CONF" cat <"$tmpfile" mv "$tmpfile" "$REFIND_CONF" exit 0 ```