#!/bin/sh # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/mountfs,v 1.2 2008-06-10 23:08:56 niro Exp $ #%rlevels: 7:s 0:k #%start: 40 #%stop: 60 #deps #%needs: #%before: #%after: source /etc/conf.d/rc source ${rc_functions} case "$1" in start) # fake mounts rootfs (taken from /.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 ext2 -o ro fi else echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." mount -n -o remount,rw / evaluate_retval fi echo -e ${COLOREDSTAR}"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 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 # below. All file systems that are added to the variable in the # form of no will be skipped. NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." mount -a -t $NO_FS evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." if [ -e /dev/.udev ] then NO_FS="noramfs,notmpfs" umount -a -r -d -t ${NO_FS} else # -d, umount loop devices as well umount -a -r -d fi evaluate_retval if [ -e /.bootdev ] && [ -x /usr/bin/eject ] then echo -e ${COLOREDSTAR}"Trying to eject the live-media ..." eject -m /mnt/cdrom &> /dev/null evaluate_retval fi update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac