Magellan Linux

Diff of /trunk/initscripts/busybox/rc/mountfs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/busybox-initscripts/rc/mountfs revision 1168 by niro, Wed Dec 15 17:44:36 2010 UTC trunk/initscripts/busybox/rc/mountfs revision 1357 by niro, Sat Jun 4 21:05:40 2011 UTC
# Line 15  source ${rc_functions} Line 15  source ${rc_functions}
15    
16  case "$1" in  case "$1" in
17   start)   start)
18   # fake mounts rootfs (taken from /.bootdev)   if [ ! -e /.bootdev ]
  if [ -e /.bootdev ]  
19   then   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  
20   rc_print "Remounting root file system in read-write mode ..."   rc_print "Remounting root file system in read-write mode ..."
21   mount -n -o remount,rw /   mount -n -o remount,rw /
22   evaluate_retval   evaluate_retval
23   fi   fi
24    
25   rc_print "Recording existing mounts in /etc/mtab ..."   if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]]
  > /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  
26   then   then
27   # get the fstype of udev - it may be ramfs or tmpfs   rc_print "Recording existing mounts in /etc/mtab ..."
28   udev_fstype="$(cat /proc/mounts | grep udev | cut -d ' ' -f3)"   ln -snf /proc/mounts /etc/mtab
29   # get the right mount opts - udev with tmpfs comes nosuid   evaluate_retval
  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  
  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  
30   fi   fi
31    
  # records usbfs as mounted  
  is_fs_mounted usbfs && mount -f -t usbfs usbfs /proc/bus/usb  
   
  evaluate_retval  
   
32   # The following mount command will mount all file systems. If you   # The following mount command will mount all file systems. If you
33   # have other (network based) file system that should not be or   # have other (network based) file system that should not be or
34   # cannot be mounted at this time, add them to the NO_FS variable   # cannot be mounted at this time, add them to the NO_FS variable
# Line 100  case "$1" in Line 47  case "$1" in
47   rc_print "Unmounting all other currently mounted file systems ..."   rc_print "Unmounting all other currently mounted file systems ..."
48   if [ -e /dev/.udev ]   if [ -e /dev/.udev ]
49   then   then
50   NO_FS="noramfs,notmpfs,nodevtmpfs"   NO_FS="noramfs,notmpfs,nodevtmpfs,nodevpts"
51   umount -a -r -d -t ${NO_FS}   umount -a -r -d -t ${NO_FS}
52   else   else
53   # -d, umount loop devices as well   # -d, umount loop devices as well
# Line 120  case "$1" in Line 67  case "$1" in
67   ;;   ;;
68    
69   *)   *)
70   echo "Usage: $0 {start|stop}"   rc_echo "Usage: $0 {start|stop}"
71   exit 1   exit 1
72   ;;   ;;
73  esac  esac

Legend:
Removed from v.1168  
changed lines
  Added in v.1357