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
| Christoph Lameter | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Linus Torvalds | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Christoph Hellwig | Re: [PATCH 06/32] IGET: Mark iget() and read_inode() as being obsolete [try #2] |
| Gerrit Renker | [PATCH 26/37] dccp: Integration of dynamic feature activation - part 1 (socket set... |
