[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ltib] udhcpc gets different addr
From: |
Michael Jones |
Subject: |
[Ltib] udhcpc gets different addr |
Date: |
Wed, 11 Nov 2009 17:18:22 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Hi LTIBbers,
I have had the problem that I can't boot into the rootfs/ directory
using NFS if LTIB built "rootfs/" destined for a jffs2 image, because of
a problem with DHCP. I can only use NFS if I tell LTIB that I want
Target image: "NFS only". But I would like to be able to always build
the jffs2 image and still have the option of mounting via NFS.
Here's the problem: in my kernel config, I have CONFIG_IP_PNP_BOOTP=y.
This is necessary for NFS to work, to get an IP address before trying to
mount the root FS. After mounting rootfs/, if DEPLOYMENT_STYLE is
anything but "NFS", udhcp is called to get an IP. Because my kernel
config already got me an IP, this should just be a (safe) redundant
step, but for some reason, my DHCP server gives me a _different_ IP
address than I was given during kernel boot. As soon as my IP changes,
my NFS is of course hosed.
With the assurance that my kernel will take care of configuring the IP
address before mounting the RFS, I'm unchecking "Enable interface 0" in
LTIB (SYSCFG_IFACE0=n), but then I get the misleading warning from
"/etc/rc.d/init.d/network" that "Warning: no IPADDR is set, ...". I've
added the following patch below to my skell package so I don't get this
message unless "ifconfig" doesn't have an address for eth0.
I don't mean to complain of a problem with LTIB here, because it seems
my DHCP server is misbehaving. Does anybody have a suggestion why the
kernel DHCP and the udhcpc requests yield different addresses? Do you
think my skell fix is hideous or problematic?
thanks,
Michael
$ diff -u rpm/BUILD/skell-1.16/etc/rc.d/init.d/network
rootfs/etc/rc.d/init.d/network
--- rpm/BUILD/skell-1.16/etc/rc.d/init.d/network 2007-06-18
15:45:44.000000000 +0200
+++ rootfs/etc/rc.d/init.d/network 2009-11-11 16:18:45.000000000 +0100
@@ -24,7 +24,9 @@
#
# set up the network interfaces
#
- if [ "$IPADDR0" = "" ]
+ ipaddr=`ifconfig eth0 | grep "\<inet addr\>" |\
+ sed -e "s/^.*\<inet addr:\([0-9.]*\) .*/\1/"`;
+ if [ "$IPADDR0" = "" ] && [ $ipaddr = "" ]
then
echo ""
echo "Warning: no IPADDR is set, please set this from the ltib"
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner,
Hans-Joachim Reich
- [Ltib] udhcpc gets different addr,
Michael Jones <=