2009-08-11 15:32:10 +02:00
|
|
|
#
|
|
|
|
# This script adds an entry to grub's menu.lst file.
|
|
|
|
#
|
|
|
|
menulst=boot/grub/menu.lst
|
|
|
|
|
|
|
|
case "${ACTION}" in
|
|
|
|
pre)
|
|
|
|
;;
|
|
|
|
post)
|
|
|
|
if [ ! -f $menulst ]; then
|
2009-08-11 19:42:22 +02:00
|
|
|
[ ! -d boot/grub ] && mkdir -p boot/grub
|
2009-08-11 15:32:10 +02:00
|
|
|
echo "default 0" >> $menulst
|
|
|
|
echo "timeout 5" >> $menulst
|
|
|
|
fi
|
|
|
|
|
|
|
|
if grep -q "^title XBPS ${PKGNAME}-${VERSION}$" $menulst; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Updating GRUB's menu.lst for kernel-${VERSION}..."
|
|
|
|
( \
|
|
|
|
echo; \
|
|
|
|
echo "title XBPS ${PKGNAME}-${VERSION}"; \
|
|
|
|
echo "kernel /boot/vmlinuz-${VERSION} ro quiet root=LABEL=root"; \
|
|
|
|
echo "initrd /boot/initrd.img-${VERSION}"; \
|
|
|
|
) >> $menulst
|
|
|
|
;;
|
|
|
|
esac
|