PATCH: Enable IP PNP for 2.4.4-ac8
Subsystems (2)
2.4.4-ac8 disables IP auto config by default even if CONFIG_IP_PNP is defined. Here is a patch.
H.J.
---
net/ipv4/ipconfig.c renamed from net/ipv4/ipconfig.c.auto +4 -0
@@ -100,7 +100,11 @@*/ int ic_set_manually__initdata =0 ;/* IPconfig parameters set manually */ +#if defined(CONFIG_IP_PNP ) +int ic_enable__initdata =1 ;/* IP config enabled? */ +#else int ic_enable__initdata =0 ;/* IP config enabled? */ +#endif /* Protocol choice */ int ic_proto_enabled__initdata =0
Quoted 2 lines · H . J . Lu
2.4.4-ac8 disables IP auto config by default even if
CONFIG_IP_PNPis defined. Here is a patch.
It doesn't make any sense to enable this unless parameters are given to the kernel via the kernel command line or from firmware settings.
Later,
David S. Miller
[email protected]
Quoted 10 lines · David S. Miller
Quoted 2 lines · H . J . Lu
2.4.4-ac8 disables IP auto config by default even if
CONFIG_IP_PNPis defined. Here is a patch.It doesn't make any sense to enable this unless parameters are given to the kernel via the kernel command line or from firmware settings.
From Configure.help:
IP: kernel level autoconfigurationCONFIG_IP_PNP
This enables automatic configuration of IP addresses of devices and of the routing table during kernel boot, based on either information supplied on the kernel command line or by BOOTP or RARP protocols. You need to say Y only for diskless machines requiring network access to boot (in which case you want to say Y to "Root file system on NFS" as well), because all other machines configure the network in their startup scripts.
It works fine for 2.4.4. However, in 2.4.4-ac8, even if I select CONFIG_IP_PNP, I have to pass ip=xxxx to kernel, in addition to nfsroot=x.x.x.x:/foo/bar. With 2.4.4, I can just pass nfsroot=x.x.x.x:/foo/bar to kernel.
H.J.
Quoted 22 lines · H . J . Lu
Quoted 10 lines · David S. Miller
Quoted 2 lines · H . J . Lu
2.4.4-ac8 disables IP auto config by default even if
CONFIG_IP_PNPis defined. Here is a patch.It doesn't make any sense to enable this unless parameters are given to the kernel via the kernel command line or from firmware settings.
From Configure.help:
IP: kernel level autoconfiguration
CONFIG_IP_PNP
This enables automatic configuration of IP addresses of devices and of the routing table during kernel boot, based on either information supplied on the kernel command line or by BOOTP or RARP protocols. You need to say Y only for diskless machines requiring network access to boot (in which case you want to say Y to "Root file system on NFS" as well), because all other machines configure the network in their startup scripts.
Quoted 4 lines
It works fine for 2.4.4. However, in 2.4.4-ac8, even if I select
CONFIG_IP_PNP, I have to pass ip=xxxx to kernel, in addition to nfsroot=x.x.x.x:/foo/bar. With 2.4.4, I can just pass nfsroot=x.x.x.x:/foo/bar to kernel.
O.k. Configure.help needs to be updated. "ip=on" or "ip=bootp" or "ip=dhcp" work fine. I wonder if I forgot to forward port the docs?
This same situation exists for 2.2.18 & 2.2.19 as well.
The only way to get long term stability out of this is to write a user space client, you can put in a ramdisk. One of these days...
Eric
Quoted 24 lines · Eric W. Biederman
Quoted 22 lines · H . J . Lu
Quoted 10 lines · David S. Miller
Quoted 2 lines · H . J . Lu
2.4.4-ac8 disables IP auto config by default even if
CONFIG_IP_PNPis defined. Here is a patch.It doesn't make any sense to enable this unless parameters are given to the kernel via the kernel command line or from firmware settings.
From Configure.help:
IP: kernel level autoconfiguration
CONFIG_IP_PNP
This enables automatic configuration of IP addresses of devices and of the routing table during kernel boot, based on either information supplied on the kernel command line or by BOOTP or RARP protocols. You need to say Y only for diskless machines requiring network access to boot (in which case you want to say Y to "Root file system on NFS" as well), because all other machines configure the network in their startup scripts.
Quoted 7 lines
Quoted 4 lines
It works fine for 2.4.4. However, in 2.4.4-ac8, even if I select
CONFIG_IP_PNP, I have to pass ip=xxxx to kernel, in addition to nfsroot=x.x.x.x:/foo/bar. With 2.4.4, I can just pass nfsroot=x.x.x.x:/foo/bar to kernel.O.k. Configure.help needs to be updated. "ip=on" or "ip=bootp" or "ip=dhcp" work fine. I wonder if I forgot to forward port the docs?
It doesn't make any senses. When I specify CONFIG_IP_PNP and BOOTP/DHCP, I want a kernel with IP config using BOOTP/DHCP. I would expect IP config is turned for BOOTP/DHCP by default. You can turn it off by passing "ip=off" to kernel. Did I miss something?
Quoted 5 lines
This same situation exists for 2.2.18 & 2.2.19 as well.
The only way to get long term stability out of this is to write a user space client, you can put in a ramdisk. One of these days...
It doesn't work with diskless machines which don't support ramdisk during boot.
H.J.
Quoted 4 lines · H . J . Lu
It doesn't make any senses. When I specify
CONFIG_IP_PNPand BOOTP/DHCP, I want a kernel with IP config using BOOTP/DHCP. I would expect IP config is turned for BOOTP/DHCP by default. You can turn it off by passing "ip=off" to kernel. Did I miss something?
Since you have to set the command line anyway ip=dhcp is no extra burden and it lets you use the same kernel to boot of the harddrive etc.
Quoted 7 lines
Quoted 4 lines
This same situation exists for 2.2.18 & 2.2.19 as well.
The only way to get long term stability out of this is to write a user space client, you can put in a ramdisk. One of these days...
It doesn't work with diskless machines which don't support ramdisk during boot.
I don't believe that is a real world situation.
I boot diskless all of time and supporting a ramdisk is trivial. You just a have a program that slaps a kernel a ramdisk, and some command line arguments into a single image, along with a touch of adapter code to set the kernel parameters correctly and then boot that.
Eric
Quoted 9 lines · Eric W. Biederman
Quoted 4 lines · H . J . Lu
It doesn't make any senses. When I specify
CONFIG_IP_PNPand BOOTP/DHCP, I want a kernel with IP config using BOOTP/DHCP. I would expect IP config is turned for BOOTP/DHCP by default. You can turn it off by passing "ip=off" to kernel. Did I miss something?Since you have to set the command line anyway ip=dhcp is no extra burden and it lets you use the same kernel to boot of the harddrive etc.
Why do I have to set "ip=dhcp"? If I have selected CONFIG_IP_PNP and DHCP in my kernel configuration, should it be on by default?
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
This same situation exists for 2.2.18 & 2.2.19 as well.
The only way to get long term stability out of this is to write a user space client, you can put in a ramdisk. One of these days...
It doesn't work with diskless machines which don't support ramdisk during boot.
Quoted 6 lines
I don't believe that is a real world situation.
I boot diskless all of time and supporting a ramdisk is trivial. You just a have a program that slaps a kernel a ramdisk, and some command line arguments into a single image, along with a touch of adapter code to set the kernel parameters correctly and then boot that.
Let me guess. Your diskless machines are mostly x86. Have you tried ramdisk on diskless alpha, arm, m68k, mips, ppc, sh, sparc, booting over network?
H.J.
Quoted 8 lines · H . J . Lu
Quoted 7 lines · Eric W. Biederman
Quoted 4 lines · H . J . Lu
It doesn't make any senses. When I specify
CONFIG_IP_PNPand BOOTP/DHCP, I want a kernel with IP config using BOOTP/DHCP. I would expect IP config is turned for BOOTP/DHCP by default. You can turn it off by passing "ip=off" to kernel. Did I miss something?
Quoted 5 lines
Quoted 2 lines
Since you have to set the command line anyway ip=dhcp is no extra burden and it lets you use the same kernel to boot of the harddrive etc.
Why do I have to set "ip=dhcp"? If I have selected
CONFIG_IP_PNPand DHCP in my kernel configuration, should it be on by default?
I agree it isn't intuitive, and if nfsroot=xxx is specified it should probably turn on if there is missing information.
But if you have to select the command line anyway....
Mostly I like the situation where I can compile it in and turn it on when I need it, instead of having to do thing differently if it is compiled in or not.
ip=on is all it really takes.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
This same situation exists for 2.2.18 & 2.2.19 as well.
The only way to get long term stability out of this is to write a user space client, you can put in a ramdisk. One of these days...
It doesn't work with diskless machines which don't support ramdisk during boot.
Quoted 8 lines
Quoted 6 lines
I don't believe that is a real world situation.
I boot diskless all of time and supporting a ramdisk is trivial. You just a have a program that slaps a kernel a ramdisk, and some command line arguments into a single image, along with a touch of adapter code to set the kernel parameters correctly and then boot that.
Let me guess. Your diskless machines are mostly x86.
Mostly, but not exclusively.
Quoted 3 lines
Have you tried
ramdisk on diskless alpha, arm, m68k, mips, ppc, sh, sparc, booting over network?
First the booting situation on linux with respect to multiple platform sucks. We pass parameters in weird ways on every platform. The command line is the only thing that stays mostly the same. I'm looking at what it takes to clean that up, so we can have multiplatform bootloaders.
I have implemented what it takes to attach a ramdisk, and if you can boot an arbitrary kernel it isn't hard to have a program that attaches a ramdisk.
Now although I believe this is the right direction to go, you will notice I ported the dhcp IP auto configuration from 2.2.19 to to 2.4.x Buying a little more time to get this working.
Eric
Quoted 10 lines · Eric W. Biederman
I agree it isn't intuitive, and if nfsroot=xxx is specified it should probably turn on if there is missing information.
But if you have to select the command line anyway....
Mostly I like the situation where I can compile it in and turn it on when I need it, instead of having to do thing differently if it is compiled in or not.
In fact, I like the idea. But passing nfsroot=xxx to kernel doesn't imply "ip=on" is very annoying. My setup worked fine with 2.4.4. It took me a while to figure out why it didn't work with 2.4.4-ac8.
Quoted 8 lines
Quoted 3 lines
Have you tried
ramdisk on diskless alpha, arm, m68k, mips, ppc, sh, sparc, booting over network?First the booting situation on linux with respect to multiple platform sucks. We pass parameters in weird ways on every platform. The command line is the only thing that stays mostly the same. I'm looking at what it takes to clean that up, so we can have multiplatform bootloaders.
I don't think we have total control over how to boot over network on all platforms. On some platforms, you may only load kernel over the network and run from it.
Quoted 8 lines
I have implemented what it takes to attach a ramdisk, and if you can boot an arbitrary kernel it isn't hard to have a program that attaches a ramdisk.
Now although I believe this is the right direction to go, you will notice I ported the dhcp IP auto configuration from 2.2.19 to to 2.4.x Buying a little more time to get this working.
Thanks. I appreciate it.
H.J.
Quoted 2 lines · H . J . Lu
Have you tried ramdisk on diskless ... sparc .. booting over network?
I know that sparc works fine, what is your point though?
All platforms ought to work with ramdisks just fine, in fact.
Later,
David S. Miller
[email protected]
Quoted 5 lines · Eric W. Biederman
Mostly I like the situation where I can compile it in and turn it on when I need it, instead of having to do thing differently if it is compiled in or not.
ip=on is all it really takes.
This is the main reason I like the current 2.4.x behavior.
I hate config options that change how the core of the kernel boot makes decisions. Things like "where is root", "what is my network address or where do I get that information" have no reasonable default. This is why the command line args are there.
If you want a kernel which automatically does "foo", you have several options already by which to do this:
1) Many platforms allow you to store a boot comand line in the firmware (Sparc, several MIPS, PPC, etc.)
2) Failing #1, you can add a default prefix/postfix to the kernel command line at build time if you wish, just add some simple variable to the toplevel Makefile and have init/main.c frob this thing onto the kernel command line string after initially fetching it.
Really, H. J., you are asking for a static command line feature. That's cool, so add it :-)
Later,
David S. Miller
[email protected]
Quoted 3 lines · [email protected] said:
Since you have to set the command line anyway ip=dhcp is no extra
burden and it lets you use the same kernel to boot of the harddrive etc.
You don't have to set the command line anyway. At least you _didn't_.
Quoted 4 lines · [email protected] said:
I boot diskless all of time and supporting a ramdisk is trivial. You
just a have a program that slaps a kernel a ramdisk, and some command line arguments into a single image, along with a touch of adapter code to set the kernel parameters correctly and then boot that.
It's a PITA. Downloading a kernel by TFTP each time you make a one-line change is painful enough, without having to download a ramdisk to go with it.
And once those kernels are being built with CONFIG_BLK_DEV=n, the ramdisk is going to be an even more unattractive solution.
--
dwmw2
Quoted 4 lines · [email protected] said:
I hate config options that change how the core of the kernel boot
makes decisions. Things like "where is root", "what is my network address or where do I get that information" have no reasonable default. This is why the command line args are there.
If you're told (by rdev because the poxy bootloader on the board can't pass args to the kernel) that root is /dev/nfs, and you don't have a command line telling you your IP information, then there _is_ a reasonable default, and it is to do DHCP.
--
dwmw2
Quoted 6 lines · David Woodhouse
Quoted 3 lines · [email protected] said:
Since you have to set the command line anyway ip=dhcp is no extra
burden and it lets you use the same kernel to boot of the harddrive etc.You don't have to set the command line anyway. At least you _didn't_.
There wasn't even DHCP support before so yes you did. As you can't
get the nfs mount point from bootp.
Quoted 9 lines
Quoted 4 lines · [email protected] said:
I boot diskless all of time and supporting a ramdisk is trivial. You
just a have a program that slaps a kernel a ramdisk, and some command line arguments into a single image, along with a touch of adapter code to set the kernel parameters correctly and then boot that.It's a PITA. Downloading a kernel by TFTP each time you make a one-line change is painful enough, without having to download a ramdisk to go with it.
Unless you have a slow network, it isn't bad. I routinely download a 3MB kerenl+RAMDISK image in under a second. And that ramdisk is virtually without size optimization. It has glibc and a whole host of user space tools. I have gotten it down much smaller.
Quoted 2 lines
And once those kernels are being built with
CONFIG_BLK_DEV=n, the ramdisk is going to be an even more unattractive solution.
Well I think in the CONFIG_BLK_DEV=n case it might wind up being a ramfs or tmpfs image. Something like a simplified version of tar.
Eric
Quoted 2 lines · [email protected] said:
There wasn't even DHCP support before so yes you did. As you can't
get the nfs mount point from bootp.
Wasn't there a default? The Indy behind me seems to try to mount /tftpboot/172.16.18.195, so I put a filesystem there just to make it happy.
It's a 2.4.3 kernel.
Quoted 2 lines
Well I think in the
CONFIG_BLK_DEV=ncase it might wind up being a
ramfs or tmpfs image. Something like a simplified version of tar.
Well, if it stops working and stays broken, I suppose I'll just have to hack up a built-in command line option. ISTR ARM already has such an option.
I'd rather it didn't break, though.
--
dwmw2
Quoted 2 lines · David Woodhouse
Well, if it stops working and stays broken, I suppose I'll just have to hack up a built-in command line option. ISTR ARM already has such an option.
Indeed it does, because some platforms don't have any way to pass anything to the kernel period. (Because they are using a serial loader called Angel).
--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 8 lines · David Woodhouse
Quoted 2 lines · [email protected] said:
There wasn't even DHCP support before so yes you did. As you can't
get the nfs mount point from bootp.Wasn't there a default? The Indy behind me seems to try to mount /tftpboot/172.16.18.195, so I put a filesystem there just to make it happy.
It's a 2.4.3 kernel.
Duh. I forgot about the default path.
Quoted 7 lines
Quoted 2 lines
Well I think in the
CONFIG_BLK_DEV=ncase it might wind up being a
ramfs or tmpfs image. Something like a simplified version of tar.Well, if it stops working and stays broken, I suppose I'll just have to hack up a built-in command line option. ISTR ARM already has such an option.
I'd rather it didn't break, though.
The clean way to handle it, and I'll take a look it to have root=/dev/nfs (and the rdev equivalent) to set ip=on if it isn't already. The current 2.4.4 behavior of root=/dev/hda3 doing ip autoconfig when the code is compiled into the kernel is just bad.
Eric
Quoted 3 lines
The clean way to handle it, and I'll take a look it to have root=/dev/nfs (and the rdev equivalent) to set ip=on if it isn't
Yes.
Quoted 2 lines
already. The current 2.4.4 behavior of root=/dev/hda3 doing ip autoconfig when the code is compiled into the kernel is just bad.
Agreed.
H.J.