Re: FC4 CF-based Router

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


#!/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


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux