[Initng-svn] r4405 - initng-scripts/trunk/initfiles

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Jun 8 11:17:04 CEST 2006


Author: jimmy
Date: Thu Jun  8 11:17:03 2006
New Revision: 4405

Modified:
   initng-scripts/trunk/initfiles/bootmisc.s
   initng-scripts/trunk/initfiles/checkfs.s
   initng-scripts/trunk/initfiles/clock.s
   initng-scripts/trunk/initfiles/getty.s
   initng-scripts/trunk/initfiles/initial.s
   initng-scripts/trunk/initfiles/modules.s
   initng-scripts/trunk/initfiles/mountfs.s
   initng-scripts/trunk/initfiles/mountroot.s
   initng-scripts/trunk/initfiles/udev.s

Log:
Update sources from real .ii files.


Modified: initng-scripts/trunk/initfiles/bootmisc.s
==============================================================================
--- initng-scripts/trunk/initfiles/bootmisc.s	(original)
+++ initng-scripts/trunk/initfiles/bootmisc.s	Thu Jun  8 11:17:03 2006
@@ -1,5 +1,9 @@
 #!/sbin/runiscript
 
+#ifd gentoo
+source /etc/conf.d/bootmisc;
+#endd
+
 setup()
 {
 	# register new service type, the $SERVICE will be "example" here.
@@ -16,41 +20,55 @@
 
 start()
 {
+#ifd gentoo
+		[ "${DELAYLOGIN}" = "yes" ] && \
+			echo "System bootup in progress - please wait" > /etc/nologin && \
+			@cp@ /etc/nologin /etc/nologin.boot 2>&1 >/dev/null &
+
+		if [ -x @/sbin/env-update.sh@ ]
+		then
+			if [ /etc/env.d -nt /etc/profile.env ]
+			then
+				echo "Updating environment ..."
+				@/sbin/env-update.sh@ -u >/dev/null &
+			fi
+		fi
+#endd
 		# Setup login records
 		echo -n "" > /var/run/utmp
-		/usr/bin/touch /var/log/wtmp >/dev/null 2>&1
-		/bin/chgrp utmp /var/run/utmp /var/log/wtmp >/dev/null 2>&1
-		/bin/chmod 0664 /var/run/utmp /var/log/wtmp >/dev/null 2>&1
+		@touch@ /var/log/wtmp >/dev/null 2>&1
+		@chgrp@ utmp /var/run/utmp /var/log/wtmp >/dev/null 2>&1
+		@chmod@ 0664 /var/run/utmp /var/log/wtmp >/dev/null 2>&1
 		# Remove /var/run/utmpx (bug from the past)
-		/bin/rm -f /var/run/utmpx >/dev/null 2>&1
+		@rm@ -f /var/run/utmpx >/dev/null 2>&1
 
 		#
 		# Clean up /tmp directory
 		#
-		/bin/rm -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* 2>&1 >/dev/null &
-		/bin/rm -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* 2>&1 >/dev/null &
+		@rm@ -f /tmp/.X*-lock /tmp/esrv* /tmp/kio* /tmp/jpsock.* /tmp/.fam* 2>&1 >/dev/null &
+		@rm@ -rf /tmp/.esd* /tmp/orbit-* /tmp/ssh-* /tmp/ksocket-* 2>&1 >/dev/null &
 		# Make sure our X11 stuff have the correct permissions
-		/bin/rm -rf /tmp/.*-unix
-		/bin/mkdir -p /tmp/.ICE-unix /tmp/.X11-unix
-		/bin/chmod 1777 /tmp/.???-unix 2>&1 >/dev/null &
+		@rm@ -rf /tmp/.*-unix
+		@mkdir@ -p /tmp/.ICE-unix /tmp/.X11-unix
+		@chmod@ 1777 /tmp/.???-unix 2>&1 >/dev/null &
 
 		#
 		# Clean up /var/lock and /var/run
 		#
-		/usr/bin/find /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed -exec /bin/rm \{\} \;
-		/usr/bin/find /var/lock -type f -exec /bin/rm \{\} \;
+		@find@ /var/run/ ! -type d ! -name utmp ! -name innd.pid ! -name random-seed -exec @rm@ \{\} \;
+		@find@ /var/lock -type f -exec @rm@ \{\} \;
 
 		#
 		# Create an 'after-boot' dmesg log
 		#
-		/usr/bin/touch /var/log/dmesg >/dev/null &
-		/bin/chmod 640 /var/log/dmesg >/dev/null &
-		/bin/dmesg >/var/log/dmesg &
+		@touch@ /var/log/dmesg >/dev/null &
+		@chmod@ 640 /var/log/dmesg >/dev/null &
+		@dmesg@ >/var/log/dmesg &
 
 		#
 		# Check for /etc/resolv.conf, and create if missing
 		#
-		[ -f /etc/resolv.conf ] || /usr/bin/touch /etc/resolv.conf 2>&1 >/dev/null &
+		[ -f /etc/resolv.conf ] || @touch@ /etc/resolv.conf 2>&1 >/dev/null &
 
 		wait
 		exit 0

Modified: initng-scripts/trunk/initfiles/checkfs.s
==============================================================================
--- initng-scripts/trunk/initfiles/checkfs.s	(original)
+++ initng-scripts/trunk/initfiles/checkfs.s	Thu Jun  8 11:17:03 2006
@@ -1,7 +1,9 @@
 #!/sbin/runiscript
 
+#ifd debian
 source /etc/default/rcS
 FSCK_LOGFILE=/var/log/fsck/checkfs
+#endd
 
 setup()
 {
@@ -13,8 +15,11 @@
     idone
 }
 
+
+
 start()
 {
+#ifd debian
 		handle_failed_fsck() {
 			echo "File system check failed."
 			echo "A log is being saved in ${FSCK_LOGFILE} if that location is writable. Please repair the file system manually."
@@ -28,9 +33,9 @@
 
 		# See if we're on AC Power
 		# If not, we're not gonna run our check
-		if [ -x "/usr/bin/on_ac_power" ]
+		if [ -x "@on_ac_power@" ]
 		then
-			/usr/bin/on_ac_power >/dev/null 2>&1
+			@on_ac_power@ >/dev/null 2>&1
 			[ ${?} -eq 1 ] && BAT=yes
 		fi
 
@@ -52,7 +57,7 @@
 			if [ "${VERBOSE}" = no ]
 			then
 				echo "Checking file systems"
-				/sbin/logsave -s ${FSCK_LOGFILE} /sbin/fsck ${spinner} -T -R -A ${fix} ${force} ${FSCKTYPES_OPT}
+				@logsave@ -s ${FSCK_LOGFILE} @fsck@ ${spinner} -T -R -A ${fix} ${force} ${FSCKTYPES_OPT}
 				FSCKCODE=${?}
 				if [ ${FSCKCODE} -gt 1 ]
 				then
@@ -66,7 +71,7 @@
 				else
 					echo "Will now check all file systems"
 				fi
-				/sbin/logsave -s ${FSCK_LOGFILE} /sbin/fsck ${spinner} -V -R -A ${fix} ${force} ${FSCKTYPES_OPT}
+				@logsave@ -s ${FSCK_LOGFILE} @fsck@ ${spinner} -V -R -A ${fix} ${force} ${FSCKTYPES_OPT}
 				FSCKCODE=${?}
 				if [ ${FSCKCODE} -gt 1 ]
 				then
@@ -78,7 +83,22 @@
 			fi
 		fi
 
-		/bin/rm -f /fastboot /forcefsck
+		@rm@ -f /fastboot /forcefsck
+#elsed
+		if [ -f /fastboot ]
+		then
+			@rm@ -f /fastboot
+		else
+			if [ -f /forcefsck ]
+			then
+				echo "A full fsck has been forced"
+				@logsave@ /dev/null @fsck@ -C -R -A -a -f || echo "fsck error: ${?}" >&2
+				@rm@ -f /forcefsck
+			else
+				@logsave@ /dev/null @fsck@ -C -T -R -A -a || echo "fsck error: ${?}" >&2
+			fi
+		fi
+#endd
 
 		exit 0
 }

Modified: initng-scripts/trunk/initfiles/clock.s
==============================================================================
--- initng-scripts/trunk/initfiles/clock.s	(original)
+++ initng-scripts/trunk/initfiles/clock.s	Thu Jun  8 11:17:03 2006
@@ -1,6 +1,13 @@
 #!/sbin/runiscript
 
-source /etc/default/rcS
+
+#ifd debian linspire
+source /etc/default/rcS;
+#elsed fedora
+source /etc/sysconf/clock;
+#elsed
+source /etc/conf.d/clock;
+#endd
 
 setup()
 {
@@ -21,12 +28,17 @@
 start()
 {
 		setupopts() {
-			if /bin/grep -q ' cobd$' /proc/devices 
+			if @grep@ -q ' cobd$' /proc/devices 
 			then
 				TBLURB="coLinux"
 				return 0
+#ifd debian linspire
 			elif [ "${UTC}" = "yes" ]
 			then
+#elsed
+			elif [ "${CLOCK}" = "UTC" -o "${UTC}" = "true" ]
+			then
+#endd
 				myopts="--utc"
 				TBLURB="UTC"
 			else
@@ -52,7 +64,7 @@
 			myopts="${myopts} ${CLOCK_OPTS}"
 
 		# Make sure user isn't using rc.conf anymore.
-			if /bin/grep -qs ^CLOCK= /etc/rc.conf
+			if @grep@ -qs ^CLOCK= /etc/rc.conf
 			then
 				echo "CLOCK should not be set in /etc/rc.conf but in /etc/conf.d/clock"
 			fi
@@ -78,23 +90,28 @@
 		if [ "${TBLURB}" = "UML" -o "${TBLURB}" = "coLinux" ]
 		then
 			true
-		elif [ -x /sbin/hwclock ]
+		elif [ -x @/sbin/hwclock@ ]
 		then
 			# Since hwclock always exit's with a 0, need to check its output.
-			/sbin/hwclock ${myadj} ${myopts}
-			/sbin/hwclock --hctosys ${myopts}
+			@/sbin/hwclock@ ${myadj} ${myopts}
+			@/sbin/hwclock@ --hctosys ${myopts}
 		fi
 }
 
 stop()
 {
 		setupopts() {
-			if /bin/grep -q ' cobd$' /proc/devices
+			if @grep@ -q ' cobd$' /proc/devices
 			then
 				TBLURB="coLinux"
 				return 0
+#ifd debian linspire
 			elif [ "${UTC}" = "yes" ]
 			then
+#elsed
+			elif [ "${CLOCK}" = "UTC" -o "${UTC}" = "true" ]
+			then
+#endd
 				myopts="--utc"
 				TBLURB="UTC"
 			else
@@ -120,7 +137,7 @@
 			myopts="${myopts} ${CLOCK_OPTS}"
 
 			# Make sure user isn't using rc.conf anymore.
-			if /bin/grep -qs ^CLOCK= /etc/rc.conf
+			if @grep@ -qs ^CLOCK= /etc/rc.conf
 			then
 				echo "CLOCK should not be set in /etc/rc.conf but in /etc/conf.d/clock"
 			fi
@@ -138,9 +155,9 @@
 		if [ "${CLOCK}" = "UML" ]
 		then
 			true
-		elif [ -x /sbin/hwclock ]
+		elif [ -x @/sbin/hwclock@ ]
 		then
-			/sbin/hwclock --systohc ${myopts}
+			@/sbin/hwclock@ --systohc ${myopts}
 
 			if [ -n "${errstr}" ]
 			then

Modified: initng-scripts/trunk/initfiles/getty.s
==============================================================================
--- initng-scripts/trunk/initfiles/getty.s	(original)
+++ initng-scripts/trunk/initfiles/getty.s	Thu Jun  8 11:17:03 2006
@@ -20,7 +20,7 @@
 	iregister daemon
 	iset need = initial bootmisc
 	iset term_timeout = 3
-	iset exec daemon = "/sbin/getty 38400 $NAME"
+	iset exec daemon = "@/sbin/getty@ 38400 $NAME"
 	iset respawn
 	idone
 }

Modified: initng-scripts/trunk/initfiles/initial.s
==============================================================================
--- initng-scripts/trunk/initfiles/initial.s	(original)
+++ initng-scripts/trunk/initfiles/initial.s	Thu Jun  8 11:17:03 2006
@@ -42,12 +42,12 @@
 		then
 			echo "The dir \"${dir}\" is missing, cant mount it!" >&2
 			echo "Please sulogin, remount rw and create them." >&2
-			exit 1 # It can't work. Critical!
+			exit 1 # It cant work. Critical!
 		fi
 	done
 
-	mount -n -t proc proc /proc &
-	mount -n -t sysfs sys /sys &
+	@mount@ -n -t proc proc /proc &
+	@mount@ -n -t sysfs sys /sys &
 
 	wait
 	exit 0
@@ -56,15 +56,15 @@
 filldev_start()
 {
 	echo "Mounting devpts at /dev/pts ..."
-	/bin/mkdir -p /dev/pts && /bin/mount -n -t devpts -o gid=5,mode=0620 none /dev/pts &
+	@/bin/mkdir@ -p /dev/pts && @/bin/mount@ -n -t devpts -o gid=5,mode=0620 none /dev/pts &
 
 	echo "Mounting devshm at /dev/shm ..."
-	/bin/mkdir -p /dev/shm && /bin/mount -n -t tmpfs none /dev/shm &
+	@/bin/mkdir@ -p /dev/shm && @/bin/mount@ -n -t tmpfs none /dev/shm &
 
 	# who needs this? only user, who needs this.
 	# so i think, we should make this link, if somebody needs this.
 	[ ! -e /dev/MAKEDEV -a /sbin/MAKEDEV ] && \
-		/bin/ln -fs /sbin/MAKEDEV /dev/MAKEDEV &
+		@/bin/ln@ -fs /sbin/MAKEDEV /dev/MAKEDEV &
 
 	wait
 	exit 0

Modified: initng-scripts/trunk/initfiles/modules.s
==============================================================================
--- initng-scripts/trunk/initfiles/modules.s	(original)
+++ initng-scripts/trunk/initfiles/modules.s	Thu Jun  8 11:17:03 2006
@@ -45,14 +45,18 @@
 
 		# Here we should fail, as a modular kernel do need
 		# depmod command ...
-		if [ ! -e /lib/modules/`/bin/uname -r`/modules.dep ]
+		if [ ! -e /lib/modules/`@uname@ -r`/modules.dep ]
 		then
-			if [ ! -x /sbin/depmod ]
+			if [ ! -x @/sbin/depmod@ ]
 			then
-				echo "ERROR:  system is missing /sbin/depmod !"
+				echo "ERROR:  system is missing @/sbin/depmod@ !"
 				exit 1
 			fi
-			/sbin/depmod
+#ifdist gentoo
+			@/sbin/modules-update@
+#elsed
+			@/sbin/depmod@
+#endd
 			exit 0
 		else
 			echo "Found modules.dep, skipping depmod ..."
@@ -64,22 +68,28 @@
 		if [ /etc/modules.d -nt /etc/modules.conf ]
 		then
 			echo "Calculating module dependencies ..."
-			if [ ! -x /sbin/depmod ]
+			if [ ! -x @/sbin/depmod@ ]
 			then
-				echo "ERROR:  system is missing /sbin/depmod !"
+				echo "ERROR:  system is missing @/sbin/depmod@ !"
 				exit 1
 			fi
-			/sbin/depmod
+#ifdist gentoo
+			@/sbin/modules-update@
+#elsed
+			@/sbin/depmod@
+#endd
 			exit 0
 		else
 			echo "Module dependencies up to date ..."
 		fi
 
+#ifd debian
 		wait
-		if [ -x /sbin/lrm-manager ]
+		if [ -x @/sbin/lrm-manager@ ]
 		then
-			/sbin/lrm-manager --quick
+			@/sbin/lrm-manager@ --quick
 		fi
+#endd
 		wait
 		exit 0
 }
@@ -88,33 +98,33 @@
 
 mod_load()
 {
-	/sbin/modprobe ${NAME} || true
+	@/sbin/modprobe@ ${NAME} || true
 }
 
 mod_unload()
 {
-	/sbin/modprobe -r ${NAME} || true
+	@/sbin/modprobe@ -r ${NAME} || true
 }
 
 modules_start()
 {
 		load_modules() {
 			[ -r "${1}" ] || return 1
-			/bin/grep -v "^#" "${1}" | /bin/grep -v "^$" | while read MODULE MODARGS
+			@grep@ -v "^#" "${1}" | @grep@ -v "^$" | while read MODULE MODARGS
 			do
 				echo "Loading module \"${MODULE}\" ..."
-				/sbin/modprobe -q ${MODULE} ${MODARGS}
+				@/sbin/modprobe@ -q ${MODULE} ${MODARGS}
 			done
 		}
 		# GENTOO: Don't probe kernel version, initng, requires 2.6 anyway
 		load_modules /etc/modules.autoload.d/kernel-2.6
 		load_modules /etc/modules
-		if [ -n "`/sbin/modprobe -l -t boot \*`" ]
+		if [ -n "`@/sbin/modprobe@ -l -t boot \*`" ]
 		then	
 			echo "Loading of modules in /lib/modules/boot is broken!"
 			# Don't add -l here - it suppresses the error message,
 			# but it also prevents the modules from being loaded
-			/sbin/modprobe -a -t boot \*
+			@/sbin/modprobe@ -a -t boot \*
 		fi
 		exit 0  # Bad things happen if we fail
 }

Modified: initng-scripts/trunk/initfiles/mountfs.s
==============================================================================
--- initng-scripts/trunk/initfiles/mountfs.s	(original)
+++ initng-scripts/trunk/initfiles/mountfs.s	Thu Jun  8 11:17:03 2006
@@ -16,29 +16,36 @@
 
 start()
 {
+#ifd debian
 		echo "Mounting local filesystems"
-		/bin/mount -a -t proc >/dev/null 2>&1
+		@mount@ -a -t proc >/dev/null 2>&1
 		# Ignore error message due to /proc already being mounted
 		ES_TO_REPORT=${?}
-		/bin/mount -a -v -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
+		@mount@ -a -v -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
 		ES=${?}
 		ES_TO_REPORT=$((${ES_TO_REPORT} | ${ES}))
 		[ 0 != ${ES_TO_REPORT} ] && echo "code ${ES_TO_REPORT}"
+#elsed
+		@awk@ 'NF && $1!~/^#/ && $2!="/" && $3~/reiserfs|reiser4|ext2|ext3|xfs|jfs|vfat|ntfs|tmpfs|subfs|bind/ && $4!~/(^|,)noauto(,|$)/ {print $2}' /etc/fstab | @sort@ | while read mp
+		do
+			@mount@ "${mp}" || echo "WARNING, failed to mount ${mp}"
+		done
+#endd
 		exit 0
 }
 
 stop()
 {
-		echo "Sending all processes the kill signal ..."
-		/sbin/killalli5 -15
-		sleep 2
-		echo "Sending all processes the term signal ..."
-		/sbin/killalli5 -9
+		echo "Sending all processes the TERM signal ..."
+		@killalli5:killall5@ -15
+		sleep 3
+		echo "Sending all processes the KILL signal ..."
+		@killalli5:killall5@ -9
 		sleep 1
 
-		/usr/bin/awk 'NF && $1!~/^#/ && $2!~/^\/(|proc|sys|dev)$/ {print $2}' /etc/mtab | /usr/bin/sort -r | while read mp
+		@awk@ 'NF && $1!~/^#/ && $2!~/^\/(|proc|sys|dev)$/ {print $2}' /etc/mtab | @sort@ -r | while read mp
 		do
-			/bin/umount "${mp}" || echo "WARNING, failed to umount ${mp}"
+			@umount@ "${mp}" || echo "WARNING, failed to umount ${mp}"
 		done
 		exit 0
 }

Modified: initng-scripts/trunk/initfiles/mountroot.s
==============================================================================
--- initng-scripts/trunk/initfiles/mountroot.s	(original)
+++ initng-scripts/trunk/initfiles/mountroot.s	Thu Jun  8 11:17:03 2006
@@ -31,8 +31,8 @@
 	iset -s mountroot/rootrw never_kill
 
 	# execute targets:
-	iset -s mountroot/dmsetup exec start = "/sbin/dmsetup mknodes"
-	iset -s mountroot/evms exec start = "/sbin/evms_activate"
+	iset -s mountroot/dmsetup exec start = "@/sbin/dmsetup@ mknodes"
+	iset -s mountroot/evms exec start = "@/sbin/evms_activate@"
 	iexec -s mountroot/lvm start = lvm_start
 	iexec -s mountroot/check start = check_start
 	iexec -s mountroot/rootrw start = rootrw_start
@@ -50,16 +50,16 @@
 
 lvm_start()
 {
-		/bin/mknod --mode=600 /dev/lvm c 109 0
+		@mknod@ --mode=600 /dev/lvm c 109 0
 		if [ ! -f /dev/.devfsd ]
 		then
-			major=`/bin/grep "[0-9] misc$" /proc/devices | /bin/sed 's/[ ]\+misc//'`
-			minor=`/bin/grep "[0-9] device-mapper$" /proc/misc | /bin/sed 's/[ ]\+device-mapper//'`
-			[ -d ${dm_dir} ] || /bin/mkdir --mode=755 ${dm_dir}
-			[ -c ${dm_file} -o -z "${major}" -o -z "${minor}" ] || /bin/mknod --mode=600 ${dm_file} c ${major} ${minor}
+			major=`@grep@ "[0-9] misc$" /proc/devices | @sed@ 's/[ ]\+misc//'`
+			minor=`@grep@ "[0-9] device-mapper$" /proc/misc | @sed@ 's/[ ]\+device-mapper//'`
+			[ -d ${dm_dir} ] || @mkdir@ --mode=755 ${dm_dir}
+			[ -c ${dm_file} -o -z "${major}" -o -z "${minor}" ] || @mknod@ --mode=600 ${dm_file} c ${major} ${minor}
 		fi
-		/sbin/vgscan --ignorelockingfailure --mknodes
-		/sbin/vgchange --ignorelockingfailure -a y
+		@vgscan@ --ignorelockingfailure --mknodes
+		@vgchange@ --ignorelockingfailure -a y
 }
 
 check_start()
@@ -70,8 +70,8 @@
 			if [ -f /forcefsck ]
 			then
 				echo "Checking root filesystem (full fsck forced)"
-				/bin/mount -n -o remount,ro /
-				/sbin/logsave /dev/null /sbin/fsck -C -a -f /
+				@mount@ -n -o remount,ro /
+				@logsave@ /dev/null @fsck@ -C -a -f /
 				# /forcefsck isn't deleted because system/mountfs need it.
 				# it'll be deleted in that script.
 				retval=${?}
@@ -85,14 +85,14 @@
 				# d="${s}${s}*"
 				# S="[^ ${t}]"
 				# D="${S}${S}*"
-				# /bin/sed -ne "'/^#/!s/^$s*$D$d\/$d$D$d$D$d$D$d\($D\)$s/\1/p'" /etc/fstab
+				# @sed@ -ne "'/^#/!s/^$s*$D$d\/$d$D$d$D$d$D$d\($D\)$s/\1/p'" /etc/fstab
 
 				# DON'T STORE sort, awk, uniq .... ON AN OTHER PARTITION!!!
-				if ! /usr/bin/awk '$1!~/^#/ && $2=="/" {exit $6}' /etc/fstab
+				if ! @awk@ '$1!~/^#/ && $2=="/" {exit $6}' /etc/fstab
 				then
 					echo "Checking root filesystem ..."
-					/bin/mount -n -o remount,ro /
-					/sbin/logsave /dev/null /sbin/fsck -C -T -a /
+					@mount@ -n -o remount,ro /
+					@logsave@ /dev/null @fsck@ -C -T -a /
 					retval=${?}
 				else
 					echo "Skipping root filesystem check (fstab's passno == 0) ..."
@@ -121,9 +121,9 @@
 					exit 1
 				elif [ "${retval}" -gt 1 ]
 				then
-					error "The file system check corrected errors on the root partition 
+					echo "The file system check corrected errors on the root partition 
 						but requested that the system be restarted."
-					error "The system will be restarted in 5 seconds."
+					echo "The system will be restarted in 5 seconds."
 					sleep 5
 					echo "Will now restart"
 					ngc -6
@@ -135,10 +135,16 @@
 
 rootrw_start()
 {
-		if /bin/mount -vf -o remount / | /bin/grep "\(.*rw.*\)"
+		if @mount@ -vf -o remount / | @grep@ "\(.*rw.*\)"
 		then
-			/bin/mount -n -o remount,rw / >/dev/null 2>&1
+			@mount@ -n -o remount,rw / >/dev/null 2>&1
+#ifd pingwinek
+			# code 32 means 'not implemented', we got it on livecd using
+			# unionfs combined with squashfs
+			if [ ${?} -ne 0 -a ${?} -ne 32 ]
+#elsed
 			if [ ${?} -ne 0 ]
+#endd
 				then
 				echo "Root filesystem could not be mounted read/write :("
 				exit 1
@@ -149,43 +155,43 @@
 rootrw_stop()
 {
 		echo "Unmounting all non-unmounted submounts ..."
-		/usr/bin/awk 'NF && $1!~/^#/ && $2!~/^\/(|proc|sys|dev)$/ {print $2}' /proc/mounts | while read mp
+		@awk@ 'NF && $1!~/^#/ && $2!~/^\/(|proc|sys|dev)$/ {print $2}' /proc/mounts | while read mp
 		do
 			echo "Unmounting: ${mp}"
-			/bin/umount -rdf ${mp}
+			@umount@ -rdf ${mp}
 		done
 
-		/bin/mount -n -o remount,ro /
-		/bin/sync
+		@mount@ -n -o remount,ro /
+		@sync@
 		exit 0
 }
 
 mountroot_start()
 {
-		/bin/rm /etc/mtab
+		@rm@ /etc/mtab
 		if ! /bin/echo -n "" >> /etc/mtab
 		then
 			echo "Skipping /etc/mtab initialization (ro root?)"
 			exit 0
 		fi
 		# Add the entry for / to mtab
-		/bin/mount -f /
+		@mount@ -f /
 
 		# Don't list root more than once
-		/bin/grep -v " / " /proc/mounts >>/etc/mtab
+		@grep@ -v " / " /proc/mounts >>/etc/mtab
 		# Now make sure /etc/mtab have additional info (gid, etc) in there
 
 		# debian doesn't based on GNU, so we must do it a little different.
 		# without GNU-tools, like uniq, sort or awk. i hope sed supports extended
 		# regexp on debian. because it isn't posix-conform.
-		/usr/bin/awk 'NF && $1!~/^#/ {print $2}' /etc/fstab /etc/mtab | /usr/bin/sort | /usr/bin/uniq -d | while read mp
+		@awk@ 'NF && $1!~/^#/ {print $2}' /etc/fstab /etc/mtab | @sort@ | @uniq@ -d | while read mp
 		do
 			echo "Mounting ${mp} rw ..."
-			/bin/mount -f -o remount "${mp}"
+			@mount@ -f -o remount "${mp}"
 		done
 
 		# Remove stale backups
-		/bin/rm -f /etc/mtab~ /etc/mtab~~
+		@rm@ -f /etc/mtab~ /etc/mtab~~
 		# Return Happily., or sulogin will be executed.
 		exit 0
 }

Modified: initng-scripts/trunk/initfiles/udev.s
==============================================================================
--- initng-scripts/trunk/initfiles/udev.s	(original)
+++ initng-scripts/trunk/initfiles/udev.s	Thu Jun  8 11:17:03 2006
@@ -25,7 +25,7 @@
 	iset -s udev/udevd respawn
 	iset -s udev/udevd pid_of = "udevd"
 	iset -s udev/udevd forks;
-	iset -s udev/udevd exec daemon = "/sbin/udevd --daemon"
+	iset -s udev/udevd exec daemon = "@/sbin/udevd@ --daemon"
 	
 	
 	# Add execution in this local script
@@ -33,7 +33,10 @@
 	iexec -s udev/set_hotplug start = set_hotplug_start
 	iexec -s udev/set_hotplug stop = hotplug_stop
 	iexec -s udev/filldev start = fill_udev_start
-	
+#ifd gentoo
+	iexec -s udev/filldev stop = fill_udev_stop
+#endd
+
 	# Tell initng this service is done parsing.
     idone
 	idone -s udev/udevd
@@ -50,39 +53,43 @@
 		}
 
 		[ -e /proc/filesystems ] || error "udev requires a mounted procfs, not started."
-		/bin/grep -q '[[:space:]]tmpfs$' /proc/filesystems || error "udev requires tmpfs support, not started."
+		@grep@ -q '[[:space:]]tmpfs$' /proc/filesystems || error "udev requires tmpfs support, not started."
 		[ -d /sys/block ] || error "udev requires a mounted sysfs, not started."
 
 		# THIS service doesn't need this: (I'll remove it 12.1.) (deac)
 		# [ -e /proc/sys/kernel/hotplug ] || error "udev requires hotplug support, not started."
 
 		# mount a tmpfs over /dev, if somebody did not already do it
-		/bin/grep -Eq "^[^[:space:]]+[[:space:]]+/dev[[:space:]]+tmpfs[[:space:]]+" /proc/mounts && exit 0
+		@grep@ -Eq "^[^[:space:]]+[[:space:]]+/dev[[:space:]]+tmpfs[[:space:]]+" /proc/mounts && exit 0
 
+#ifd debian ubuntu
 		# /dev/.static/dev is used by MAKEDEV to access the real /dev directory.
 		# /etc/udev is recycled as a temporary mount point because it's the only
 		# directory which is guaranteed to be available.
-		/bin/mount -n --bind /dev /etc/udev
-		if ! /bin/mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs udev /dev
+		@mount@ -n --bind /dev /etc/udev
+#endd
+		if ! @mount@ -n -o size=$tmpfs_size,mode=0755 -t tmpfs udev /dev
 		then
-			/bin/umount -n /etc/udev
+			@umount@ -n /etc/udev
 			error "udev in /dev his own filesystem (tmpfs), not started."
 		fi
-		/bin/mkdir -p /dev/.static/dev
-		/bin/chmod 700 /dev/.static/
-		/bin/mount -n --move /etc/udev /dev/.static/dev
+#ifd debian ubuntu
+		@mkdir@ -p /dev/.static/dev
+		@chmod@ 700 /dev/.static/
+		@mount@ -n --move /etc/udev /dev/.static/dev
+#endd
 
 		# Make some default static onces, so we are sure they will exist.
-		/bin/mknod -m0666 /dev/null c 1 3
-		/bin/mknod -m0666 /dev/zero c 1 5
-		/bin/mknod /dev/console c 5 1
+		@mknod@ -m0666 /dev/null c 1 3
+		@mknod@ -m0666 /dev/zero c 1 5
+		@mknod@ /dev/console c 5 1
 
 		# Send SIGHUP to initng, will reopen /dev/initctl and /dev/initng.
 		# we can't assume that initng has pid 1, e.g. when booting from initrd
-		/bin/kill -SIGHUP `pidof initng`
+		@kill@ -SIGHUP `pidof initng`
 		
 		# Why? it's already mounted! (i'll remove it at 12.1., if no reason (deac))
-		# [ -d /proc/1 ] || /bin/mount -n /proc
+		# [ -d /proc/1 ] || @mount@ -n /proc
 		exit 0
 }
 
@@ -91,7 +98,7 @@
 		# Make sure hotplug is not missing. The reason, because initng starts sulogin.
 		[ -e /proc/sys/kernel/hotplug ] || echo "/proc/sys/kernel/hotplug is missing!"
 
-		unamer=$(uname -r | /bin/sed -e '{ s/^[0-9][0-9]*\.[0-9][0-9]*\.//; s/[\.-].*// }')
+		unamer=$(uname -r | @/bin/sed@ -e '{ s/^[0-9][0-9]*\.[0-9][0-9]*\.//; s/[\.-].*// }')
 		if [ "${unamer}" -ge 15 ]
 		then
 			# #425: Kernels >= 2.6.15 can directly read udev events via a netlink
@@ -99,7 +106,7 @@
 			echo ""
 		else
 			# Setup hotplugging (if possible), if it can't it exits with error.
-			echo "/sbin/udevsend"
+			echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@"
 		fi >/proc/sys/kernel/hotplug
 }
 
@@ -111,41 +118,64 @@
 
 fill_udev_start()
 {
+#ifd gentoo
+		source /etc/conf.d/rc
+		if [ "${RC_DEVICE_TARBALL}" = "yes" -a -e /lib/udev-state/devices.tar.bz2 ]
+		then
+			cd /dev
+			@/bin/tar@ -xjf /lib/udev-state/devices.tar.bz2
+		fi
+#elsed
 # debian
 		if [ -e /etc/udev/links.conf ]
 		then
-			/bin/grep '^[^#]' /etc/udev/links.conf | \
+			@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) /bin/ln -snf ${arg1} /dev/${name} & ;;
-					D) /bin/mkdir -p /dev/${name} ;;
-					M) /bin/mknod --mode=600 /dev/${name} ${arg1} &;;
+					L) @/bin/ln@ -snf ${arg1} /dev/${name} & ;;
+					D) @/bin/mkdir@ -p /dev/${name} ;;
+					M) @/bin/mknod@ --mode=600 /dev/${name} ${arg1} &;;
 					*) echo "/etc/udev/links.conf: unparseable line (${type} ${name} ${arg1})" ;;
 				esac
 			done
 		fi
