FC4 CF-based Router

Steven Ringwald asric at asric.com
Mon Dec 19 17:56:16 UTC 2005


Bob Chiodini wrote:

>>>Using the linuxrc script above, what happens if you cd /sysroot, then
>>>run pivot_root . initrd?  /sysroot/initrd must exist. 
>>>      
>>>
>>Yes. It does. What happens is that it returns EINVAL, because it is a 
>>CPIO-style image, not a ramfs.
>>    
>>
>Have you tried building it into a compressed ramfs?  Does the 2.6 kernel
>support ramfs?  Might be an option.  
>  
>

No. I haven't from what everyone has told me (and what Fedora mkinitrd 
program does), this is the 'obsolete' way of doing things. I will put 
that on my list of things to try, though.

>>>When linuxrc exits the kernel should run init.  Is busybox compiled for
>>>x86_64 and statically linked?
>>>      
>>>
>>Yes. I went so far as to go to the source and get the svn copy/build it. 
>>Ldd reports "not a dynamic executable" and file says ELF 64-bit LSB 
>>executable.
>> That seemed to work a little better, though pivot_root/switch_root 
>>threw up on my shoes. I was able to get it to chroot into the target 
>>filesystem, though I cannot seem to run init.
>>    
>>
>
>Okay that explains the switchroot.  
>  
>
Right,. That was something left over from before I completely stopped 
using nash (which is what the Fedora mkinitrd created, btw. :-) )

>If you use nash what error does switchroot produce?
>  
>

The same. It behaves exactly like pivot_root does in busybox wrt the 
errors. switch_root (in busybox) gives me a little more verbose output 
(which is where I saw the thing about  "not rootfs")

>I also noticed that switch_root, from busybox has an open bug:
>
>http://bugs.busybox.net/view.php?id=543
>
>Further searching led to this:
>
>http://lkml.org/lkml/2005/11/15/384
>
>Which might be relevant.  
>

Alright. I will take a look at those as well.

>From the email in this thread it sounds like
>chroot .  is what you need.  What happens if you do something like this:
>
>--- at the end of linuxrc
>
>echo 0x0100 > /proc/sys/kernel/real-root-dev
>
>echo Starting system
>cd $SYSROOT
>chroot .
>cd /
>
>Letting linuxrc just exit.
>


 From what I saw, I need to use 1792 rather than 0x100, since my sysroot 
is not in ram0, but in loop0.... I can do the chroot, but I can't seem 
to chroot and start init. I am thinking that for some reason, the script 
is not running as process 0, and I cannot for the life of me figure out 
what is, so that I can start the next step in booting.

Thanks for your continuing help, though!
Steve





More information about the fedora-list mailing list