summaryrefslogtreecommitdiff
path: root/source/ap/lxc/scripts/rc.S.orig
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/lxc/scripts/rc.S.orig')
-rw-r--r--source/ap/lxc/scripts/rc.S.orig68
1 files changed, 36 insertions, 32 deletions
diff --git a/source/ap/lxc/scripts/rc.S.orig b/source/ap/lxc/scripts/rc.S.orig
index 78e68e40..4162938f 100644
--- a/source/ap/lxc/scripts/rc.S.orig
+++ b/source/ap/lxc/scripts/rc.S.orig
@@ -73,7 +73,6 @@ if grep -wq cgroup /proc/filesystems ; then
fi
fi
-
# Initialize the Logical Volume Manager.
# This won't start unless we find /etc/lvmtab (LVM1) or
# /etc/lvm/backup/ (LVM2). This is created by /sbin/vgscan, so to
@@ -177,11 +176,6 @@ fi
# Enable swapping:
/sbin/swapon -a 2> /dev/null
-# Start FUSE, if requested:
-if [ -x /etc/rc.d/rc.fuse ]; then
- /etc/rc.d/rc.fuse start
-fi
-
# Set the tick and frequency for the system clock.
# Default values are: TICK=10000 and FREQ=0
TICK=10000
@@ -235,8 +229,13 @@ if [ -r /etc/forcefsck ]; then
FORCEFSCK="-f"
fi
-# Check the root filesystem:
-if [ ! $READWRITE = yes ]; then
+# If we're using F2FS for the root filesystem, don't check it as it doesn't
+# allow checking a read-only filesystem:
+if grep -q ' / f2fs ' /proc/mounts ; then
+ echo "Remounting root device with read-write enabled."
+ /sbin/mount -w -v -n -o remount /
+elif [ ! $READWRITE = yes ]; then
+ # Check the root filesystem:
RETVAL=0
if [ ! -r /etc/fastboot ]; then
echo "Checking root filesystem:"
@@ -275,7 +274,6 @@ if [ ! $READWRITE = yes ]; then
/sbin/umount -a -r
/sbin/mount -n -o remount,ro /
echo "Rebooting system."
- sleep 2
reboot -f
fi
# Remount the root filesystem in read-write mode
@@ -298,22 +296,22 @@ else
echo "to the Linux section in your /etc/lilo.conf and type 'lilo' to reinstall it."
fi # Done checking root filesystem
-
-# Any /etc/mtab that exists here is old, so we start with a new one:
-/bin/rm -f /etc/mtab{,~,.tmp} && /bin/touch /etc/mtab
-
-# Add entry for / to /etc/mtab:
-/sbin/mount -f -w /
-
-# Add /proc, /sys, and /dev/shm mounts to /etc/mtab:
-if [ -d /proc/sys ]; then
- /sbin/mount -f -t proc proc /proc
-fi
-if [ -d /sys/bus ]; then
- /sbin/mount -f -t sysfs sysfs /sys
-fi
-if grep -q '^[^ ]\+ /dev/shm ' /proc/mounts 2> /dev/null ; then
- /sbin/mount -f -t tmpfs tmpfs /dev/shm
+# If /etc/mtab is a symlink (probably to /proc/mounts) then we don't want to mess with it.
+if [ ! -L /etc/mtab -o ! -r /etc/mtab ]; then
+ # /etc/mtab is a file (or doesn't exist), so we'll handle it the old way:
+ # Any /etc/mtab that exists here is old, so we start with a new one:
+ /bin/rm -f /etc/mtab{,~,.tmp} && /bin/touch /etc/mtab
+ # Add /, /proc, /sys, and /dev/shm mounts to /etc/mtab:
+ /sbin/mount -f -w /
+ if [ -d /proc/sys ]; then
+ /sbin/mount -f -t proc proc /proc
+ fi
+ if [ -d /sys/bus ]; then
+ /sbin/mount -f -t sysfs sysfs /sys
+ fi
+ if grep -q '^[^ ]\+ /dev/shm ' /proc/mounts 2> /dev/null ; then
+ /sbin/mount -f -t tmpfs tmpfs /dev/shm
+ fi
fi
# Configure ISA Plug-and-Play devices:
@@ -359,17 +357,14 @@ fi
# because those have already been mounted. Also check that
# devpts is not already mounted before attempting to mount
# it. With a 2.6.x or newer kernel udev mounts devpts.
-# We also need to wait a little bit to let USB and other
-# hotplugged devices settle (sorry to slow down the boot):
echo "Mounting non-root local filesystems:"
-sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
# This pipe after the mount command is just to convert the new
# mount verbose output back to the old format that contained
# more useful information:
- /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep "${dev} " ; done
+ /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep " ${dev} " ; done
else
- /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep "${dev} " ; done
+ /sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs | grep successfully | cut -f 1 -d : | tr -d ' ' | while read dev ; do mount | grep " ${dev} " ; done
fi
# Enable swapping again. This is needed in case a swapfile is used,
@@ -382,13 +377,23 @@ if [ -x /etc/rc.d/rc.cgmanager -a -d /sys/fs/cgroup ]; then
/etc/rc.d/rc.cgmanager start
fi
+# Start libcgroup services:
+if [ -x /etc/rc.d/rc.cgconfig -a -x /etc/rc.d/rc.cgred -a -d /sys/fs/cgroup ]; then
+ /etc/rc.d/rc.cgconfig start ; echo " /usr/sbin/cgconfigparser -l /etc/cgconfig.conf"
+ /etc/rc.d/rc.cgred start
+fi
+
# Clean up some temporary files:
rm -f /var/run/* /var/run/*/* /var/run/*/*/* /etc/nologin \
/etc/dhcpc/*.pid /etc/forcefsck /etc/fastboot \
/var/state/saslauthd/saslauthd.pid \
/tmp/.Xauth* 1> /dev/null 2> /dev/null
+if [ -d /var/lib/pkgtools/setup/tmp ]; then
+ ( cd /var/lib/pkgtools/setup/tmp && rm -rf * )
+elif [ -d /var/log/setup/tmp ]; then
( cd /var/log/setup/tmp && rm -rf * )
- ( cd /tmp && rm -rf kde-[a-zA-Z]* ksocket-[a-zA-Z]* hsperfdata_[a-zA-Z]* plugtmp* )
+fi
+( cd /tmp && rm -rf kde-[a-zA-Z]* ksocket-[a-zA-Z]* hsperfdata_[a-zA-Z]* plugtmp* )
# Clear /var/lock/subsys:
if [ -d /var/lock/subsys ]; then
@@ -442,4 +447,3 @@ else
dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
chmod 600 /etc/random-seed
-