+#endd
 		# A complete dir to copy
 		if [ -d /lib/udev/devices ]
 		then
 			# Copy over default device tree
 			{
 				cd /lib/udev/devices &&
-				#/usr/bin/find -print0 | /bin/cpio --quiet -0pmdu /dev
+				#@find@ -print0 | @cpio@ --quiet -0pmdu /dev
 				tar c . | tar x --directory=/dev/
 			} &
 		fi
-
+#ifd fedora
+		#Don't know why, but this seems to be needed on Fedora...
+		@/bin/ln@ -snf /proc/self/fd /dev/fd
+#endd
+
+#ifd gentoo
+		# No-one else creates these; we need to do it manually
+		@/bin/ln@ -snf /proc/self/fd /dev/fd
+		@/bin/ln@ -snf fd/0 /dev/stdin
+		@/bin/ln@ -snf fd/1 /dev/stdout
+		@/bin/ln@ -snf fd/2 /dev/stderr
+		@/bin/ln@ -snf /proc/kcore /dev/core
+		@/bin/ln@ -snf /proc/asound/oss/sndstat /dev/sndstat
+		exec @/sbin/udevstart@
+#elsed
 		if [ ! -e /etc/udev/links.conf -a ! -d /lib/udev/devices ]
 		then
 			# Some manually, youst to be sure.
