From: der.eremit@email.de
To: "Andrey Borzenkov" <arvidjaar@mail.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Initrd Question
Date: Fri, 13 Feb 2004 16:23:46 +0100 [thread overview]
Message-ID: <E1ArfAQ-00007f-7Z@localhost> (raw)
In-Reply-To: <1oMkR-1Zk-21@gated-at.bofh.it>
On Fri, 13 Feb 2004 15:20:13 +0100, you wrote in linux.kernel:
>>> echo 0x0100 > /proc/sys/kernel/real-root-dev
>> This makes no sense as you're using pivot_root.
> this makes all sort of sense. Please check sources. It is required so
> that kernel will not attempt to mount root passed to it by loader.
> You are welcome to clean up the code :)
I'm not doing that and it works as expected. Note that the initrd code
in question never exits. It execs init. So when would the kernel do
this attempted mount of the root filesystem passed in by the bootloader?
My understanding is that the old, non-pivot_root method works by
exiting the initrd script - and *then* the kernel attempts to mount
real-root-dev.
In any case, if that wasn't clear, I expect the bootloader to pass
in root=/dev/ram0 anyway. ;)
>>> mount -n -o ro /dev/sda2 /new_root
>>
>> This doesn't even match with the 0x0100 above, now does it?
>
> so what? kernel happily ignores real-root-dev, it is possible that
> some user-level tools may be confused but I have not seen any so far.
Now you're saying the kernel ignores real-root-dev, while a moment
before you state that it is important to set real-root-dev because
otherwise the kernel does something. Which is it?
>>> pivot_root /new_root /new_root/initrd
>> You should cd into /new_root before running pivot_root,
> Huh? Why?
>
> SYNOPSIS
> pivot_root new_root put_old
And just a couple of lines further down:
Note that, depending on the implementation of pivot_root, root and cwd
of the caller may or may not change. The following is a sequence for
invoking pivot_root that works in either case, assuming that pivot_root
and chroot are in the current PATH:
cd new_root
pivot_root . put_old
exec chroot . command
The pivot_root(2) manpage states the same, by the way.
--
Ciao,
Pascal
next parent reply other threads:[~2004-02-13 15:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1oMkR-1Zk-21@gated-at.bofh.it>
2004-02-13 15:23 ` der.eremit [this message]
2004-02-13 16:42 ` Initrd Question Jim Gifford
2004-02-13 17:12 ` H. Peter Anvin
2004-02-13 14:14 "Andrey Borzenkov"
2004-02-13 14:22 ` Valdis.Kletnieks
2004-02-18 2:05 ` Robert White
[not found] <1oC26-8eW-9@gated-at.bofh.it>
2004-02-13 13:30 ` der.eremit
-- strict thread matches above, loose matches on Subject: below --
2004-02-13 3:12 Jim Gifford
2004-02-13 20:34 ` Chris Lingard
2001-06-18 7:20 initrd question Kelledin Tane
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=E1ArfAQ-00007f-7Z@localhost \
--to=der.eremit@email.de \
--cc=arvidjaar@mail.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;
as well as URLs for NNTP newsgroup(s).