# Make kernel don't mount root fs
echo 0x100 > /proc/sys/kernel/real-root-dev
echo "Mounting root filesystem"
udevstart
mount -t squashfs -oloop,ro /cdrom/NeoShine.sqsh /sysroot
echo "Doing the pivot_root"
cd /sysroot
pivot_root /sysroot /sysroot/initrd
cd /
# Mount a (writeable) ramfs at dev and populate it with nodes:
mount -n -t ramfs initrd_dev /dev
cd /dev
for node in mem kmem null port zero core full ram ptmx tty pty shm cpu input agpgart dri cdrom console; do
/initrd/sbin/MAKEDEV $node
done
mkdir /dev/shm
mkdir /dev/pts
mount -n -t devpts initrd_devpts /dev/pts
echo "Setting up readonly-root"
/etc/rc.neoshine
[/code:1]
===============================================
NeoShine.sqsh中的/etc/rc.neoshine
[code:1]#!/bin/bash
mount_file() {
if [ -e ${1} ] && [ -e /livecd/tmpfs${1} ]; then
mount -n --bind /livecd/tmpfs${1} ${1}
fi
}
echo "Mounting tmpfs on /livecd/tmpfs"
mount -t tmpfs none /livecd/tmpfs
echo "Mounting ramfs on /livecd/ramfs"
mount -t ramfs none /livecd/ramfs
echo "Extracting files to /livecd/tmpfs"
tar --directory /livecd/tmpfs -zxf /livecd/neoshine.tar.gz >/dev/null 2>&1
echo "Binding files from /livecd/tmpfs to their original locations"
mount_file /tmp
chmod a+rwxt /livecd/tmpfs/tmp