-			/bin/ln -snf /proc/self/fd /dev/fd &
-			/bin/ln -snf fd/0 /dev/stdin &
-			/bin/ln -snf fd/1 /dev/stdout &
-			/bin/ln -snf fd/2 /dev/stderr &
-			/bin/ln -snf /proc/kcore /dev/core &
-			/bin/ln -snf /proc/asound/oss/sndstat /dev/sndstat &
+			@/bin/ln@ -snf /proc/self/fd /dev/fd &
+			@/bin/ln@ -snf fd/0 /dev/stdin &
+			@/bin/ln@ -snf fd/1 /dev/stdout &
+			@/bin/ln@ -snf fd/2 /dev/stderr &
+			@/bin/ln@ -snf /proc/kcore /dev/core &
+			@/bin/ln@ -snf /proc/asound/oss/sndstat /dev/sndstat &
 		fi
 
 		# which system provides udevsynthesize? gentoo does not.
@@ -153,27 +183,27 @@
 		# udevtrigger is available since udev 088
 		# udevsettle is available since udev 090
 
-		if [ -x "/sbin/udevtrigger" -a -x "/sbin/udevsettle" ]
+		if [ -x "@/sbin/udevtrigger@" -a -x "@/sbin/udevsettle@" ]
 		then
     			# if this directories are not present /dev will not be updated by udev
