home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / initramfs-tools / scripts / nfs < prev   
Encoding:
Text File  |  2006-01-31  |  941 b   |  43 lines

  1. # NFS filesystem mounting            -*- shell-script -*-
  2.  
  3. # FIXME This needs error checking
  4.  
  5. # Paramter: Where the root should be mounted
  6. mountroot ()
  7. {
  8.     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top"
  9.     run_scripts /scripts/nfs-top
  10.     [ "$quiet" != "y" ] && log_end_msg
  11.  
  12.     modprobe -Qb nfs
  13.     # For DHCP
  14.     modprobe -Qb af_packet
  15.  
  16.     ipconfig ${DEVICE}
  17.     . /tmp/net-${DEVICE}.conf
  18.     if [ "x${NFSROOT}" = "xauto" ]; then
  19.         NFSROOT=${ROOTSERVER}:${ROOTPATH}
  20.     fi
  21.  
  22.     if [ "x${NFSOPTS}" = "x" ]; then
  23.         NFSOPTS="-o retrans=10"
  24.     fi
  25.  
  26.     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount"
  27.     run_scripts /scripts/nfs-premount
  28.     [ "$quiet" != "y" ] && log_end_msg
  29.  
  30.     if [ ${readonly} = y ]; then
  31.         roflag="-o ro"
  32.     else
  33.         roflag="-o rw"
  34.     fi
  35.  
  36.     mount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt}
  37.  
  38.     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
  39.     run_scripts /scripts/nfs-bottom
  40.     [ "$quiet" != "y" ] && log_end_msg
  41.  
  42. }
  43.