+}
+
+do_netmount() {
+ rc=1
+
+ modprobe "${MP_QUIET}" af_packet # For DHCP
+
+ ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf
+
+ if [ "${NFSROOT}" = "auto" ]; then
+ NFSROOT=${ROOTSERVER}:${ROOTPATH}
+ fi
+
+ [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
+
+ if [ "${NETBOOT}" != "nfs" ] && do_cifsmount ; then
+ rc=0
+ elif do_nfsmount ; then
+ NETBOOT="nfs"
+ export NETBOOT
+ rc=0
+ fi
+
+ [ "$quiet" != "y" ] && log_end_msg
+ return ${rc}
+}
+
+do_nfsmount() {
+ rc=1
+ modprobe "${MP_QUIET}" nfs
+ if [ -z "${NFSOPTS}" ]; then
+ NFSOPTS=""
+ fi
+
+ [ "$quiet" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
+ # FIXME: This for loop is an ugly HACK round an nfs bug
+ for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
+ nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break
+ sleep 1
+ done
+ return ${rc}
+}
+
+do_cifsmount() {
+ rc=1
+ if [ -x "/sbin/mount.cifs" ]; then
+ if [ -z "${NFSOPTS}" ]; then
+ CIFSOPTS="-ouser=root,password="
+ else
+ CIFSOPTS="${NFSOPTS}"
+ fi
+
+ [ "$quiet" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
+ modprobe "${MP_QUIET}" cifs
+
+ if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" ; then
+ rc=0
+ fi
+ fi
+ return ${rc}