[Initng-svn] r2369 - initng/initfiles/system

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Dec 8 23:44:17 CET 2005


Author: deac
Date: Thu Dec  8 23:44:16 2005
New Revision: 2369

Modified:
   initng/initfiles/system/initial.ii
Log:
initfiles/system/initial.ii: clean ups.

Modified: initng/initfiles/system/initial.ii
==============================================================================
--- initng/initfiles/system/initial.ii	(original)
+++ initng/initfiles/system/initial.ii	Thu Dec  8 23:44:16 2005
@@ -2,170 +2,173 @@
 service system/initial/mountvirtfs {
     critical;
     script start = {
+		umask 022
+		set -e
 
-umask 022
-set -e
+		if awk '{ gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 1 ; exit } END { exit ret }' < /proc/mounts
+		then
+			echo "Mounting proc at /proc ..."
+			@mkdir@ -p /proc && mount -n -t proc none /proc &
+		fi
+
+		if awk '{ gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 1 ; exit } END { exit ret }' < /proc/mounts
+		then
+			echo "Mounting sysfs at /sys ..."
+			@mkdir@ -p /sys && mount -n -t sysfs none /sys &
+		fi
+
+		# Ok, go create /dev
+		if awk '{ gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 1 ; exit } END { exit ret }' < /proc/mounts
+		then
+			echo "Mounting ramfs at /dev ..."
+			@mkdir@ -p /dev && mount -n -o size=10M,mode=0755 -t tmpfs tmpfs /dev && @mknod@ /dev/null c 1 3 -m 666 &
+		fi
 
-if ! awk 'BEGIN { ret = 1 } { gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 0 ; exit } END { exit ret }' < /proc/mounts
-then
-    echo "Mounting proc at /proc ..."
-    @mkdir@ -p /proc && mount -n -t proc none /proc &
-fi
-
-if ! awk 'BEGIN { ret = 1 } { gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 0 ; exit } END { exit ret }' < /proc/mounts
-then
-    echo "Mounting sysfs at /sys ..."
-    @mkdir@ -p /sys && mount -n -t sysfs none /sys &
-fi
-
-# Ok, go create /dev
-if ! awk 'BEGIN { ret = 1 } { gsub( /\/+/, "/"); } $2 ~ /\/sys\/?/ { ret = 0 ; exit } END { exit ret }' < /proc/mounts
-then
-    echo "Mounting ramfs at /dev ..."
-    @mkdir@ -p /dev && mount -n -o size=10M,mode=0755 -t tmpfs tmpfs /dev && @mknod@ /dev/null c 1 3 -m 666 &
-fi
+		# Make sure all mounts are finished.
+		wait 
 
-# Make sure all mounts are finished.
-wait 
-
-exit 0
-    };
+		exit 0
+	};
 }
 
 # udevd to handle udev requests
 daemon system/initial/udevd {
-    need = system/initial/mountvirtfs;
-    exec daemon = @/sbin/udevd@;
+	need = system/initial/mountvirtfs;
+	exec daemon = @/sbin/udevd@;
 }
 
 # fill the /dev with all devices system have
 service system/initial/filldev {
-    need = system/initial/mountvirtfs system/initial/udevd;
-    critical;
-    script start = {
-
-umask 022
-set -e    
-    
-    if [ -e /lib/udev/devices ]
-    then
-
-	# Copy over default device tree
-	(cd /lib/udev/devices && find -print0 | cpio --quiet -0pmdu /dev)
-    
-	echo -n "Running @/sbin/udevplug@ .. :"
-	time @/sbin/udevplug@
-	echo "  done"
-    else
-
-    # Check for udevstart.
-    if [ ! -e @/sbin/udevstart:/sbin/start_udev@ ]; then 
-	echo "@/sbin/udevstart:/sbin/start_udev@ is missing, cant boot this system!"
-	exit 1
-    fi
-
-    echo "Configuring system to use udev ..."
-    @/sbin/start_udev:/sbin/udevstart@
-
-    # udevstart fails sometimes, retry until /dev/zero exists.
-    if [ ! -e /dev/zero ]; then
-	echo "@/sbin/udevstart:/sbin/start_udev@ failed to create standard device files"
-	exit 1
-    fi
-
-    if [ ! -e /dev/MAKEDEV ]
-    then
-	# Create /dev/MAKEDEV
-	if [ -e @/sbin/MAKEDEV@ ]
-	then
-	    @ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV
-	fi
-    fi
-
-fi
-
-
-
-# To be created the udev way
-if [ -e /etc/udev/links.conf ]
-then
-
-    @grep@ '^[^#]' /etc/udev/links.conf | \
-    while read type name arg1; do
-	[ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
-	case "$type" in
-	    L) @ln@ -s $arg1 /dev/$name &;;
-	    D) @mkdir@ -p /dev/$name;;
-	    M) @mknod@ --mode=600 /dev/$name $arg1 &;;
-	    *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
-	esac
-    done
-  
-else
-# Or Manually.
-    #Not provided by sysfs but needed
-    @ln@ -snf /proc/self/fd /dev/fd &
-    @ln@ -snf fd/0 /dev/stdin &
-    @ln@ -snf fd/1 /dev/stdout &
-    @ln@ -snf fd/2 /dev/stderr &
-    @ln@ -snf /proc/kcore /dev/core &
-    @ln@ -snf /proc/asound/oss/sndstat /dev/sndstat &
-fi
-
-
-# Same thing as /dev/.devfsd
- at touch@ /dev/.udev &
-
-echo "Mounting devpts at /dev/pts ..."
- at mkdir@ -p /dev/pts && @mount@ -n -t devpts -o gid=5,mode=0620 none /dev/pts &
-
-echo "Mounting devshm at /dev/shm ..."
- at mkdir@ -p /dev/shm && @mount@ -n -t tmpfs none /dev/shm &
-
-wait
-exit 0
-};
+	need = system/initial/mountvirtfs system/initial/udevd;
+	critical;
+	script start = {
+
+		umask 022
+		set -e    
+		
+		if [ -e /lib/udev/devices ]
+		then
+
+			# Copy over default device tree
+			(cd /lib/udev/devices && find -print0 | cpio --quiet -0pmdu /dev)
+			
+			echo -n "Running @/sbin/udevplug@ .. :"
+			time @/sbin/udevplug@
+			echo "  done"
+		else
+
+			# Check for udevstart.
+			if [ ! -e @/sbin/udevstart:/sbin/start_udev@ ]
+			then 
+				echo "@/sbin/udevstart:/sbin/start_udev@ is missing, cant boot this system!"
+				exit 1
+			fi
+
+			echo "Configuring system to use udev ..."
+			@/sbin/start_udev:/sbin/udevstart@
+
+			# udevstart fails sometimes, retry until /dev/zero exists.
+			if [ ! -e /dev/zero ]
+			then
+				echo "@/sbin/udevstart:/sbin/start_udev@ failed to create standard device files"
+				exit 1
+			fi
+
+			if [ ! -e /dev/MAKEDEV ]
+			then
+				# Create /dev/MAKEDEV
+				if [ -e @/sbin/MAKEDEV@ ]
+				then
+					@ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV
+				fi
+			fi
+
+		fi
+
+
+
+		# To be created the udev way
+		if [ -e /etc/udev/links.conf ]
+		then
+
+			@grep@ '^[^#]' /etc/udev/links.conf | \
+			while read type name arg1
+			do
+				[ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
+				case "$type" in
+					L) @ln@ -s $arg1 /dev/$name &;;
+					D) @mkdir@ -p /dev/$name;;
+					M) @mknod@ --mode=600 /dev/$name $arg1 &;;
+					*) echo "links.conf: unparseable line ($type $name $arg1)" ;;
+				esac
+			done
+		  
+		else
+			# Or Manually.
+			# Not provided by sysfs but needed
+			@ln@ -snf /proc/self/fd /dev/fd &
+			@ln@ -snf fd/0 /dev/stdin &
+			@ln@ -snf fd/1 /dev/stdout &
+			@ln@ -snf fd/2 /dev/stderr &
+			@ln@ -snf /proc/kcore /dev/core &
+			@ln@ -snf /proc/asound/oss/sndstat /dev/sndstat &
+		fi
+
+
+		# Same thing as /dev/.devfsd
+		@touch@ /dev/.udev &
+
+		echo "Mounting devpts at /dev/pts ..."
+		@mkdir@ -p /dev/pts && @mount@ -n -t devpts -o gid=5,mode=0620 none /dev/pts &
+
+		echo "Mounting devshm at /dev/shm ..."
+		@mkdir@ -p /dev/shm && @mount@ -n -t tmpfs none /dev/shm &
+
+		wait
+		exit 0
+	};
 }
 
 service system/initial {
-    need = system/initial/mountvirtfs system/initial/udevd system/initial/filldev;
-    use = system/readahead;
-    critical;
-    script start = {
-
-umask 022
-set -e
-
-# Set the console loglevel to 1 for a cleaner boot
-# the logger should anyhow dump the ring-0 buffer at start to the
-# logs, and that with dmesg can be used to check for problems
-@/bin/dmesg@ -n 1 &
-
-#ifd fedora
-@/sbin/setsysfont@
-#endd
-
-# Setup hotplugging (if possible)
-if [ -e /proc/sys/kernel/hotplug ]
-then
-    if   [ -x @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ ] ; then
-	echo "  Setting @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ as hotplug agent ..."
-	echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@" > /proc/sys/kernel/hotplug	
-    else
-	echo "" > /proc/sys/kernel/hotplug
-    fi
-fi
-
-wait
-exit 0
-};
-
-    script stop = {
-    
-	# Increase the debug level a bit
-	@/sbin/dmesg@ -n 2
-    
-	# Disable hotplug requests
-	echo "" > /proc/sys/kernel/hotplug
-    };
+	need = system/initial/mountvirtfs system/initial/udevd system/initial/filldev;
+	use = system/readahead;
+	critical;
+	script start = {
+
+		umask 022
+		set -e
+
+		# Set the console loglevel to 1 for a cleaner boot
+		# the logger should anyhow dump the ring-0 buffer at start to the
+		# logs, and that with dmesg can be used to check for problems
+		@/bin/dmesg@ -n 1 &
+
+		#ifd fedora
+		@/sbin/setsysfont@
+		#endd
+
+		# Setup hotplugging (if possible)
+		if [ -e /proc/sys/kernel/hotplug ]
+		then
+			if   [ -x @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ ] 
+			then
+				echo "  Setting @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ as hotplug agent ..."
+				echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@" > /proc/sys/kernel/hotplug	
+			else
+				echo "" > /proc/sys/kernel/hotplug
+			fi
+		fi
+
+		wait
+		exit 0
+	};
+
+	script stop = {
+		
+		# Increase the debug level a bit
+		@/sbin/dmesg@ -n 2
+		
+		# Disable hotplug requests
+		echo "" > /proc/sys/kernel/hotplug
+	};
 }


More information about the Initng-svn mailing list