Hello,
I'm setting up a computer to use AUFS as the root partition with a read-only base installation, and a rewritable partition that is cleared each boot. I have this working, but for some reason when in this mode I can't connect to the network. The network manager gets to two green orbs and then fails.
Here is my script (placed in init-bottom):
Code:
#!/bin/sh
PREREQ=""
prereqs(){
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
for p in `cat /proc/cmdline`; do
case "$p" in
*=*) eval $p;;
*) eval $p=1;;
esac 2> /dev/null
done
test "$aufs" = "on" || exit 0
modprobe -q aufs
mkdir -p /rw /ro /union
mount --move $rootmnt /ro
mount /dev/sda2 /rw
rm -R /rw/*
mount -t aufs -o br:/rw:/ro none /union
# Change root to union fs
mkdir -p /union/.ufs /union/.ufs/ro /union/.ufs/rw
mount --move /ro /union/.ufs/ro
mount --move /rw /union/.ufs/rw
mount --move /union $rootmnt
# Generate new fstab
fstab=$rootmnt/etc/fstab
cat <<EOF > $fstab
none / tmpfs defaults 0 0
$root /.ufs/ro ext3 ro,noatime,nodiratime 0 0
EOF
cat $rootmnt/ro/etc/fstab | grep -v $root | grep -v tmpfs >> $fstab
cat <<EOF >> $fstab
/dev /.ufs/ro/dev none bind 0 0
/dev/pts /.ufs/ro/dev/pts none bind 0 0
/sys /.ufs/ro/sys none bind 0 0
/proc /.ufs/ro/proc none bind 0 0
#/mnt/sda1 /.ufs/ro/mnt/sda1 none bind 0 0
EOF
exit 0;
I'm guessing that the system is brining up the network interfaces before this script runs and that's messing things up, but I have no idea how to fix it.
Bookmarks