All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage
       [not found] ` <200509131952.22631.blaisorblade@yahoo.it>
@ 2005-09-16 11:23   ` Nelson Castillo
  2005-09-16 13:01     ` Nelson Castillo
                       ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nelson Castillo @ 2005-09-16 11:23 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-user, user-mode-linux-devel

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

On 9/13/05, Blaisorblade <blaisorblade@yahoo.it> wrote:
(cut)
 
> >
> > What should I try? Do I need a patch?
> mv /lib/tls /lib/tls.away, after loop-mounting the filesystem on the host 
> , or booting with init=/bin/bash (not sure the second will work).

I did some tests. I just found out that
In Debian the best solution is to run:

  # echo "LD_ASSUME_KERNEL=2.4.1" >> etc/environment

in the chroot.
(See http://people.redhat.com/drepper/assumekernel.html)
 
I found something in this thread:

http://lists.debian.org/debian-user/2005/01/msg04226.html
---------------------------------------
--- "Todd A. Jacobs" <nospam@codegnome.org> wrote: 
> On Fri, Jan 28, 2005 at 10:43:44PM -0500, kynn@panix.com wrote:
> > Is the file /etc/environment _documented_ *anywhere*???
> 
> It's a highly non-standard, non-portable file that is source by PAM (and
> possibly other applications) on a Debian system.

That is as maybe, but /etc/environment is the
only shell-agnostic file there is, and where it can be
used, it certainly serves a good purpose.
---------------------------------------

I did 2 equivalent tests
  1) patching init/main.c to add the variable to the environment
  2) using a wrapper to /sbin/init

but it seems the environment is just discarded before
running what is in inittab (I'm not sure, I should read the
sources later).

sysvinit should have a way to add a variable to the
environment. Can it be done in intitab?

With : cd /etc && grep  "/etc/environment" * -RH 2>/dev/null

Among others, I found pam.d/login
# This module parses /etc/environment (the standard for  setting
# environ vars) and also allows you to use an extended config

- Do they mean standard in Debian?

BTW,

- when is NPTL (not) supported in UML?

I'm sending for your consideration a small patch for the FAQ
 (that may need some update. I'll do it as I learn more about
this issue).

 Thanks,
 Nelson.-

 -- 
Homepage : http://geocities.com/arhuaco

The first principle is that you must not fool yourself
and you are the easiest person to fool.
     -- Richard Feynman.

[-- Attachment #2: faq.html.patch --]
[-- Type: text/x-patch, Size: 1840 bytes --]

538a539,589
> <a name="kernel Panic, cannot set up thread-local storage"/><table width="100%" bgcolor="#e0e0e0">
>             <tr>
>               <td>
>                 <b>
>                   <font color="black">kernel Panic, cannot set up thread-local storage</font>
>                 </b>
>               </td>
>             </tr>
>           </table>
> <blockquote>
> Your UML kernel doesn't support Native Posix Thread Library and the binaries
> you're running are being dynamically linked to the NTPL libraries.
> <br><br>
> You can boot moving the NTPL libraries away.
> <ul>
> <li> <font color="black"># mount root_fs mnt-uml/ -o loop</font>
> <li> <font color="black"># mv mnt-uml/lib/tls mnt-uml/lib/tls.away</font>
> <li> <font color="black"># umount mnt-uml</font>
> </ul>
> If you're running Debian, you can get away with:
> <pre><font color="black">
>  # mount root_fs mnt-uml/ -o loop
>  # echo "LD_ASSUME_KERNEL=2.4.1" >> /mnt-uml/etc/environment
>  # umount mnt-uml/
> </font></pre>
> 
> It seems that using /etc/environment is Debian specific,
> as <a href="http://lists.debian.org/debian-user/2005/01/msg04226.html">discussed here</a>.
> 
> The LD_ASSUME_KERNEL=2.4.1 environment variable precludes
> the dynamic linker from using the NTPL libraries, as explained
> <a href="http://people.redhat.com/drepper/assumekernel.html">here</a>.
> 
> If you decide to move away /lib/tls/ and you're running Debian, you might
> prefer to use dpkg-divert.
> <pre><font color="black">
>   # export LD_ASSUME_KERNEL=2.4.1
>   # mount root_fs mnt-uml/ -o loop
>   # chroot mnt-uml
>   # mkdir /lib/tls.off
>   # cd /lib/tls
>   # pwd
>   #  for f in *;
>      do
>        dpkg-divert --divert --local --rename --divert /lib/tls.off/$f --add /lib/tls/$f;
>      done
>   # exit
>   # umount mnt-uml
> </font></pre>
> </blockquote>
> 

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

* [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage
  2005-09-16 11:23   ` [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage Nelson Castillo
@ 2005-09-16 13:01     ` Nelson Castillo
  2005-09-16 20:01       ` Rob Landley
  2005-09-16 19:04     ` Blaisorblade
  2005-09-16 20:53     ` Henrik Nordstrom
  2 siblings, 1 reply; 5+ messages in thread
From: Nelson Castillo @ 2005-09-16 13:01 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-user, user-mode-linux-devel

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

On 9/16/05, Nelson Castillo <nelsoneci@gmail.com> wrote:

> On 9/13/05, Blaisorblade <blaisorblade@yahoo.it> wrote:
> sysvinit should have a way to add a variable to the
> environment. Can it be done in intitab?

I just fixed the patch for the FAQ. It's much simpler
(and correct, I hope) now.

-------------

I tried with the patched init/main.c and:

inittab:
1:2345:respawn:/usr/bin/env LD_ASSUME_KERNEL=2.4.1 /sbin/getty 38400 tty1

(w/o the LD_ASSUME_KERNEL=2.4.1 the entry in
/etc/environment).

And it dies just after I log in, but I don't get a panic,
just another password prompt. So I guess it's bash
who is not taking the environment that /sbin/init
sets...

And that's why things work when I set
the variable in "/etc/environment"

(and also send a modified environment to
/sbin/init .... with LD_ASSUME_KERNEL=2.4.1.
You must do both, I said that setting
/etc/environment was enough in my previous
email and I was quite wrong. Sorry).

Regards.

-- 
Homepage : http://geocities.com/arhuaco

The first principle is that you must not fool yourself
and you are the easiest person to fool.
     -- Richard Feynman.

[-- Attachment #2: faq.html.patch --]
[-- Type: text/x-patch, Size: 1226 bytes --]

538a539,574
> <a name="kernel Panic, cannot set up thread-local storage"/><table width="100%" bgcolor="#e0e0e0">
>             <tr>
>               <td>
>                 <b>
>                   <font color="black">kernel Panic, cannot set up thread-local storage</font>
>                 </b>
>               </td>
>             </tr>
>           </table>
> <blockquote>
> Your UML kernel doesn't support Native Posix Thread Library and the binaries
> you're running are being dynamically linked to the NTPL libraries.
> <br><br>
> You can boot moving the NTPL libraries away.
> <ul>
> <li> <font color="black"># mount root_fs mnt-uml/ -o loop</font>
> <li> <font color="black"># mv mnt-uml/lib/tls mnt-uml/lib/tls.away</font>
> <li> <font color="black"># umount mnt-uml</font>
> </ul>
> If you're running Debian, you might prefer to use dpkg-divert.
> <pre><font color="black">
>   # export LD_ASSUME_KERNEL=2.4.1
>   # mount root_fs mnt-uml/ -o loop
>   # chroot mnt-uml
>   # mkdir /lib/tls.off
>   # cd /lib/tls
>   # pwd
>   #  for f in *;
>      do
>        dpkg-divert --divert --local --rename --divert /lib/tls.off/$f --add /lib/tls/$f;
>      done
>   # exit
>   # umount mnt-uml
> </font></pre>
> </blockquote>
> 

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

* Re: [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage
  2005-09-16 11:23   ` [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage Nelson Castillo
  2005-09-16 13:01     ` Nelson Castillo
@ 2005-09-16 19:04     ` Blaisorblade
  2005-09-16 20:53     ` Henrik Nordstrom
  2 siblings, 0 replies; 5+ messages in thread
From: Blaisorblade @ 2005-09-16 19:04 UTC (permalink / raw)
  To: user-mode-linux-devel, nelsoneci; +Cc: user-mode-linux-user

On Friday 16 September 2005 13:23, Nelson Castillo wrote:
> On 9/13/05, Blaisorblade <blaisorblade@yahoo.it> wrote:
> (cut)


> That is as maybe, but /etc/environment is the
> only shell-agnostic file there is, and where it can be
> used, it certainly serves a good purpose.
> ---------------------------------------

> I did 2 equivalent tests
>   1) patching init/main.c to add the variable to the environment
>   2) using a wrapper to /sbin/init
>

> sysvinit should have a way to add a variable to the
> environment. Can it be done in intitab?
It can be done via adding LD_ASSUME_KERNEL=2.4.1 to the kernel command line.

> - Do they mean standard in Debian?
No idea about that - but I've never seen this file, so I assume it's Debian 
specific.
> BTW,

> - when is NPTL (not) supported in UML?

> I'm sending for your consideration a small patch for the FAQ
>  (that may need some update. I'll do it as I learn more about
> this issue).
I've not yet read the patch, and likely I won't before you generate it with 
-u.

Sorry but I've not the time to learn that format (nor the will), especially 
since patches with -u provide more info both to "patch" and to patch readers.
>  Thanks,
>  Nelson.-

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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] 5+ messages in thread

