Hello aufs-users
I am using AUFS as my root filesystem, the latest AUFS1 from
aufs.cvs.sourceforge.net with Linux 2.6.21.5 running on MIPS.  The
issue I see is that immediately after switchroot busybox will seg
fault the first time.  If I do not use AUFS this does not happen.  To
work around the issue (found by trial and error) I can link /lib to
the newroot and run busybox once like this so it crashes and then run
switchroot--relevant init excerpt below.  So I guess some kind of
aufs-related library caching issue?  Has anyone seen something like
this before or might know a good place to find out more why this could
be happening?
Thanks much
Derek

...
echo "=== Using AUFS ==="
mount -t jffs2 /dev/mtdblock1 /mnt
mount -t tmpfs -o size=32M,nr_inodes=1k,mode=0700 tmpfs /rw
mount -t squashfs -o loop,ro /mnt/squashfs /sfs
mount -t aufs -o dirs=/rw:/sfs=ro none /newroot

echo "=== making newroot ==="
export ROOTFS=/newroot
/sfs/etc/MAKEDEV

mkdir /newroot/rw
mkdir /newroot/mnt
mkdir /newroot/sfs

mount --move /rw /newroot/rw
mount --move /mnt /newroot/mnt
mount --move /sfs /newroot/sfs
umount /cf
umount /proc

echo "=== Doing the crazy stuff to make it work ==="
rmdir /lib
ln -s /newroot/lib lib
echo "/newroot/bin/busybox" | /bin/sh

if [ $? -ne 0 ]; then
        getout
fi

echo "=== Calling switch_root ==="
exec switch_root -c /dev/console /newroot /sbin/init

echo "switch_root failed $?"

mount -t proc proc /proc
exec /bin/sh
...

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p

Reply via email to