# HG changeset patch # User Stanislas Leduc # Date 1387606867 -3600 # Node ID 5ece3df55687e1adf6ccb376edbecddf80db6615 # Parent 78f8749b32c79393eed76b2326c3fce9b87ffd67 linux-lxc: add post_install() for update menu.lst diff -r 78f8749b32c7 -r 5ece3df55687 linux-lxc/receipt --- a/linux-lxc/receipt Fri Dec 20 23:12:31 2013 +0100 +++ b/linux-lxc/receipt Sat Dec 21 07:21:07 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 <