# SliTaz package receipt. PACKAGE="bootchart" VERSION="0.9" CATEGORY="misc" SHORT_DESC="boot process performance analyzer (add init=/sbin/bootchartd to boot options)" MAINTAINER="jozee@slitaz.org" LICENSE="GPL2" WEB_SITE="https://github.com/sofar/bootchart" TARBALL="$PACKAGE-$VERSION.tar.bz2" WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" TAGS="boot performance profile analysis" SUGGESTED="pybootchartgui" # What is the latest version available today? current_version() { wget -O - $WEB_SITE/tags 2>/dev/null | \ sed '/archive.*tar/!d;s|.*/[A-Za-z_-]*\(.*\).tar.*|\1|;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/sbin $fs/etc cp -a $src/script/bootchartd $fs/sbin/bootchartd cp -a $src/script/bootchartd.conf $fs/etc sed -i "s/SAMPLE_PERIOD=0.2/SAMPLE_PERIOD=1/" $fs/etc/bootchartd.conf sed -i "s/kdm_greet/kdm_greet slim /" $fs/sbin/bootchartd sed -i 's|/usr/bin/bootchart|/usr/bin/pybootchartgui|g' $fs/sbin/bootchartd chown -R root:root $fs } post_install() { KERNEL_VERSION=$(uname -r | cut -d- -f1) MENU="$1/boot/grub/menu.lst" if [ -f "$MENU" ]; then # add an entry only if slitaz is installed and bootchart is not configured if ! grep -q "vmlinuz-$KERNEL_VERSION-slitaz.*sbin/bootchartd.*" "$MENU"; then # FIXME: really use the first comer value? # (our lines will be LAST) root_dev=`sed -n 's/.*root=\([^ ]*\).*/\1/p' "$MENU" | head -n1` grub_dev=`sed -n '/^[^#]*root.* (/p' "$MENU" | head -n1` # Add new kernel entry for bootchart and display information message echo echo "----" echo "GRUB is installed, these tree lines has been added to the menu.lst:" tee -a "$MENU" << EOT title SliTaz GNU/Linux (Kernel $KERNEL_VERSION-slitaz) with bootchart $grub_dev kernel /boot/vmlinuz-$KERNEL_VERSION-slitaz root=$root_dev init=/sbin/bootchartd EOT echo "----" else echo echo "Grub menu.lst seems already configured to boot new Kernel..." fi fi }