Re: [PATCH] dnet: Dave DNET ethernet controller driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Christer Weinigel <christer@...>
Cc: David Miller <davem@...>, <shemminger@...>, <s.hauer@...>, <yanok@...>, <linux-arm-kernel@...>, <netdev@...>, <wd@...>, <dzu@...>
Date: Thursday, March 12, 2009 - 1:49 pm

On Thu, Mar 12, 2009 at 05:25:27PM +0100, Christer Weinigel wrote:
Well, for an example of an initrd, you can unpack just about any distribution
initramfs that you like.  If you want to use busybox, I'd personally recommend
either Debian (I think they use busybox normally), or you're welcome to get a
copy of the fedora kexec-tools package.  I put a script called mkdumprd that
generates initramfs files in there based on busybox for the purpose of capturing
core dumps.  As for the dhcp part of it, that depends on the dhcp client you
decide to use.  I use the udhcpc applet in busybox, the man page for which
describes how to extract the various options out of the dhcpoffer frame.  Its
pretty straightforward.  Other clients do it differently, but that one is both
small and easy to use.

You don't need klibc, you can use regular glibc, and even build statically if
you like.  You'll have to use dig or host to do name lookups, but thats also
pretty easy to do.  This really is easier than you think it is :)


Seriously, most of what you need to do is embodied in my mkdumprd script.  Look
at that (or even just start with it an modify it), and you'll be 90% of the way
there.  After you get it working, you can strip out all the stuff you don't need
(which from mkdumprd will likely be substantial).

Wheres all the extra work?  You've given a few examples here, and they're all
things that are easily overcome. 

Well, you've said it there yourself.  What you're proposing is a hack in the
driver.  This really isn't the place for hacks.  This is the place for doing
things in as consistent and maintainable a way as possible.  That way is using
an initramfs, which you will need at some point in time anyway, if you want any
userspace functionality.  So why not create one?  The small investment of your
time figuring out how to do it will pay off over and over again when you can
easily assign unit-specific data using well known and well documented tools to
do so.

You're last comment is in direct contradiction to what you are saying here.  As
you've discovered, the in kernel dhcp and nfs root client are useless unless
your ethernet interface has a mac on it, and if you don't have a mac stored in
eeprom that the driver can access, you can't assign one without introducing a
big hack, which no one here is going to support.  The solution is to do things
the right way.  Save some space in the kernel by turning the in-kernel dhcp
client and nfs root code off, and use that space to store an initrd that can do
everything you need to and more.


Everyone has to invest some time on a tangent to their goal in order to reach
their goal.  This is simply a cost of doing business.  No one is going to accept
a hack to a driver just so that you don't have to learn how to do something a
bit differently.  And no amount of complaining about how difficult it is is
going to change that.  Its simply not true.  Theres a big document in the kernel
tree explaining how to create and use initramfs/initrd files.  I'll be happy to
help you figure out how to do it if you have questions.

It can, is that the the actual case?  How much space do you have if you turn off
the dhcp client and nfs root code in the kernel? Try hard, I bet you can make it
fit without much effort.

Well, that is your perogative.  I had to make those sorts of choices when I did
embedded too.  I tried to get upstream what was acceptible, and carried the rest
myself on occasion. But I promise you, this really isn't hard.  Spend some time,
and you'll find and onboard initramfs environment can make your life worlds
easier long term.
Neil

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] dnet: Dave DNET ethernet controller driver, Ilya Yanok, (Tue Mar 10, 10:29 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Stephen Hemminger, (Wed Mar 11, 12:18 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Michael Cashwell, (Thu Mar 12, 9:41 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Thu Mar 12, 10:05 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Robert Schwebel, (Fri Mar 13, 3:49 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Fri Mar 13, 4:12 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Jamie Lokier, (Thu Mar 12, 2:02 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 10:26 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Wed Mar 11, 4:44 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Wed Mar 11, 4:49 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Wed Mar 11, 4:56 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Stephen Hemminger, (Wed Mar 11, 8:13 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 6:41 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Thu Mar 12, 8:55 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 10:21 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 11:12 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Mike (mwester), (Thu Mar 12, 4:24 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 8:29 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 12:25 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 1:49 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 2:25 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Jamie Lokier, (Thu Mar 12, 3:25 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 3:43 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 3:05 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Jamie Lokier, (Thu Mar 12, 5:59 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 8:16 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 7:42 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 8:21 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Fri Mar 13, 6:30 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 3:29 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Thu Mar 12, 3:14 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Thu Mar 12, 1:43 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 1:52 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Jamie Lokier, (Thu Mar 12, 2:06 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 2:48 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Thu Mar 12, 3:04 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Wolfgang Denk, (Thu Mar 12, 4:14 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Russell King - ARM Linux, (Thu Mar 12, 4:35 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Thu Mar 12, 4:27 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Christer Weinigel, (Thu Mar 12, 3:21 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Neil Horman, (Thu Mar 12, 3:16 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Jamie Lokier, (Thu Mar 12, 3:15 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Dan Williams, (Thu Mar 12, 2:39 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Thu Mar 12, 11:01 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Thu Mar 12, 10:34 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Russell King - ARM Linux, (Wed Mar 11, 5:33 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Wed Mar 11, 4:57 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Wolfgang Denk, (Wed Mar 11, 5:09 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Wed Mar 11, 9:23 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Riku Voipio, (Wed Mar 11, 3:15 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, David Miller, (Wed Mar 11, 8:44 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Robert Schwebel, (Wed Mar 11, 2:23 pm)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Dan Williams, (Wed Mar 11, 10:00 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Sascha Hauer, (Wed Mar 11, 6:35 am)
Re: [PATCH] dnet: Dave DNET ethernet controller driver, Eric Dumazet, (Wed Mar 11, 12:00 am)