diff options
Diffstat (limited to 'source/ap/lxc/scripts/rc.S.lxc')
-rw-r--r-- | source/ap/lxc/scripts/rc.S.lxc | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/source/ap/lxc/scripts/rc.S.lxc b/source/ap/lxc/scripts/rc.S.lxc index d6bc21f0..6732184a 100644 --- a/source/ap/lxc/scripts/rc.S.lxc +++ b/source/ap/lxc/scripts/rc.S.lxc @@ -191,11 +191,6 @@ if [ -z "$container" ]; then /sbin/swapon -a 2> /dev/null fi -# Start FUSE, if requested: -if [ -x /etc/rc.d/rc.fuse -a -z "$container" ]; 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 if [ -z "$container" ]; then @@ -255,7 +250,12 @@ fi # Check the root filesystem: if [ -z "$container" ]; then - 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 RETVAL=0 if [ ! -r /etc/fastboot ]; then echo "Checking root filesystem:" @@ -294,7 +294,6 @@ if [ -z "$container" ]; 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 @@ -318,24 +317,23 @@ if [ -z "$container" ]; then fi # Done checking root filesystem fi -# 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: -if [ -z "$container" ]; then - /sbin/mount -f -w / -fi - -# Add /proc, /sys, and /dev/shm mounts to /etc/mtab: -if [ -z "$container" ]; then - 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 + if [ -z "$container" ]; then + # 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 fi @@ -384,18 +382,15 @@ 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): if [ -z "$container" ]; then 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 fi @@ -411,13 +406,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 @@ -471,4 +476,3 @@ else dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null fi chmod 600 /etc/random-seed - |