-    			/bin/mkdir -p /dev/.udev/db/ /dev/.udev/queue/
+    			@/bin/mkdir@ -p /dev/.udev/db/ /dev/.udev/queue/
 
 			# send hotplug events
-			/sbin/udevtrigger
+			@/sbin/udevtrigger@
 
 			# wait for the udevd childs to finish
-			/sbin/udevsettle --timeout=300
-		elif [ -x "/sbin/udevsynthesize" ]
+			@/sbin/udevsettle@ --timeout=300
+		elif [ -x "@/sbin/udevsynthesize@" ]
 		then
 			# run syntesizers that will make hotplug events for every
 			# devices that is currently in the computer, that will
 			# create all dev files.
 
 			udevd_timeout=300
-			echo "Running /sbin/udevsynthesize to populate /dev ..."
-			/bin/mkdir -p /dev/.udev/db /dev/.udev/queue /dev/.udevdb
+			echo "Running @/sbin/udevsynthesize@ to populate /dev ..."
+			@/bin/mkdir@ -p /dev/.udev/db /dev/.udev/queue /dev/.udevdb
 
-			/sbin/udevsynthesize
+			@/sbin/udevsynthesize@
 
 			# wait for the udevd childs to finish
 			echo "Waiting for /dev to be fully populated ..."
@@ -182,13 +212,13 @@
 				sleep .2
 				udevd_timeout=$((${udevd_timeout}-1))
 			done
-		elif [ -x "/sbin/udevplug" ]
+		elif [ -x "@/sbin/udevplug@" ]
 		then
-			/sbin/udevplug
-		elif [ -x "/sbin/udevstart" ]
+			@/sbin/udevplug@
+		elif [ -x "@/sbin/udevstart@" ]
 		then
 			udevd_timeout=60
-			/sbin/udevstart
+			@/sbin/udevstart@
 
 			# wait for the udevd childs to finish
 			echo "Waiting for /dev to be fully populated ..."
@@ -198,5 +228,19 @@
 				udevd_timeout=$((${udevd_timeout}-1))
 			done
 		fi
+#endd
 		chmod 0666 /dev/null
 }
+
+#ifd gentoo
+fill_udev_stop()
+{
+		source /etc/conf.d/rc
+		if [ "${RC_DEVICE_TARBALL}" = "yes" ]
+		then
+			cd /dev
+			@/bin/tar@ -cjf /lib/udev-state/devices.tar.bz2
+		fi
+		exit 0
+}
+#endd


More information about the Initng-svn mailing list