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