public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Art Boulatov <art@ksu.ru>
To: linux-kernel@vger.kernel.org
Subject: pivot_root & linuxrc problem
Date: Thu, 15 Mar 2001 16:16:10 +0300	[thread overview]
Message-ID: <3AB0C09A.1020505@ksu.ru> (raw)

Hi,

may be thats a bug, or I'm doing something really wrong :)

from Documentation/initrd.txt:

"# cd /new-root
   # mkdir initrd
   # pivot_root . initrd

Now, the linuxrc process may still access the old root via its
executable, shared libraries, standard input/output/error, and its
current root directory. All these references are dropped by the
following command:

# exec chroot . what-follows <dev/console >dev/console 2>&1

Where what-follows is a program under the new root, e.g. /sbin/init"



How can I "exec /sbin/init" from "/linuxrc", whatever it is,
if "linuxrc" does not get PID=1?

Actually, why does NOT "linuxrc" get PID=1?

A task list after booting with "root=/dev/rd/0" and "init=/linuxurc",
where "linuxrc" is simply "bash", shows that:
"swapper" got PID=1,
next come other kernel threads with a parent PID=1,
and "linuxrc" got PID=7 and a parent PID=1.

"init" sees it does not have PID=1 and simply bails out, next happens this:

"Note: if linuxrc or any program exec'ed from it terminates for some
reason, the old change_root mechanism is invoked (see section "Obsolete
root change mechanism")."


I probably misunderstand something here,
but could you please help?

In summary:

What is "swapper" and why does it get PID=1 and "linuxrc" does not?
If it is supposed to be that way, how do I "exec /sbin/init" from
"linuxrc" then?
Also why "/linuxrc" is hardcoded in init/main.c,
so telling kernel "root=/dev/rd/0 init=/sbin/whatever" does still invoke
"/linuxrc"?

Thanks a lot,
Art.


             reply	other threads:[~2001-03-15 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-15 13:16 Art Boulatov [this message]
2001-03-15 21:11 ` pivot_root & linuxrc problem Mike Galbraith
2001-03-15 22:41   ` Russell King
2001-03-16  8:54     ` Mike Galbraith
2001-03-16 12:34       ` Art Boulatov
2001-03-16 14:05       ` union mounts WAS: " Art Boulatov
2001-03-16 17:37         ` Guest section DW
2001-03-16 23:33       ` Bernd Eckenfels
2001-03-17 10:54         ` Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AB0C09A.1020505@ksu.ru \
    --to=art@ksu.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox