--- trunk/busybox-initscripts/rc/mountfs 2011/01/27 20:42:23 1196 +++ trunk/busybox-initscripts/rc/mountfs 2011/03/03 18:37:26 1228 @@ -15,73 +15,20 @@ case "$1" in start) - # fake mounts rootfs (taken from /.bootdev) - if [ -e /.bootdev ] + if [ ! -e /.bootdev ] then - source /.bootdev - mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro - # we don't delete this for the alx settings import - # wanna check if usbstorage or not - # rm /.bootdev - - # fake mounts cloop, loop or sqsh - if [ -f /mnt/cdrom/livecdrootfs.loop ] - then - mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro - - elif [ -f /mnt/cdrom/livecdrootfs.cloop ] - then - mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro - - elif [ -f /mnt/cdrom/livecdrootfs.sqsh ] - then - mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t squashfs -o ro - fi - else rc_print "Remounting root file system in read-write mode ..." mount -n -o remount,rw / evaluate_retval fi - rc_print "Recording existing mounts in /etc/mtab ..." - > /etc/mtab - - mount -f / && mount -f /proc - - # records devfs as mounted - is_fs_mounted devfs && mount -f -t devfs devfs /dev - - # records devpts as mounted - is_fs_mounted devpts && mount -f -t devpts devpts /dev/pts - - # records sysfs as mounted - is_fs_mounted sysfs && mount -f -t sysfs sysfs /sys - - # records udev as mounted - if is_fs_mounted udev - then - # get the fstype of udev - it may be ramfs or tmpfs - udev_fstype="$(cat /proc/mounts | grep udev | cut -d ' ' -f3)" - # get the right mount opts - udev with tmpfs comes nosuid - udev_mopts="$(cat /proc/mounts | grep udev | cut -d ' ' -f4)" - mount -f -t ${udev_fstype} -o ${udev_mopts} udev /dev - fi - - # records mdev as mounted - if is_fs_mounted mdev + if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]] then - # get the fstype of mdev - it may be ramfs or tmpfs - mdev_fstype="$(cat /proc/mounts | grep mdev | cut -d ' ' -f3)" - # get the right mount opts - mdev with tmpfs comes nosuid - mdev_mopts="$(cat /proc/mounts | grep mdev | cut -d ' ' -f4)" - mount -f -t ${mdev_fstype} -o ${mdev_mopts} mdev /dev + rc_print "Recording existing mounts in /etc/mtab ..." + ln -snf /proc/mounts /etc/mtab + evaluate_retval fi - # records usbfs as mounted - is_fs_mounted usbfs && mount -f -t usbfs usbfs /proc/bus/usb - - evaluate_retval - # The following mount command will mount all file systems. If you # have other (network based) file system that should not be or # cannot be mounted at this time, add them to the NO_FS variable