wok annotate bootchart/receipt @ rev 5044

improve kernel version in bootchart grub entry (thanks allan)
author Rohit Joshi <jozee@slitaz.org>
date Thu Mar 04 11:38:39 2010 +0000 (2010-03-04)
parents 4ffc7c76d358
children b792559721d1
rev   line source
jozee@3217 1 # SliTaz package receipt.
jozee@3217 2
jozee@3217 3 PACKAGE="bootchart"
jozee@3217 4 VERSION="0.9"
jozee@3217 5 CATEGORY="misc"
jozee@3217 6 SHORT_DESC="boot process performance analyzer (add init=/sbin/bootchartd to boot options)"
jozee@3217 7 MAINTAINER="jozee@slitaz.org"
jozee@3217 8 SUGGESTED="pybootchartgui"
jozee@3217 9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
jozee@3217 10 WEB_SITE="http://www.bootchart.org/"
jozee@3217 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
jozee@3567 12 TAGS="boot performance profile analyze"
jozee@3217 13
jozee@3217 14
jozee@3217 15
jozee@3217 16 # Rules to gen a SliTaz package suitable for Tazpkg.
jozee@3217 17 genpkg_rules()
jozee@3217 18 {
jozee@3217 19 mkdir -p $fs/sbin $fs/etc
jozee@3217 20 cp -a $src/script/bootchartd $fs/sbin/bootchartd
jozee@3217 21 cp -a $src/script/bootchartd.conf $fs/etc
jozee@3217 22 sed -i "s/SAMPLE_PERIOD=0.2/SAMPLE_PERIOD=1/" $fs/etc/bootchartd.conf
jozee@3217 23 sed -i "s/kdm_greet/kdm_greet slim /" $fs/sbin/bootchartd
jozee@3217 24 sed -i "s|\/usr\/bin\/bootchart|\/usr\/bin\/pybootchartgui|g" $fs/sbin/bootchartd
jozee@3217 25
jozee@3217 26 }
jozee@3217 27
jozee@3217 28 post_install()
jozee@3217 29 {
jozee@5044 30 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
jozee@3217 31 if [ -f "$1/boot/grub/menu.lst" ]; then
jozee@5044 32 if ! grep -q "vmlinuz-$KERNEL_VERSION-slitaz" $1/boot/grub/menu.lst; then
jozee@3217 33 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
jozee@3217 34 grub_dev=`cat $1/boot/grub/menu.lst | grep "root.* (" | head -n 1`
jozee@3217 35 # Add new kernel entry in case of upgrade for installed system.
jozee@3217 36 cat >> $1/boot/grub/menu.lst << EOT
jozee@3217 37
jozee@5044 38 title SliTaz GNU/Linux (Kernel $KERNEL_VERSION-slitaz) with bootchart
jozee@3217 39 $grub_dev
jozee@5044 40 kernel /boot/vmlinuz-$KERNEL_VERSION-slitaz root=$root_dev init=/sbin/bootchartd
jozee@3217 41 EOT
jozee@3217 42 # Display information message.
jozee@3217 43 cat <<EOT
jozee@3217 44 ----
jozee@3217 45 GRUB is installed, these tree lines has been added to the menu.lst:
jozee@3217 46
jozee@5044 47 title SliTaz GNU/Linux (Kernel $KERNEL_VERSION-slitaz)
jozee@3217 48 $grub_dev
jozee@5044 49 kernel /boot/vmlinuz-$KERNEL_VERSION-slitaz root=$root_dev init=/sbin/bootchartd
jozee@3217 50 ----
jozee@3217 51 EOT
jozee@3217 52 else
jozee@3217 53 echo "Grub menu.lst seems already configured to boot new Kernel..."
jozee@3217 54 fi
jozee@3217 55 fi
jozee@3217 56 }