FC4 CF-based Router

Steven Ringwald asric at asric.com
Thu Dec 15 16:18:19 UTC 2005


Bob Chiodini wrote:

>A couple of questions:  Is your mount command coming from busybox?  
>

Nash, I think, so it might be busybox.

>Can
>you mount -o remount,ro the file system?  noatime,ro in fstab is how it
>was done on one of the embedded systems I was working on, but it was not
>CF based. 	
>s 
>
>  
>
If I put it in right before the switchroot command, it "seems" to lock 
it. (This is what I was doing when I was trying to debug it; I started 
with the fstab, and then moved further in).

>
>	
>
>aph what is 
>
>Presuming busybox:  Are you mounting the file system with the --ro
>option in your linuxrc file?  This is the linuxrc file I used, but I
>cannot verify that it worked correctly, WRT mounting the root file
>system ro, I thought so:
>  
>

Yes. The command is mount -o defaults --ro -t ext2 /dev/hda3 /sysroot

>#!/bin/nash
>
>echo Mounting /proc filesystem
>mount -t proc /proc /proc
>echo Creating root device
>mkrootdev /dev/root
>echo 0x0100 > /proc/sys/kernel/real-root-dev
>echo Mounting root filesystem
>mount --ro -t ext3 /dev/root /sysroot
>umount /proc
>pivot_root /sysroot /sysroot/initrd
>
>This was a 2.4 kernel, based system.  It started out from RH7.  Nash was
>probably the only piece that was kept.
>

Basically, what I would *like* is this.

I have a 256mb CF device. I want to slice 10mb or so off, format it 
ext2, and put grub in it.
The rest of the flash has a vfat filesystem on it, so that I can muck 
with kernel installs/etc from most any machine, rather than tying myself 
to Linux/BSD.

In my initrd, I have the file init (I basically created the sucker with 
mkinitrd, and tailored this file to suit my needs):

echo Mounting Root filesystem
mkdir /dos
mount -o defaults --ro -t vfat /dev/hda2 /dos # I have tried this with 
and without the ro flag
find / -name system.vhd # from the boot screen, this reports 
//dos/system.vhd

losetup /dev/loop0 /dos/system.vhd
mount -o defaults --ro -t ext2 /dev/loop /sysroot # also, with and 
without the ro flag

echo Switching to new root
switchroot --movedev /sysroot

When the system starts, it ends up dying during the losetup phase with 
"bio too big device loop0".


Steve




More information about the users mailing list