[lkml]   [2001]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectbd_t structure + net configuration
I'm working on bringing up linux in an embedded environment, and the box
is diskless and uses bootp to get its kernel + ramdisk. It uses ppcboot
to get that information. We've modified ppcboot to pass more information
to linux in the bd_t (board info) structure, specifically
ip address
default gateway
dns server

The question is how to get linux to use this information? I couldn't find
anything in the kernel source to do that. I had a temporary solution where
linux invokes dhcpcd to get the information again, but the problem there is
there are 2 dhcp servers on our network and the ip addresses assigned didn't
match between the bootp stage and the dhcp stage later. And there is an
efficiency problem--since the information is already in the box at the bootp
time, why bother with dhcp later?

I was surprised to find no built in mechanism to configure networking from
the boardinfo information.

Anyway what I ended up doing was modifying fs/proc/proc_misc.c to add a
file /proc/boardinfo, which has the information visible. Then during booting,
when networking would be initialized, I examine that file to know how to
set everything up.

What I did was have the /proc/boardinfo file appear like an sh script, so
when cat'd it looks like this:
ifconfig eth0 netmask
route add default gw
echo nameserver > /etc/resolv.conf
hostname box1102

(The numbers here are just examples, they change depending on the bootp

I modified one of the startup scripts to configure networking:
cat /proc/boardinfo > /tmp/bi
sh /tmp/bi
rm /tmp/bi

The only information used from the bd_t structure was the mac address of
the ethernet card, originally. The bd_t structure appears as the global
__res pointer.

I'm wondering if there is a prefered way of doing this? Also why does it
seem like setting up networking from the bd_t structure hasn't been done

Thoughts? Comments? Anything welcome.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.420 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site