# AoE filesystem mounting # Based on the NFS filesystem mounting # FIXME This needs error checking retry_nr=0 reset_cnt() { times_to_sh=10 } wait_cnt() { times_to_sh=$(( ${times_to_sh} - 1 )) if [ ${times_to_sh} -le 0 ] ; then reset_cnt log_msg_begin "Timed out, entering shell" sh log_msg_end else sleep 1 echo . fi } # parse AoE bootargs and mount AoE do_aoemount() { configure_networking # make sure aoe root exists log_begin_msg "Discovering AoE device ${ROOT}" reset_cnt while [ ! -e ${ROOT} ] ; do echo > /dev/etherd/discover wait_cnt done log_end_msg # discover fstype and modprobe if [ -z "${ROOTFSTYPE}" ] ; then FSTYPE=ext3 #get_fstype can be tried FSTYPE=$(get_fstype "${ROOT}") else FSTYPE=${ROOTFSTYPE} fi # Maby it is a module modprobe ${FSTYPE} # set read-only if [ ${readonly} = y ]; then roflag="-o ro" else roflag="-o rw" fi log_begin_msg "mounting ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt}" mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt} log_end_msg } # AOE root mounting mountroot() { log_begin_msg "Mounting AoE" modprobe aoe modprobe af_packet echo > /dev/etherd/discover wait_for_udev 10 do_aoemount log_end_msg }