wok view bootchart/receipt @ rev 12088

busybox: su should not chdir (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 10 09:31:50 2012 +0100 (2012-03-10)
parents 1f027408aeca
children a7b54d88ae54
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=`uname -a | cut -d ' ' -f3 | cut -d '-' -f1`
31 if [ -f "$1/boot/grub/menu.lst" ]; then
32 # add an entry only if slitaz is installed and bootchart is not configured
33 if ! grep -q "vmlinuz-$KERNEL_VERSION-slitaz.*sbin/bootchartd.*" $1/boot/grub/menu.lst; then
34 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
35 grub_dev=`cat $1/boot/grub/menu.lst | grep "root.* (" | head -n 1`
36 # Add new kernel entry for bootchart
37 cat >> $1/boot/grub/menu.lst << EOT
39 title SliTaz GNU/Linux (Kernel $KERNEL_VERSION-slitaz) with bootchart
40 $grub_dev
41 kernel /boot/vmlinuz-$KERNEL_VERSION-slitaz root=$root_dev init=/sbin/bootchartd
42 EOT
43 # Display information message.
44 cat <<EOT
45 ----
46 GRUB is installed, these tree lines has been added to the menu.lst:
48 title SliTaz GNU/Linux (Kernel $KERNEL_VERSION-slitaz)
49 $grub_dev
50 kernel /boot/vmlinuz-$KERNEL_VERSION-slitaz root=$root_dev init=/sbin/bootchartd
51 ----
52 EOT
53 else
54 echo "Grub menu.lst seems already configured to boot new Kernel..."
55 fi
56 fi
57 }