--- root/etc/rc.sysinit.orig	2008-01-18 20:29:45.000000000 -1000
+++ root/etc/rc.sysinit	2008-01-18 20:31:50.000000000 -1000
@@ -11,6 +11,10 @@
 
 set -m
 
+# For DocoMomo, modprobe has to be done on the target system
+# because the host system might have kernel of different version
+depmod -a
+
 if [ -f /etc/sysconfig/network ]; then
     . /etc/sysconfig/network
 fi
@@ -30,74 +34,6 @@
  
 . /etc/init.d/functions
 
-# Check SELinux status
-selinuxfs="$(fstab_decode_str `LC_ALL=C awk '/ selinuxfs / { print $2 }' /proc/mounts`)"
-SELINUX_STATE=
-if [ -n "$selinuxfs" ] && [ "`cat /proc/self/attr/current`" != "kernel" ]; then
-	if [ -r "$selinuxfs/enforce" ] ; then
-		SELINUX_STATE=`cat "$selinuxfs/enforce"`
-	else
-		# assume enforcing if you can't read it
-		SELINUX_STATE=1
-	fi
-fi
-
-if [ -n "$SELINUX_STATE" -a -x /sbin/restorecon ] && LC_ALL=C fgrep -q " /dev " /proc/mounts ; then
-	/sbin/restorecon  -R /dev 2>/dev/null
-fi
-
-disable_selinux() {
-	echo $"*** Warning -- SELinux is active"
-	echo $"*** Disabling security enforcement for system recovery."
-	echo $"*** Run 'setenforce 1' to reenable."
-	echo "0" > "$selinuxfs/enforce"
-}
-
-relabel_selinux() {
-    if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
-	chvt 1
-    fi
-    # if /sbin/init is not labeled correctly this process is running in the 
-    # wrong context, so a reboot will be required after relabel
-    REBOOTFLAG=`restorecon -v /sbin/init`
-    AUTORELABEL=
-    . /etc/selinux/config
-    if [ "$AUTORELABEL" = "0" ]; then
- 	rm -f  /.autorelabel 
-
- 	echo
-	echo $"*** Warning -- SELinux ${SELINUXTYPE} policy relabel is required. "
- 	echo $"*** /etc/selinux/config indicates you want to manually fix labeling"
- 	echo $"*** problems. Dropping you to a shell; the system will reboot"
- 	echo $"*** when you leave the shell."
- 	echo "0" > $selinuxfs/enforce
- 	sulogin
- 
- 	echo $"Unmounting file systems"
- 	umount -a
- 	mount -n -o remount,ro /
- 	echo $"Automatic reboot in progress."
- 	reboot -f
-    else
- 	echo
- 	echo $"*** Warning -- SELinux ${SELINUXTYPE} policy relabel is required."
- 	echo $"*** Relabeling could take a very long time, depending on file"
- 	echo $"*** system size and speed of hard drives."
- 
- 	echo "0" > $selinuxfs/enforce
- 	/sbin/fixfiles restore > /dev/null 2>&1 
- 	rm -f  /.autorelabel 
- 	if [ ! -z "$REBOOTFLAG" ]; then 
- 	    echo $"Automatic reboot in progress."
- 	    reboot -f
- 	fi
- 	echo $SELINUX_STATE > $selinuxfs/enforce
- 	if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
- 	    chvt 8
- 	fi
-    fi
-}
-
 key_is_random() {
     [ "$1" = "/dev/urandom" -o "$1" = "/dev/hw_random" \
 	-o "$1" = "/dev/random" ]
@@ -213,7 +149,7 @@
 	fi
 	if [ -b "/dev/mapper/$dst" ]; then
 	    if [ "$makeswap" = "yes" ]; then
-		mkswap "/dev/mapper/$dst" 2>/dev/null >/dev/null
+		echo not running mkswap on DocoMomo
 	    fi
 	    if [ "$mke2fs" = "yes" ]; then
 		if mke2fs "/dev/mapper/$dst" 2>/dev/null >/dev/null \
@@ -241,10 +177,6 @@
 echo -en "Momonga"
 [ "$BOOTUP" = "color" ] && echo -en "\\033[0;39m"
 echo " Linux release $REL $CODE"
-if [ "$PROMPT" != "no" ]; then
- echo -en $"\t\tPress 'I' to enter interactive startup."
- echo
-fi
 
 # Set the system clock.
 update_boot_stage RCclock
@@ -336,7 +268,6 @@
 # may have to do this again after mounting
 RHGB_STARTED=0
 mount -n /dev/pts >/dev/null 2>&1
-[ -n "$SELINUX_STATE" ] && restorecon /dev/pts >/dev/null 2>&1
 
 if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
    ( . /etc/sysconfig/i18n 2>/dev/null ; /usr/bin/rhgb )
@@ -403,7 +334,6 @@
 mknod /dev/mapper/control c \
 	$(awk '/ misc$/ { print $1 }' /proc/devices) \
 	$(awk '/ device-mapper$/ { print $1 }' /proc/misc) >/dev/null 2>&1
-[ -n "$SELINUX_STATE" ] && restorecon /dev/mapper /dev/mapper/control >/dev/null 2>&1
 
 if [ -f /etc/crypttab ]; then
     s=$"Starting disk encryption:"
@@ -459,9 +389,7 @@
 		echo $"*** Warning -- the system did not shut down cleanly. "
 		echo $"*** Dropping you to a shell; the system will continue"
 		echo $"*** when you leave the shell."
-		[ -n "$SELINUX_STATE" ] && echo "0" > $selinuxfs/enforce
 		sulogin
-		[ -n "$SELINUX_STATE" ] && echo "1" > $selinuxfs/enforce
 	fi
 	fsckoptions="$AUTOFSCK_OPT $fsckoptions"
 fi
@@ -545,7 +473,6 @@
 				*)
 					;;
 			esac