* Re: [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage
  2005-09-16 13:01     ` Nelson Castillo
@ 2005-09-16 20:01       ` Rob Landley
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Landley @ 2005-09-16 20:01 UTC (permalink / raw)
  To: user-mode-linux-devel, nelsoneci; +Cc: Blaisorblade, user-mode-linux-user

On Friday 16 September 2005 08:01, Nelson Castillo wrote:
> On 9/16/05, Nelson Castillo <nelsoneci@gmail.com> wrote:
> > On 9/13/05, Blaisorblade <blaisorblade@yahoo.it> wrote:
> > sysvinit should have a way to add a variable to the
> > environment. Can it be done in intitab?
>
> I just fixed the patch for the FAQ. It's much simpler
> (and correct, I hope) now.

Hey, cool:

./linux rootfstype=hostfs rw init=/bin/sh LD_ASSUME_KERNEL=2.4.1 

Just gave my a shell prompt in skas0 mode on ubuntu.  Using unmodified 
2.6.13.1 with the .config I posted earlier.

---
sh-3.00# mount -t proc /proc /proc
sh-3.00# cat /proc/cpuinfo
processor       : 0
vendor_id       : User Mode Linux
model name      : UML
mode            : skas
host            : Linux driftwood 2.6.10-5-386 #1 Tue Apr 5 12:12:40 UTC 2005 
i686
bogomips        : 1268.12

sh-3.00#
---

Coolness. :)

