All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] Default kernel configuration on 2.6.x
@ 2004-10-11 22:22 Julian Scheid
  2004-10-11 22:58 ` Michael Richardson
  2004-10-11 23:46 ` BlaisorBlade
  0 siblings, 2 replies; 7+ messages in thread
From: Julian Scheid @ 2004-10-11 22:22 UTC (permalink / raw)
  To: jdike; +Cc: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 2941 bytes --]

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:

> 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


[-- Attachment #2: uml-patch-defconfig-2.6.8.1-1 --]
[-- Type: text/plain, Size: 220 bytes --]

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",

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-11 22:22 [uml-devel] Default kernel configuration on 2.6.x Julian Scheid
@ 2004-10-11 22:58 ` Michael Richardson
  2004-10-11 23:47   ` BlaisorBlade
  2004-10-11 23:46 ` BlaisorBlade
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Richardson @ 2004-10-11 22:58 UTC (permalink / raw)
  To: Julian Scheid; +Cc: jdike, user-mode-linux-devel

-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "Julian" == Julian Scheid <julian@sektor37.de> 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[
] mcr@xelerance.com      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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-11 22:22 [uml-devel] Default kernel configuration on 2.6.x Julian Scheid
  2004-10-11 22:58 ` Michael Richardson
@ 2004-10-11 23:46 ` BlaisorBlade
  2004-10-12  0:41   ` Julian Scheid
  1 sibling, 1 reply; 7+ messages in thread
From: BlaisorBlade @ 2004-10-11 23:46 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Julian Scheid, jdike

On Tuesday 12 October 2004 00:22, Julian Scheid wrote:

> 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?

> 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.

[Please always avoid sending that kind of patches; you **MUST ALWAYS** use 
unified diffs, i.e. diff -u; the preferred setting is -puNr].
> 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
-- 
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-11 22:58 ` Michael Richardson
@ 2004-10-11 23:47   ` BlaisorBlade
  0 siblings, 0 replies; 7+ messages in thread
From: BlaisorBlade @ 2004-10-11 23:47 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Michael Richardson, Julian Scheid, jdike

On Tuesday 12 October 2004 00:58, Michael Richardson wrote:
> >>>>> "Julian" == Julian Scheid <julian@sektor37.de> 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}

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
-- 
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-11 23:46 ` BlaisorBlade
@ 2004-10-12  0:41   ` Julian Scheid
  2004-10-12  1:01     ` BlaisorBlade
  0 siblings, 1 reply; 7+ messages in thread
From: Julian Scheid @ 2004-10-12  0:41 UTC (permalink / raw)
  To: BlaisorBlade; +Cc: user-mode-linux-devel, jdike

BlaisorBlade wrote:
> On Tuesday 12 October 2004 00:22, Julian Scheid wrote:
> 
> 
>>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.

> [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 ;)

> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-12  0:41   ` Julian Scheid
@ 2004-10-12  1:01     ` BlaisorBlade
  2004-10-12  1:39       ` Julian Scheid
  0 siblings, 1 reply; 7+ messages in thread
From: BlaisorBlade @ 2004-10-12  1:01 UTC (permalink / raw)
  To: Julian Scheid; +Cc: user-mode-linux-devel, jdike

On Tuesday 12 October 2004 02:41, Julian Scheid wrote:
> BlaisorBlade wrote:
> > On Tuesday 12 October 2004 00:22, Julian Scheid wrote:
> >>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.

Thanks a lot for this analysis, I'll check it here and let you know.

> > [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.

> > 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
-- 
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uml-devel] Default kernel configuration on 2.6.x
  2004-10-12  1:01     ` BlaisorBlade
@ 2004-10-12  1:39       ` Julian Scheid
  0 siblings, 0 replies; 7+ messages in thread
From: Julian Scheid @ 2004-10-12  1:39 UTC (permalink / raw)
  To: BlaisorBlade; +Cc: user-mode-linux-devel, jdike

BlaisorBlade wrote:
> 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.

> 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 :-)

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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-12  1:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 22:22 [uml-devel] Default kernel configuration on 2.6.x Julian Scheid
2004-10-11 22:58 ` Michael Richardson
2004-10-11 23:47   ` BlaisorBlade
2004-10-11 23:46 ` BlaisorBlade
2004-10-12  0:41   ` Julian Scheid
2004-10-12  1:01     ` BlaisorBlade
2004-10-12  1:39       ` Julian Scheid

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.