]> git.pld-linux.org Git - packages/bootchart.git/commitdiff
- kernel passes extra kernel cmdline to init env
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 8 Dec 2006 11:40:17 +0000 (11:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- and if it doesn't mount /proc and get /proc/cmdline
- pld msg_usage

Changed files:
    bootchart-initscript.patch -> 1.1

bootchart-initscript.patch [new file with mode: 0644]

diff --git a/bootchart-initscript.patch b/bootchart-initscript.patch
new file mode 100644 (file)
index 0000000..34d3f8e
--- /dev/null
@@ -0,0 +1,80 @@
+--- bootchart-0.9/script/bootchartd    2006-12-05 23:34:46.817310332 +0200
++++ bootchart-0.9/script/bootchartd    2006-12-08 13:35:59.820678167 +0200
+@@ -37,7 +37,7 @@
+ {
+       # Make sure only a single instance is running
+       [ -f "$BOOTLOG_LOCK" ] && return
+-      
++
+       # Mount the temporary file system for log file storage.  If possible,
+       # a temporary directory is created.  In most cases though (i.e. during
+       # boot), a tmpfs is mounted in /mnt.  The mount point is immediately
+@@ -58,7 +58,7 @@
+               > kernel_pacct
+               accton kernel_pacct
+       fi
+-      
++
+       # Wait for /proc to be mounted
+       while [ ! -f /proc/stat ]; do sleep $SAMPLE_PERIOD; done
+       sleep $SAMPLE_PERIOD
+@@ -216,17 +216,37 @@
+       # init(1).
+       IN_INIT="yes"
+       echo "Starting bootchart logging"
+-      start &
+-      
+-      # Optionally, an alternative init(1) process may be specified using
+-      # the kernel command line (e.g. "bootchart_init=/sbin/initng")
+-      init="/sbin/init"
+-      for i in $@; do
+-              if [ "${i%%=*}" = "bootchart_init" ]; then
+-                      init="${i#*=}"
+-                      break
++
++      # With 2.6.18 i had this in environment!
++      if [ -n "$bootchart_init" ]; then
++              init=$bootchart_init
++              start &
++
++      else
++              init="/sbin/init"
++
++              # get the cmdline from /proc/cmdline
++              if [ ! -f /proc/cmdline ]; then
++                      mount -n -t proc none /proc
++                      UMOUNT_PROC=yes
++              fi
++              cmdline=$(cat /proc/cmdline)
++              if [ "$UMOUNT_PROC" = yes ]; then
++                      umount -n /proc
+               fi
+-      done
++
++              start &
++
++              # Optionally, an alternative init(1) process may be specified using
++              # the kernel command line (e.g. "bootchart_init=/sbin/initng")
++              for i in $cmdline; do
++                      if [ "${i%%=*}" = "bootchart_init" ]; then
++                              init="${i#*=}"
++                              break
++                      fi
++              done
++      fi
++
+       exec $init $*
+ fi
+@@ -247,7 +267,10 @@
+               killall -USR1 bootchartd
+               ;;
+       *)
+-              echo $"Usage: $0 {init|start|stop}"
++              # Source function library
++              . /etc/rc.d/init.d/functions
++
++              msg_usage "$0 {init|start|stop}"
+               ;;
+ esac
This page took 0.114375 seconds and 4 git commands to generate.