Default kernel configuration on 2.6.x
This is a follow-up to a private message I sent to Jeff in which I complained about the UML Howto being incorrect in saying that "[t]he [configuration] defaults will give you a useful kernel" since I was using an unmodified configuration and ended up with a kernel missing all the virtual drivers.
In the meantime I did some further research and it turns out that actually, the Howto isn't wrong - the default configuration included in the patches is perfectly correct and gives a useful kernel.
Instead, a well-meant feature in the 2.6 build process (IIRC present in 2.5 too) has been the cause of my difficulties: make *config tries to locate default settings by looking for the following files in order:
Quoted 8 lines
const char *conf_confnames[] = {
".config",
"/lib/modules/$UNAME_RELEASE/.config",
"/etc/kernel-config",
"/boot/config-$UNAME_RELEASE",
conf_defname,
NULL,
};(taken from linux-2.6.8.1/scripts/kconfig/confdata.c)
In other words, if a file describing the current host kernel's configuration is present on the host (the one under /boot is on my Debian box) then make config in a fresh or mrproper'ed guest tree will use the host configuration instead of the defaults supplied by the UML patch. This is true regardless of which kernel version is running on the host.
While this is useful under normal circumstances where you usually want to continue using your current settings, it seems very unhelpful in the case of a UML guest kernel since the guest kernel configuration and the host kernel configuration are targeted at two different platforms and thus don't have much in common, except perhaps for the choice of filesystems if you want the guest to access your host's storage devices.
It should be noted that since the host kernel is usually not a UML-patched kernel and therefore none of the UML-specific options are given in the host configuration file, the consequence of the current behaviour is that all UML-specific options default to off if one of the listed files is present on your host.
This is especially fatal because without a virtual character device driver, stdio initialization will fail silently or with an unhelpful error message ("sleeping process got unexpected signal 11"), leaving unsuspecting users like me completely puzzled.
Therefore I think it would make sense to have the UML patches for the affected kernel versions remove the second through fourth element from conf_confnames (as shown above) so that the build will immediately fall back to arch/um/defconfig if .config isn't found, always ignoring status quo configuration files on the host. A corresponding patch for 2.6.8.1 is attached.
Perhaps a note should be added somewhere pointing out the non-standard behavior to avoid confusing seasoned kernel recompilers, but I'm not sure where to put it. I'll leave that to the maintainers should you agree with the patch.
Cheers,
Julian
diff -r orig/linux-2.6.8.1/scripts/kconfig/confdata.c orig_defconfig/linux-2.6.8.1/scripts/kconfig/confdata.c 22,24d21
< "/lib/modules/$UNAME_RELEASE/.config",
< "/etc/kernel-config",
< "/boot/config-$UNAME_RELEASE",
-----BEGIN PGP SIGNED MESSAGE-----
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Julian" == Julian Scheid <[email protected]> writes:
Julian> Therefore I think it would make sense to have the UML Julian> patches for the affected kernel versions remove the second Julian> through fourth element from conf_confnames (as shown above) Julian> so that the build will immediately fall back to Julian> arch/um/defconfig if .config isn't found, always ignoring Julian> status quo configuration files on the host. A corresponding Julian> patch for 2.6.8.1 is attached.
I have a better suggestion.
Make it ignore those suggestions *COMPLETELY* when
$ARCH != `uname -m`
$SUBARCH != `uname -m` Since those suggestions are wrong for all cross-compilation as well,
and this is a form of cross-compilation.
{well, uname -m is wrong. I never did find a standard utility that
returned 'i386'. arch -k used to do the right thing on SunOS, but it never did the right thing on any Linux distro}
- --
] "Elmo went to the wrong fundraiser" - The Simpson | firewalls [ ] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[ ] [email protected] http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [ -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys
iQCVAwUBQWsQI4qHRg3pndX9AQFNvwP/SUpnojGHN+hcbkmH4+ZOM1mdlEfQq+tF 1f9eCfgx8lzv7wIn/HqFsHJlNEWChDr+ZCBNF2ibS9kOvGbnv1HZIHKI+ETZVhFE FAVawdmLCVGwLZJxBnDKwZZ01Xdh3C4f3Pp6KgDyq32L0cE04bEqZR1qk4jg/NlJ GttyxuUdCnQ=
=aeH+
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 15 lines · Michael Richardson
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Julian" == Julian Scheid <[email protected]> writes:
Julian> Therefore I think it would make sense to have the UML Julian> patches for the affected kernel versions remove the second Julian> through fourth element from
conf_confnames(as shown above) Julian> so that the build will immediately fall back to Julian>arch/um/defconfigif .config isn't found, always ignoring Julian> status quo configuration files on the host. A corresponding Julian> patch for 2.6.8.1 is attached.I have a better suggestion.
Make it ignore those suggestions *COMPLETELY* when$ARCH != `uname -m` $SUBARCH != `uname -m`
Quoted 6 lines
Since those suggestions are wrong for all cross-compilation as well,
and this is a form of cross-compilation.{well, uname -m is wrong. I never did find a standard utility that
returned 'i386'. arch -k used to do the right thing on SunOS, but it never did the right thing on any Linux distro}
In fact this is workarounded in the main Makefile.
However a even better setting IMHO is to check if the user has asked for a cross compilation (i.e. with ARCH specified on command line, or something such; I'll dig anyway on this). I will put together a patch ASAP.
Bye
Signature · 13 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 4 lines · Julian Scheid
This is especially fatal because without a virtual character device driver, stdio initialization will fail silently or with an unhelpful error message ("sleeping process got unexpected signal 11"), leaving unsuspecting users like me completely puzzled.
I.e. that error comes from this?????? Thanks a lot for this solution, but could you explain which is exactly the wrong CONFIG_ option set for this to happen?
Quoted 6 lines
Therefore I think it would make sense to have the UML patches for the affected kernel versions remove the second through fourth element from
conf_confnames(as shown above) so that the build will immediately fall back toarch/um/defconfigif .config isn't found, always ignoring status quo configuration files on the host. A corresponding patch for 2.6.8.1 is attached.
[Please always avoid sending that kind of patches; you **MUST ALWAYS** use unified diffs, i.e. diff -u; the preferred setting is -puNr].
Quoted 4 lines
Perhaps a note should be added somewhere pointing out the non-standard behavior to avoid confusing seasoned kernel recompilers, but I'm not sure where to put it. I'll leave that to the maintainers should you agree with the patch.
About this, see the other responses - this must be done in mainline whenever we are cross-compiling.
Bye
Signature · 13 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 9 lines · BlaisorBlade
Quoted 4 lines · Julian Scheid
This is especially fatal because without a virtual character device driver, stdio initialization will fail silently or with an unhelpful error message ("sleeping process got unexpected signal 11"), leaving unsuspecting users like me completely puzzled.
I.e. that error comes from this?????? Thanks a lot for this solution, but could you explain which is exactly the wrong
CONFIG_option set for this to happen?
No, not exactly, but I believe it's the file descriptor channel support.
Long answer: when I encountered this problem ("signal 11") and realized that my kernel config could be missing something I found that without exception, all UML-specific options were disabled (for the reasons mentioned).
I proceeded to enable most of them (except the watchdog and some virtual network drivers which sounded arcane) and the problem went away.
So I don't know exactly which option was necessary to get around the SEGV, but since it always happened around the stdio initialization and I was using "con=pty con0=fd:0,fd:1" I would say the culprit was the missing file descriptor channel support and/or pty channel support.
If you can't reproduce it like this, let me know and I will try to nail it down.
Quoted 1 line
[Please always avoid sending that kind of patches; you **MUST ALWAYS** use unified diffs, i.e. diff -u; the preferred setting is -puNr].
I noticed that too just a minute ago, very newbie-ish. Pardon, I'm not submitting patches too often, I'll take more care next time.
But hey, that's no reason to shout at me, I'm just trying to be helpful ;)
Quoted 1 line
About this, see the other responses - this must be done in mainline whenever we are cross-compiling.
Agree 100% with Michael and you, this is the right solution. I was focused on UML but in fact it's a larger issue.
Cheers,
Julian
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 21 lines · Julian Scheid
Quoted 9 lines · BlaisorBlade
Quoted 4 lines · Julian Scheid
This is especially fatal because without a virtual character device driver, stdio initialization will fail silently or with an unhelpful error message ("sleeping process got unexpected signal 11"), leaving unsuspecting users like me completely puzzled.
I.e. that error comes from this?????? Thanks a lot for this solution, but could you explain which is exactly the wrong
CONFIG_option set for this to happen?No, not exactly, but I believe it's the file descriptor channel support.
Long answer: when I encountered this problem ("signal 11") and realized that my kernel config could be missing something I found that without exception, all UML-specific options were disabled (for the reasons mentioned).
I proceeded to enable most of them (except the watchdog and some virtual network drivers which sounded arcane) and the problem went away.
Quoted 7 lines
So I don't know exactly which option was necessary to get around the SEGV, but since it always happened around the stdio initialization and I was using "con=pty con0=fd:0,fd:1" I would say the culprit was the missing file descriptor channel support and/or pty channel support.
If you can't reproduce it like this, let me know and I will try to nail it down.
Thanks a lot for this analysis, I'll check it here and let you know.
Quoted 7 lines
Quoted 2 lines
[Please always avoid sending that kind of patches; you **MUST ALWAYS** use unified diffs, i.e. diff -u; the preferred setting is -puNr].
I noticed that too just a minute ago, very newbie-ish. Pardon, I'm not submitting patches too often, I'll take more care next time.
But hey, that's no reason to shout at me, I'm just trying to be helpful ;)
Oh, sorry. Yes, I was maybe a bit rude, and it was not my intention - however what I try to do is to correct issues like these to avoid people being flamed somewhere where people are less polite. Here we are nice - if you hit LKML, someone may flame you seriously, so I try helping. In fact I used CAPITAL just to make it clear, not to shout and flame you; again sorry for that.
Quoted 5 lines
Quoted 2 lines
About this, see the other responses - this must be done in mainline whenever we are cross-compiling.
Agree 100% with Michael and you, this is the right solution. I was focused on UML but in fact it's a larger issue.
Yeah - I should be sending this to Sam Ravnborg (Kbuild maintainer) when I have time to focus on this - now it's 3 a.m. and I think I'll be asleep shortly :-)
Bye
Signature · 13 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 1 line · BlaisorBlade
In fact I used CAPITAL just to make it clear, not to shout and flame you; again sorry for that.
No problem, I know that you didn't mean it in an offending way, that's why I put a winkie in there. Thanks for your advice, my next patch will be more useful.
Quoted 1 line
Yeah - I should be sending this to Sam Ravnborg (
Kbuildmaintainer) when I have time to focus on this - now it's 3 a.m. and I think I'll be asleep shortly :-)
Great, can I ask you to stick to this thread or CC me when there are (major) news? I won't be able to monitor the whole list all the time. Thanks!
See you
Julian
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel