summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2020-04-07 08:38:58 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-07 20:57:16 (GMT)
commit3e78dc11c18416d78bceca75a182c46057d9b59e (patch)
treebee2964b70a4cd587d21b3afc8e111d11091a469
parentad030e8ff0be18fa09849db97158a607ffa81492 (diff)
downloadpoky-3e78dc11c18416d78bceca75a182c46057d9b59e.tar.gz
Revert "dhclient: not always skip the nfsroot interface"
This reverts commit[27aec88 dhclient: not always skip the nfsroot interface] which used to address the IP address renew issue when boot a system in a nfsroot fs and altogether boot with ip=dhcp. But reported by some tester, the above commit introduces below issue when run ltp test on a nfsroot system which boot with ip=dhcp: nfs: server 192.168.100.1 not responding, still trying nfs: server 192.168.100.1 not responding, still trying [snip] So revert the above commit now to avoid blocking test. (From OE-Core rev: 5c172e0e8f8d02fe1dacec9d3574671baf9ad075) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper26
1 files changed, 1 insertions, 25 deletions
diff --git a/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper b/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
index 87c60fa..7d0e224 100644
--- a/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
+++ b/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
@@ -1,19 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Add an initial /var/lib/dhcp/dhclient.leases to make
4# sure the IP which dhclient try to renew is the same
5# with the IP which kernel got from dhcp server during
6# boot
7update_dhclient_leases()
8{
9 local addr=$1
10 local interface=$2
11 echo "lease {" >> /var/lib/dhcp/dhclient.leases
12 echo " interface \"${addr}\";" >> /var/lib/dhcp/dhclient.leases
13 echo " fixed-address ${interface:0:-3};" >> /var/lib/dhcp/dhclient.leases
14 echo "}" >> /var/lib/dhcp/dhclient.leases
15}
16
17# In case the interface is used for nfs, skip it. 3# In case the interface is used for nfs, skip it.
18nfsroot=0 4nfsroot=0
19interfaces="" 5interfaces=""
@@ -33,7 +19,6 @@ while read dev mtpt fstype rest; do
33done 19done
34exec 0<&9 9<&- 20exec 0<&9 9<&-
35 21
36
37if [ $nfsroot -eq 0 ]; then 22if [ $nfsroot -eq 0 ]; then
38 interfaces="$INTERFACES" 23 interfaces="$INTERFACES"
39else 24else
@@ -42,16 +27,7 @@ else
42 fi 27 fi
43 for i in $INTERFACES; do 28 for i in $INTERFACES; do
44 if test "x$i" = "x$nfs_iface"; then 29 if test "x$i" = "x$nfs_iface"; then
45 interface_addr=`ip -4 address show $nfs_iface | grep 'inet '|sed 's/.*inet \(\S\+\).*/\1/'` 30 echo "dhclient skipping nfsroot interface $i"
46 if [ "x$interface_addr" != "x" ] && cat /proc/cmdline | grep "ip=dhcp" > /dev/null ; then
47 # use to renew lease if needed
48 interfaces="$interfaces $i"
49 # use to update /var/lib/dhcp/dhclient.leases if needed
50 # when the ip got by kernel, we need use dhclient to renew the ip
51 update_dhclient_leases $nfs_iface $interface_addr
52 else
53 echo "dhclient skipping nfsroot interface $i"
54 fi
55 else 31 else
56 interfaces="$interfaces $i" 32 interfaces="$interfaces $i"
57 fi 33 fi