pivot_root
David Jones
goofy_36@yahoo.com
Sat Feb 28 18:13:17 CET 2004
Hi All
Well good news and bad news. The good news is that I
have the pivot_root working automatically on boot.
The bad is that some process is holding the ramdisk
open so I haven't be able to free it's memory. Below
is is my setup for getting the pivot_root to work.
It's pretty much a hack. So, I'm sure we will have to
'fix' it. FYI The reason I ended up with this hack is
that the kernel kept crashing with a shell script
linuxrc script. It seems to want the linuxrc to be
busybox like the original ramdisk from George.
I'm probably going to over simplify this but thought
it would be safer this way. My 128 meg CF card is set
up with two partitions. One with 16 meg DOS space and
the rest going to Linux. I haven't set up a swap
space yet will try that later. Then I compiled and
installed the latest busybox with most options turned
on and put it on the CF Linux partition. Then I
copied any remaining non-busybox programs, libs from
Georges ramdisk to the CF card and created empty
directories for proc and dev. At this point the CF
Linux partiton should look like the ramdisk except for
the newer busybox and nothing mounted in dev and proc.
At this point, changed the /etc/init.d/rcS file on
the ramdisk to include the line /lrc ( this is my
script to get the pivot_root to work ). Then copy the
file 'lrc' to the root or the ramdisk and make it
runnable. You will have to modify this some if you
use different CF partiton layout or mount points. But
this does work and gives us a starting point.
Dave
This is the current /etc/init.d/rcS from my ramdisk.
#! /bin/sh
echo "Executing rcS"
/lrc
/bin/mount -a
/bin/cardmgr
telnetd -l /bin/sh
This is the current 'lrc' script I use
#!/bin/sh
echo --- starting linuxrc --
echo --- startingg cardmgr
mount proc
cardmgr
echo --- sleeping 10 sec to give cardmgr time to see
cf card
sleep 5
echo ---- mounting cf card linux partition
mount /dev/hda2 /mnt/cf
cd /mnt/cf
echo ---- doing pivot_root to cf card
sbin/pivot_root . initrd
mount devfs
mount proc
echo ---- exiting linuxrc
__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
More information about the Jornada820
mailing list