void-packages/srcpkgs/refind/files/kernel.post-remove
Đoàn Trần Công Danh 51711d3c44 refind: enable page_poison by default, rewrite hook
- both efibootmgr and grub enable page_poison by default.
  Let's enable it with refind, too
- The old post-install hook was written (by me, myself)
  was originally written in ed, and converted to ugly-and-lengthy
  while-read-echo sh.
  Both base-minimal, base-system, and base-chroot provides some kind
  of awk, let's rewrite it in awk.
2020-02-20 10:07:27 +01:00

24 lines
539 B
Bash
Executable file

#!/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}"
[ -f "$REFIND_CONF" ] || exit 0
tmpfile=$(mktemp /tmp/refind.XXXXXXX)
zversion=$(echo $VERSION | sed 's/[.]/[.]/g')
sed "/^menuentry \"Void Linux $zversion\" [{]\$/,/[}]/d" "$REFIND_CONF" >"$tmpfile"
mv "$tmpfile" "$REFIND_CONF"