void-packages/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-remove
Eivind Uggedal e83df02215 gummiboot: fix removal of loader entries
Stop using $PKGNAME (linux3.XX) in post-install since post-remove
gets $PKGNAME as linux through vkpurge.
2014-11-06 01:03:27 +01:00

21 lines
389 B
Bash

#!/bin/sh
#
# Kernel hook for gummiboot.
#
# Arguments passed to this script: $1 pkgname, $2 version.
#
PKGNAME="$1"
VERSION="$2"
boot=$ROOTDIR/boot
entries=$boot/loader/entries
name=void-$VERSION
entry=$entries/$name.conf
loader=$boot/loader/loader.conf
[ -d $boot ] || exit 0
rm -f $entry
# No default entry if the removed entry was the default:
sed -i "/^default $name\$/d" $loader