FC4 CF-based Router

Bob Chiodini rchiodin at bellsouth.net
Mon Dec 19 15:11:02 UTC 2005


On Fri, 2005-12-16 at 15:44 -0800, Steven Ringwald wrote:
> Bob Chiodini wrote:
> 
> >Do you ever sleep?
> >
> >  
> >
> 
> Actually, I just spent quite a bit of time catching up today. :-)
> 
> >Google shows a couple of hits with pivot_root and the 2.6.14rcX kernels,
> >but they don't seem related to busybox.  I assume your pivot_root is
> >from busybox.
> >  
> >
> Yes.
> 
> rpm reports that I am using busybox-1.00-4.
> 
> >You might try bringing in the binary from Fedora (/sbin/pivot_root).
> >There is an example usage in the man (8) page.  It recommends cd'ing to
> >the new root before pivoting.  There is an implication that something
> >changed, or is changing.  Also have a look at man 2 pivot_root.  
> >  
> >
> 
> Right. I tried that, though I didn't try using the /sbin/pivot_root 
> binary because it is dynamically linked.
> 
> >The man (2) pivot_root page indicates that -EINVAL will be returned if
> >old root is not beneath new root.  I assume that means the directory
> >where old root will be mounted must exist.
> >
> >Can you post your new nash'less script?
> >  
> >
> Sure. It is attached.  I can get to a bash shell using it, and do stuff 
> in the "livecd" environment, just can't start init.
> 
> >I'm only on my first cup of coffee... I could be way off-base
> >  
> >
> 
> You are a little ahead of me; I haven't gotten to the first cup yet. :-)
> 
> Steve
> 
> 
> plain text document attachment (linuxrc)
> #!/bin/busybox msh
> 
> # System config variables
> SYSROOT=/sysroot
> IMAGEDEV=/dev/sda2
> IMAGENOD="3 2"
> IMAGELOC=/dos
> IMAGENAME=image.vhd
> LOOPDEV=/dev/loop1
> LOOPNOD="7 1"
> 
> # create the links 
> /bin/busybox ln -s /bin/busybox /bin/ln
> 
> /bin/ln -s /bin/busybox /bin/chroot
> /bin/ln -s /bin/busybox /bin/echo
> /bin/ln -s /bin/busybox /bin/ls
> /bin/ln -s /bin/busybox /bin/mount
> /bin/ln -s /bin/busybox /bin/mknod
> /bin/ln -s /bin/busybox /bin/mkdir
> /bin/ln -s /bin/busybox /bin/msh
> 
> echo Creating the directories and links
> /bin/mkdir /sys /dev /proc /sys $SYSROOT $IMAGELOC
> /bin/mount -o mode=0755 -t tmpfs /dev /dev
> /bin/ln -s /bin /sbin
> /bin/mkdir /dev/pts /dev/shm
> 
> echo Loading the modules
> /sbin/insmod /lib/loop.ko
> /sbin/insmod /lib/jbd.ko
> /sbin/insmod /lib/ext3.ko
> /sbin/insmod /lib/fat.ko
> /sbin/insmod /lib/vfat.ko
> 
> echo Creating device nodes
> /bin/mknod $IMAGEDEV b $IMAGENOD
> /bin/mknod $LOOPDEV b $LOOPNOD
> /bin/mknod /dev/console c 5 1
> /bin/mknod /dev/null c 1 3
> /bin/mknod /dev/zero c 1 5
> 
> /bin/mount -tproc /proc /proc
> /bin/mount -tsysfs /sys /sys
> /bin/mount -tvfat $IMAGEDEV $IMAGELOC
> /bin/mount -tiso9660 -oloop $IMAGELOC/$IMAGENAME $SYSROOT
> /bin/mount -tproc /proc /$SYSROOT/proc
> 
> echo 0x0100 > /proc/sys/kernel/real-root-dev
> 
> echo Starting system
> cd $SYSROOT
> 
> #chroot . /bin/sh -c "exec /sbin/init 3" 
> chroot . /bin/bash
> 
> /bin/busybox msh


Steve,

The script seems inconsistent with the previous email:

        /dev/hda2 on /dos type vfat (rw,noatime, )
        /dev/loop0 on /sysroot type iso9660 (ro)
        /proc on /sysroot/proc type proc (rw,nodiratime)
        
/dev/hda2 hasn't been created, neither has /dev/loop0

Using the linuxrc script above, what happens if you cd /sysroot, then
run pivot_root . initrd?  /sysroot/initrd must exist.

When linuxrc exits the kernel should run init.  Is busybox compiled for
x86_64 and statically linked?

Other than that,I'm at a loss.

Maybe someone on the fedora-devel list might have some insight.


Bob...




More information about the fedora-list mailing list