From c43e0d2c013b1a2b53dffaf7ca987b51c866f136 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Mon, 9 Nov 2009 12:55:21 -0300 Subject: [PATCH 029/118] bootchart-0.9: adding mamona modifications Signed-off-by: Ricardo Salveti de Araujo --- recipes/bootchart/bootchart_0.9.bb | 14 ++++--- .../bootchart/files/fix-bad-substitution.dpatch | 23 ++++++++++ recipes/bootchart/files/handheld.patch | 45 ++++++------------- recipes/bootchart/files/stop_also_with_xinit.patch | 13 ++++++ .../files/wait_dev_null_before_start_logs.patch | 15 +++++++ 5 files changed, 73 insertions(+), 37 deletions(-) create mode 100644 recipes/bootchart/files/fix-bad-substitution.dpatch create mode 100644 recipes/bootchart/files/stop_also_with_xinit.patch create mode 100644 recipes/bootchart/files/wait_dev_null_before_start_logs.patch diff --git a/recipes/bootchart/bootchart_0.9.bb b/recipes/bootchart/bootchart_0.9.bb index 98ff0c2..edcaad8 100644 --- a/recipes/bootchart/bootchart_0.9.bb +++ b/recipes/bootchart/bootchart_0.9.bb @@ -1,26 +1,28 @@ DESCRIPTION = "Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process." LICENSE = "GPLv2" HOMEPAGE = "http://www.bootchart.org/" -PR = "r1" +PR = "r2" #this only installs the loggers, you will need to run the renderers on your workstation #boot with 'init=/sbin/bootchartd' and do '/sbin/bootchartd stop' to end the logging #needed for a real /bin/sh and /bin/sleep -DEPENDS = "bash coreutils acct" -RDEPENDS = "bash coreutils acct" +DEPENDS = "coreutils acct" +RDEPENDS = "coreutils acct" #this is a plain shell script PACKAGE_ARCH = "all" SRC_URI = "${SOURCEFORGE_MIRROR}/bootchart/bootchart-${PV}.tar.bz2\ - file://handheld.patch;patch=1" - + file://fix-bad-substitution.dpatch;patch=1 \ + file://handheld.patch;patch=1 \ + file://stop_also_with_xinit.patch;patch=1 \ + file://wait_dev_null_before_start_logs.patch;patch=1 \ + " do_install() { install -d ${D}/sbin install -d ${D}/etc - install -d ${D}/bootchart install -m 755 ${S}/script/bootchartd ${D}/sbin install -m 644 ${S}/script/bootchartd.conf ${D}/etc } diff --git a/recipes/bootchart/files/fix-bad-substitution.dpatch b/recipes/bootchart/files/fix-bad-substitution.dpatch new file mode 100644 index 0000000..7267404 --- /dev/null +++ b/recipes/bootchart/files/fix-bad-substitution.dpatch @@ -0,0 +1,23 @@ + +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-bad-substitution.dpatch by Jörg Sommer +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fixes a bashism in bootchartd + +@DPATCH@ +diff -urNad bootchart-0.9~/script/bootchartd bootchart-0.9/script/bootchartd +--- bootchart-0.9~/script/bootchartd 2005-11-13 18:40:01.000000000 +0100 ++++ bootchart-0.9/script/bootchartd 2005-11-21 21:11:32.954039712 +0100 +@@ -101,8 +101,8 @@ + # Write the time (in jiffies). + read uptime < /proc/uptime + uptime=${uptime%% [0-9]*} +- uptime=${uptime/./} +- echo $uptime ++ # uptime=${uptime/./} ++ echo ${uptime%.*}${uptime#*.} + + # Log the command output + eval $cmd 2>/dev/null + diff --git a/recipes/bootchart/files/handheld.patch b/recipes/bootchart/files/handheld.patch index c3ded66..1984009 100644 --- a/recipes/bootchart/files/handheld.patch +++ b/recipes/bootchart/files/handheld.patch @@ -1,13 +1,8 @@ -diff -ur bootchart-0.9-org/script/bootchartd bootchart-0.9/script/bootchartd ---- bootchart-0.9-org/script/bootchartd 2005-11-13 19:40:01.000000000 +0200 -+++ bootchart-0.9/script/bootchartd 2006-08-03 19:06:22.000000000 +0300 -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/bin/bash - # - # Bootchart logger script - # Ziga Mahkovec -@@ -43,10 +43,12 @@ +Index: bootchart-0.9/script/bootchartd +=================================================================== +--- bootchart-0.9.orig/script/bootchartd 2008-12-16 18:31:48.000000000 -0300 ++++ bootchart-0.9/script/bootchartd 2008-12-17 18:51:42.000000000 -0300 +@@ -43,9 +43,11 @@ # boot), a tmpfs is mounted in /mnt. The mount point is immediately # released using a lazy umount, so the script must never leave that # directory. @@ -16,13 +11,11 @@ diff -ur bootchart-0.9-org/script/bootchartd bootchart-0.9/script/bootchartd + LOG_DIR="" if [ -z "$LOG_DIR" ]; then - LOG_DIR="/mnt" -- LAZY_UMOUNT="yes" + LOG_DIR="/bootchart" + mkdir -p $LOG_DIR -+ #LAZY_UMOUNT="yes" + LAZY_UMOUNT="yes" mount -n -t tmpfs -o size=$TMPFS_SIZE none "$LOG_DIR" >/dev/null 2>&1 fi - cd "$LOG_DIR" @@ -54,7 +56,7 @@ [ -n "$LAZY_UMOUNT" ] && umount -nfl "$LOG_DIR" @@ -41,7 +34,7 @@ diff -ur bootchart-0.9-org/script/bootchartd bootchart-0.9/script/bootchartd accton pacct=kernel_pacct fi -@@ -215,18 +217,34 @@ +@@ -215,18 +217,35 @@ # Started by the kernel. Start the logger in background and exec # init(1). IN_INIT="yes" @@ -57,6 +50,7 @@ diff -ur bootchart-0.9-org/script/bootchartd bootchart-0.9/script/bootchartd + + #kparams=$@ + # For some reason, handheld kernel doesn't pass command line here - fish for it ++ mkdir -p /bootchart + mount -t proc none /bootchart + kparams=`cat /bootchart/cmdline` + umount /bootchart @@ -79,23 +73,12 @@ diff -ur bootchart-0.9-org/script/bootchartd bootchart-0.9/script/bootchartd exec $init $* fi -diff -ur bootchart-0.9-org/script/bootchartd.conf bootchart-0.9/script/bootchartd.conf ---- bootchart-0.9-org/script/bootchartd.conf 2005-11-13 19:40:01.000000000 +0200 -+++ bootchart-0.9/script/bootchartd.conf 2006-08-03 15:21:31.000000000 +0300 -@@ -10,16 +10,17 @@ - BOOTLOG_LOCK=".lock" - - # Sampling period (in seconds) --SAMPLE_PERIOD=0.2 -+# Default 0.2 is not fine enough to catch peculiarities in OE-based distro -+SAMPLE_PERIOD=0.1 - - # Whether to enable and store BSD process accounting information. The - # kernel needs to be configured to enable v3 accounting - # (CONFIG_BSD_PROCESS_ACCT_V3). accton from the GNU accounting utilities - # is also required. --PROCESS_ACCOUNTING="no" -+PROCESS_ACCOUNTING="yes" +Index: bootchart-0.9/script/bootchartd.conf +=================================================================== +--- bootchart-0.9.orig/script/bootchartd.conf 2005-11-13 14:40:01.000000000 -0300 ++++ bootchart-0.9/script/bootchartd.conf 2008-12-17 18:53:26.000000000 -0300 +@@ -19,7 +19,7 @@ + PROCESS_ACCOUNTING="no" # Tarball for the various boot log files -BOOTLOG_DEST=/var/log/bootchart.tgz diff --git a/recipes/bootchart/files/stop_also_with_xinit.patch b/recipes/bootchart/files/stop_also_with_xinit.patch new file mode 100644 index 0000000..8e6007e --- /dev/null +++ b/recipes/bootchart/files/stop_also_with_xinit.patch @@ -0,0 +1,13 @@ +Index: bootchart-0.9/script/bootchartd +=================================================================== +--- bootchart-0.9.orig/script/bootchartd ++++ bootchart-0.9/script/bootchartd +@@ -119,7 +119,7 @@ wait_boot() + local runlevel=$( sed -n 's/.*:\(.*\):initdefault:.*/\1/gp' /etc/inittab ) + + # The processes we have to wait for +- local exit_proc="gdmgreeter gdm-binary kdm_greet kdm" ++ local exit_proc="gdmgreeter gdm-binary kdm_greet kdm xinit" + # early_login in FC4 starts gdm early, so fall back to mingetty + local early_login="no" + grep -q early_login /proc/cmdline && early_login="yes" diff --git a/recipes/bootchart/files/wait_dev_null_before_start_logs.patch b/recipes/bootchart/files/wait_dev_null_before_start_logs.patch new file mode 100644 index 0000000..4a3bf41 --- /dev/null +++ b/recipes/bootchart/files/wait_dev_null_before_start_logs.patch @@ -0,0 +1,15 @@ +Index: bootchart-0.9/script/bootchartd +=================================================================== +--- bootchart-0.9.orig/script/bootchartd ++++ bootchart-0.9/script/bootchartd +@@ -61,8 +61,8 @@ start() + accton kernel_pacct + fi + +- # Wait for /proc to be mounted +- while [ ! -f /proc/stat ]; do sleep $SAMPLE_PERIOD; done ++ # Wait for /proc to be mounted and wait for /dev/null to be created ++ while [ ! -f /proc/stat -o ! -c /dev/null ]; do sleep $SAMPLE_PERIOD; done + sleep $SAMPLE_PERIOD + + # -- 1.6.3.3