Magellan Linux

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

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

revision 1227 by niro, Thu Jan 27 20:42:23 2011 UTC revision 1228 by niro, Thu Mar 3 18:37:26 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 squashfs -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  
  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  
26   then   then
27   # get the fstype of mdev - it may be ramfs or tmpfs   rc_print "Recording existing mounts in /etc/mtab ..."
28   mdev_fstype="$(cat /proc/mounts | grep mdev | cut -d ' ' -f3)"   ln -snf /proc/mounts /etc/mtab
29   # get the right mount opts - mdev with tmpfs comes nosuid   evaluate_retval
  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

Legend:
Removed from v.1227  
changed lines
  Added in v.1228