# HG changeset patch # User Christophe Lincoln # Date 1243351473 -7200 # Node ID d0b189b591ab38c19e47aa5dc852a12e2a7c0ac6 # Parent 2f7e334d7e4c39d797aff0b38f33f36ae6566e08 linux: dont write into grub menu.lst on each install (we can do better) diff -r 2f7e334d7e4c -r d0b189b591ab linux/receipt --- a/linux/receipt Tue May 26 17:23:34 2009 +0200 +++ b/linux/receipt Tue May 26 17:24:33 2009 +0200 @@ -96,17 +96,18 @@ echo "Processing post-install commands..." chroot "$1/" depmod -a $VERSION-slitaz if [ -f "$1/boot/grub/menu.lst" ]; then - root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'` - grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("` - # Add new kernel entry in case of upgrade for installed system. - cat >> $1/boot/grub/menu.lst << EOT + if ! grep -q "vmlinuz-$VERSION-slitaz" $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. + cat >> $1/boot/grub/menu.lst << EOT title SliTaz GNU/Linux (Kernel $VERSION-slitaz) $grub_dev kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev EOT - # Display information message. - cat <