# HG changeset patch # User Stanislas Leduc # Date 1387606887 -3600 # Node ID b7c0ad6f5fca0b11c731d4e894ef426916c5b274 # Parent d72076169c9e8904799187e98e89eec21b73c004 linux-lxc: add post_install() for update menu.lst diff -r d72076169c9e -r b7c0ad6f5fca linux-lxc/receipt --- a/linux-lxc/receipt Fri Dec 20 23:16:26 2013 +0100 +++ b/linux-lxc/receipt Sat Dec 21 07:21:27 2013 +0100 @@ -20,3 +20,37 @@ cp -a $src/lib/firmware $fs/lib chown -R root.root $fs } + +# Pre and post install commands for Tazpkg. +post_install() +{ + echo "Processing post-install commands..." + chroot "$1/" depmod -a $VERSION-lxc-slitaz + # GRUB stuff. + if [ -f "$1/boot/grub/menu.lst" ]; then + root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ +]*\).*/\1/' | head -n 1` + grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n +1` + # Add new kernel entry in case of upgrade for installed system. + if ! grep -q $PACKAGE-$VERSION-lxc-slitaz $1/boot/grub/menu.lst; +then + cat >> $1/boot/grub/menu.lst << EOT + +title SliTaz GNU/Linux (Kernel $VERSION-lxc-slitaz) +$grub_dev +kernel /boot/vmlinuz-$VERSION-lxc-slitaz root=$root_dev +EOT + fi + # Display information message. + cat <