-			[ -n "$SELINUX_STATE" -a -e "$path" ] && restorecon -R "$path"
 		done
 	done
 
@@ -603,14 +530,12 @@
 
 			for path in $(grep -v "^#" "$file" 2>/dev/null); do
 				mount_state "$path"
-				[ -n "$SELINUX_STATE" -a -e "$path" ] && restorecon -R "$path"
 			done
 		done
 
 		if [ -f "$STATE_MOUNT/files" ] ; then
 			for path in $(grep -v "^#" "$STATE_MOUNT/files" 2>/dev/null); do
 				mount_state "$path"
-				[ -n "$SELINUX_STATE" -a -e "$path" ] && restorecon -R "$path"
 			done
 		fi
 	fi
@@ -664,7 +589,6 @@
 
                 str=$"(Repair filesystem)"
 		PS1="$str \# # "; export PS1
-		[ "$SELINUX_STATE" = "1" ] && disable_selinux
 		sulogin
 
 		echo $"Unmounting file systems"
@@ -701,24 +625,6 @@
 	action $"Checking local filesystem quotas: " /sbin/quotacheck -aRnug
 fi
 
-# Remount the root filesystem read-write.
-update_boot_stage RCmountfs
-state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
-[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
-  action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
-
-# Clean up SELinux labels
-if [ -n "$SELINUX_STATE" ]; then
-   restorecon /etc/mtab /etc/ld.so.cache /etc/blkid/blkid.tab /etc/resolv.conf >/dev/null 2>&1
-fi
-
-# If relabeling, relabel mount points.
-if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then 
-    if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
-	retstorecon $(awk '!/^#/ && $4 !~ /noauto/ { print $2 }' /etc/fstab) >/dev/null 2>&1
-    fi
-fi
-
 # Clear mtab
 (> /etc/mtab) &> /dev/null
 
@@ -726,7 +632,6 @@
 rm -f /etc/mtab~ /etc/mtab~~
 
 # Enter mounted filesystems into /etc/mtab
-mount -f /
 mount -f /proc >/dev/null 2>&1
 mount -f /sys >/dev/null 2>&1
 mount -f /dev/pts >/dev/null 2>&1
@@ -741,18 +646,6 @@
     action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
 fi
 
-# Check to see if a full relabel is needed
-if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then 
-    if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
-	relabel_selinux
-    fi
-else
-    if [ -d /etc/selinux -a "$READONLY" != "yes" ]; then
-        [ -f /.autorelabel ] || touch /.autorelabel
-    fi
-fi
-
-
 # Start the graphical boot, if necessary and not done yet.
 if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$RHGB_STARTED" -eq 0 -a "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
    ( . /etc/sysconfig/i18n 2>/dev/null ; /usr/bin/rhgb )
@@ -852,7 +745,6 @@
 # Reset pam_console permissions
 [ -x /sbin/pam_console_apply ] && /sbin/pam_console_apply -r
 
-{
 # Clean up utmp/wtmp
 > /var/run/utmp
 touch /var/log/wtmp
@@ -866,7 +758,6 @@
 fi
 
 # Clean up various /tmp bits
-[ -n "$SELINUX_STATE" ] && restorecon /tmp
 rm -f /tmp/.X*-lock /tmp/.lock.* /tmp/.gdm_socket /tmp/.s.PGSQL.*
 rm -rf /tmp/.X*-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/hsperfdata_* \
        /tmp/kde-* /tmp/ksocket-* /tmp/mc-* /tmp/mcop-* /tmp/orbit-*  \
@@ -876,26 +767,6 @@
 # Make ICE directory
 mkdir -m 1777 -p /tmp/.ICE-unix >/dev/null 2>&1
 chown root:root /tmp/.ICE-unix
-[ -n "$SELINUX_STATE" ] && restorecon /tmp/.ICE-unix >/dev/null 2>&1
-
-#if [ -x /etc/init.d/diskdump ]; then
-#	/etc/init.d/diskdump swapsavecore
-#fi
-
-# Start up swapping.
-update_boot_stage RCswap
-action $"Enabling /etc/fstab swaps: " swapon -a -e
-if [ "$AUTOSWAP" = "yes" ]; then
-	curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done)
-	swappartitions=`blkid -t TYPE=swap -o device`
-	if [ x"$swappartitions" != x ]; then
-		for partition in $swappartitions ; do
-			[ ! -e $partition ] && continue
-			majmin=$(get_numeric_dev dec $partition)
-			echo $curswap | grep -qw "$majmin" || action $"Enabling local swap partitions: " swapon $partition
-		done
-	fi
-fi
 
 # Set up binfmt_misc
 /bin/mount -t binfmt_misc none /proc/sys/fs/binfmt_misc > /dev/null 2>&1
@@ -922,32 +793,6 @@
   fi
 fi
 
-# Now that we have all of our basic modules loaded and the kernel going,
-# let's dump the syslog ring somewhere so we can find it later
-dmesg -s 131072 > /var/log/dmesg
-
-# create the crash indicator flag to warn on crashes, offer fsck with timeout
-touch /.autofsck &> /dev/null
-
-if [ "$PROMPT" != no ]; then
-    while :; do
-	pid=$(/sbin/pidof getkey)
-	[ -n "$pid" -o -e /var/run/getkey_done ] && break
-	usleep 100000
-    done
-    [ -n "$pid" ] && kill -TERM "$pid" >/dev/null 2>&1
-fi
-} &
-if strstr "$cmdline" confirm ; then
-	touch /var/run/confirm
-fi
-if [ "$PROMPT" != "no" ]; then
-	/sbin/getkey i && touch /var/run/confirm
-	touch /var/run/getkey_done
-fi
-wait
-[ "$PROMPT" != no ] && rm -f /var/run/getkey_done
-
 # Let rhgb know that we're leaving rc.sysinit
 if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
     /usr/bin/rhgb-client --sysinit
