]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/ifupdown-scripts/nfs_check
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / ifupdown-scripts / nfs_check
1 #!/bin/sh
2
3 # This allows NFS booting to work while also being able to configure
4 # the network interface via DHCP when not NFS booting.  Otherwise, a
5 # NFS booted system will likely hang during DHCP configuration.
6
7 # Attempting to configure the network interface used for NFS will
8 # initially bring that network down.  Since the root filesystem is
9 # accessed over this network, the system hangs.
10
11 # This script is run by ifup and will attempt to detect if a NFS root
12 # mount uses the interface to be configured (IFACE), and if so does
13 # not configure it.  This should allow the same build to be disk/flash
14 # booted or NFS booted.
15
16 nfsip=`sed -n '/^[^ ]*:.* \/ nfs.*[ ,]addr=\([0-9.]\+\).*/s//\1/p' /proc/mounts`
17 if [ -n "$nfsip" ] && ip route get to "$nfsip" | grep -q "dev $IFACE"; then
18         echo Skipping $IFACE, used for NFS from $nfsip
19         exit 1
20 fi