Rob


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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] 5+ messages in thread

* Re: [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage
  2005-09-16 11:23   ` [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage Nelson Castillo
  2005-09-16 13:01     ` Nelson Castillo
  2005-09-16 19:04     ` Blaisorblade
@ 2005-09-16 20:53     ` Henrik Nordstrom
  2 siblings, 0 replies; 5+ messages in thread
From: Henrik Nordstrom @ 2005-09-16 20:53 UTC (permalink / raw)
  To: Nelson Castillo; +Cc: Blaisorblade, user-mode-linux-user, user-mode-linux-devel

On Fri, 16 Sep 2005, Nelson Castillo wrote:

>  1) patching init/main.c to add the variable to the environment
>  2) using a wrapper to /sbin/init

Better to just add the variable to the kernel command line.. any 
XX=something string on the command line is set as environment variables to 
init.

> but it seems the environment is just discarded before
> running what is in inittab (I'm not sure, I should read the
> sources later).

It is not, but mingetty/login cleans up the environment on interactive 
logins. Many other commands is also very restrictive about what is 
preserved in the environment when starting childprocesses so relying on 
LD_ASSUME_KERNEL to be globally set for all processes in the whole system 
is generally not a good idea.. (very hard to guarantee).

> sysvinit should have a way to add a variable to the
> environment. Can it be done in intitab?

Not that I know of. But as the environment can be specified on the kernel 
command line this isn't really needed.

> # This module parses /etc/environment (the standard for  setting
> # environ vars) and also allows you to use an extended config
>
> - Do they mean standard in Debian?

No idea what stadard they refer to. It is not in the UNIX standard from 
what I can see.

Regards
Henrik


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2005-09-16 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2accc2ff0509111117747e8639@mail.gmail.com>
     [not found] ` <200509131952.22631.blaisorblade@yahoo.it>
2005-09-16 11:23   ` [uml-devel] Re: [uml-user] 2.6.13 / cannot set up LDT for thread-local storage Nelson Castillo
2005-09-16 13:01     ` Nelson Castillo
2005-09-16 20:01       ` Rob Landley
2005-09-16 19:04     ` Blaisorblade
2005-09-16 20:53     ` Henrik Nordstrom

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.