SOURCES: bootchart-initscript.patch (NEW) - kernel passes extra ke...

glen glen at pld-linux.org
Fri Dec 8 12:40:23 CET 2006


Author: glen                         Date: Fri Dec  8 11:40:23 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- kernel passes extra kernel cmdline to init env
- and if it doesn't mount /proc and get /proc/cmdline
- pld msg_usage

---- Files affected:
SOURCES:
   bootchart-initscript.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/bootchart-initscript.patch
diff -u /dev/null SOURCES/bootchart-initscript.patch:1.1
--- /dev/null	Fri Dec  8 12:40:23 2006
+++ SOURCES/bootchart-initscript.patch	Fri Dec  8 12:40:17 2006
@@ -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
+ 
================================================================


More information about the pld-cvs-commit mailing list