wok-6.x rev 3191

linux: dont write into grub menu.lst on each install (we can do better)
author Christophe Lincoln <pankso@slitaz.org>
date Tue May 26 17:24:33 2009 +0200 (2009-05-26)
parents 2f7e334d7e4c
children 41aa89bb8444
files linux/receipt
line diff
     1.1 --- a/linux/receipt	Tue May 26 17:23:34 2009 +0200
     1.2 +++ b/linux/receipt	Tue May 26 17:24:33 2009 +0200
     1.3 @@ -96,17 +96,18 @@
     1.4      echo "Processing post-install commands..."
     1.5      chroot "$1/" depmod -a $VERSION-slitaz
     1.6      if [ -f "$1/boot/grub/menu.lst" ]; then
     1.7 -    	root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'`
     1.8 -		grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("`
     1.9 -		# Add new kernel entry in case of upgrade for installed system.
    1.10 -    	cat >> $1/boot/grub/menu.lst << EOT
    1.11 +		if ! grep -q "vmlinuz-$VERSION-slitaz" $1/boot/grub/menu.lst; then
    1.12 +    		root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
    1.13 +			grub_dev=`cat $1/boot/grub/menu.lst | grep "root.* (" | head -n 1`
    1.14 +			# Add new kernel entry in case of upgrade for installed system.
    1.15 +    		cat >> $1/boot/grub/menu.lst << EOT
    1.16  
    1.17  title  SliTaz GNU/Linux (Kernel $VERSION-slitaz)
    1.18  $grub_dev
    1.19         kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
    1.20  EOT
    1.21 -		# Display information message.
    1.22 -    	cat <<EOT
    1.23 +			# Display information message.
    1.24 +    		cat <<EOT
    1.25  ----
    1.26  GRUB is installed, these tree lines has been added to the menu.lst:
    1.27   
    1.28 @@ -115,5 +116,8 @@
    1.29         kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
    1.30  ----
    1.31  EOT
    1.32 +		else
    1.33 +			echo "Grub menu.lst seems already configured to boot new Kernel..."
    1.34 +		fi
    1.35  	fi
    1.36  }