* initrd in 2.4.19
@ 2002-05-01 17:08 Brian Kuschak
2002-05-02 11:27 ` Brad Parker
0 siblings, 1 reply; 4+ messages in thread
From: Brian Kuschak @ 2002-05-01 17:08 UTC (permalink / raw)
To: linuxppc-embedded
I noticed initrd handling has changed recently in the
kernel (init/do_mounts.c). This new code is causing
me problems. Has anyone else run into this?
Using the 'new style' (not terminating linuxrc)
/linuxrc runs the following sequence:
mount -o ro /dev/hda2 /new-root
cd /new-root
mkdir initrd
pivot_root . initrd
exec chroot . sbin/init dev/console 2>&1
But /linuxrc seems to be runnnig as PID 10, and
sbin/init doesn't start.
Using the 'old style' (linuxrc terminates and kernel
starts init):
mount -o ro /dev/hda2 /new-root
cd /new-root
mkdir initrd
echo 0x0302 > /proc/sys/kernel/real-root-dev
exit 0
The mount fails with EBUSY in mount_block_root()
because the root device is already mounted:
Attempting to find a root file system on hda2...
hda1 hda2
hda: hda1 hda2
XFS mounting filesystem ide0(3,2)
Starting XFS recovery on filesystem: ide0(3,2) (dev:
3/2)
Ending XFS recovery on filesystem: ide0(3,2) (dev:
3/2)
VFS: busy inodes on changed media.
err=-16, p=ext2, name=/dev/root <--
VFS: Cannot open root device "" or 03:02
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 03:02
For the old style to work, I have to not mount the
filesystem at all in my /linuxrc. I'm using
2.4.19-pre7 from bk (1.948)
-Brian
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: initrd in 2.4.19
2002-05-01 17:08 Brian Kuschak
@ 2002-05-02 11:27 ` Brad Parker
0 siblings, 0 replies; 4+ messages in thread
From: Brad Parker @ 2002-05-02 11:27 UTC (permalink / raw)
To: Brian Kuschak; +Cc: linuxppc-embedded
Brian Kuschak wrote:
>
>I noticed initrd handling has changed recently in the
>kernel (init/do_mounts.c). This new code is causing
>me problems. Has anyone else run into this?
heh. I found that every shred of documentation on this was 1/2 right and
1/2 wrong.
I came to the conclusion that you can either pivot_root or use /linuxrc
but not both.
i.e. if you 'turn on' the special /linuxrc running code you can't pivot
root from it. it's designed to modload a few modules, enough so the kernel's
own code can mount a file system. that's it. and it better return since
the kernel is not done initializing.
I want to use pivot_root, so I don't use the special /linuxrc running
code. Instead I use "init=/linuxrc" as part of the command line. If
you do this your first script should work fine (pivot follwed by
chroot). But to be honest, I don't chroot. I don't think it's
necessary.
I'd love to hear comments on this.
(actually, looking closer, your 2nd script solves the big problem, which
it the changing of the real root dev #. I'll bet it would work if it
unmounted /dev/hda2 before returning)
-brad
>
>Using the 'new style' (not terminating linuxrc)
>/linuxrc runs the following sequence:
> mount -o ro /dev/hda2 /new-root
> cd /new-root
> mkdir initrd
> pivot_root . initrd
> exec chroot . sbin/init dev/console 2>&1
>But /linuxrc seems to be runnnig as PID 10, and
>sbin/init doesn't start.
>
>Using the 'old style' (linuxrc terminates and kernel
>starts init):
> mount -o ro /dev/hda2 /new-root
> cd /new-root
> mkdir initrd
> echo 0x0302 > /proc/sys/kernel/real-root-dev
> exit 0
>The mount fails with EBUSY in mount_block_root()
>because the root device is already mounted:
>
>Attempting to find a root file system on hda2...
> hda1 hda2
> hda: hda1 hda2
>XFS mounting filesystem ide0(3,2)
>Starting XFS recovery on filesystem: ide0(3,2) (dev:
>3/2)
>Ending XFS recovery on filesystem: ide0(3,2) (dev:
>3/2)
>VFS: busy inodes on changed media.
>err=-16, p=ext2, name=/dev/root <--
>VFS: Cannot open root device "" or 03:02
>Please append a correct "root=" boot option
>Kernel panic: VFS: Unable to mount root fs on 03:02
>
>
>For the old style to work, I have to not mount the
>filesystem at all in my /linuxrc. I'm using
>2.4.19-pre7 from bk (1.948)
>
>-Brian
>
>
>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: initrd in 2.4.19
@ 2002-05-02 17:13 Brian Kuschak
2002-05-03 0:14 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Brian Kuschak @ 2002-05-02 17:13 UTC (permalink / raw)
To: 'Brad Parker', Brian Kuschak; +Cc: linuxppc-embedded
> I want to use pivot_root, so I don't use the special /linuxrc running
> code. Instead I use "init=/linuxrc" as part of the command line. If
> you do this your first script should work fine (pivot follwed by
> chroot). But to be honest, I don't chroot. I don't think it's
> necessary.
Using init=/linuxrc allows my first script to work.
However, it's a bit restrictive: if I want to override the usual boot
sequence and get the kernel to mount the real root and drop into a shell I
can't use this method. With the 'old-style' script, I can set
"init=/bin/bash". These get applied AFTER /linuxrc terminates. If I use
your method, I can't do that.
I realized yesterday that my second script works if I unmount /dev/hda2
before exiting /linuxrc.
Thanks,
Brian
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: initrd in 2.4.19
2002-05-02 17:13 initrd in 2.4.19 Brian Kuschak
@ 2002-05-03 0:14 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2002-05-03 0:14 UTC (permalink / raw)
To: linuxppc-embedded
On Thu, May 02, 2002 at 10:13:30AM -0700, Brian Kuschak wrote:
>
> > I want to use pivot_root, so I don't use the special /linuxrc running
> > code. Instead I use "init=/linuxrc" as part of the command line. If
> > you do this your first script should work fine (pivot follwed by
> > chroot). But to be honest, I don't chroot. I don't think it's
> > necessary.
>
> Using init=/linuxrc allows my first script to work.
>
> However, it's a bit restrictive: if I want to override the usual boot
> sequence and get the kernel to mount the real root and drop into a shell I
> can't use this method. With the 'old-style' script, I can set
> "init=/bin/bash". These get applied AFTER /linuxrc terminates. If I use
> your method, I can't do that.
Remember that any kernel command line options that the kernel doesn't
recognize get passed to init - as environment variables if they
contain a "=" and as command line arguments otherwise. So it's fairly
easy to invent a new parameter to control the "real" init and have
your linuxrc interpret it and act accordingly.
--
David Gibson | For every complex problem there is a
david@gibson.dropbear.id.au | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-05-03 0:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-02 17:13 initrd in 2.4.19 Brian Kuschak
2002-05-03 0:14 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2002-05-01 17:08 Brian Kuschak
2002-05-02 11:27 ` Brad Parker
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).