refind: improve consistency of relative paths in kernel hooks

This commit is contained in:
Andrew J. Hesford 2020-08-05 12:13:09 -04:00
parent b8cdf2c27d
commit 38da25370b
3 changed files with 7 additions and 9 deletions

View File

@ -12,22 +12,18 @@ if [ "z$UPDATE_REFIND_CONF" != "z1" ]; then
exit 0;
fi
# Default refind.conf
: "${REFIND_CONF:=/boot/EFI/refind/refind.conf}"
: ${REFIND_CONF:=boot/EFI/refind/refind.conf}
REFIND_CONF="${REFIND_CONF#/}"
zrefind_dir="${REFIND_CONF%/*}"
mkdir -p "$zrefind_dir"
mkdir -p "${REFIND_CONF%/*}"
touch "$REFIND_CONF"
tmpfile=$(mktemp /tmp/refind.XXXXXXX)
zefi_mountpoint=$(df -P "$REFIND_CONF" | awk 'NR==2{print $6}')
zicon="${zrefind_dir#$zefi_mountpoint}/icons/os_void.png"
zversion=$(echo "$VERSION" | sed 's/[.]/[.]/g')
zentry=$(cat <<EOF
menuentry "Void Linux $VERSION" {
icon $zicon
volume "Void Linux"
loader /vmlinuz-$VERSION
initrd /initramfs-$VERSION.img

View File

@ -13,7 +13,9 @@ if [ "z$UPDATE_REFIND_CONF" != "z1" ]; then
fi
# Default refind.conf
: "${REFIND_CONF:=/boot/EFI/refind/refind.conf}"
: "${REFIND_CONF:=boot/EFI/refind/refind.conf}"
# Make sure paths are relative
REFIND_CONF="${REFIND_CONF#/}"
[ -f "$REFIND_CONF" ] || exit 0

View File

@ -1,7 +1,7 @@
# Template file for 'refind'
pkgname=refind
version=0.12.0
revision=1
revision=2
archs="x86_64* i686* aarch64*"
makedepends="gnu-efi-libs"
depends="bash dosfstools efibootmgr"