squashfs_script

########################################
mountroot()
{

mkdir /.tmpfs
mount -w -t tmpfs -o size=90% tmpfs /.tmpfs
mkdir -p /.tmpfs/.mnt
mkdir -p /.tmpfs/.sqfs
mount -r -t ext2 /dev/sda1 /.tmpfs/.mnt
losetup /dev/loop0 /.tmpfs/.mnt/fs-squashfs.squashfs
mount -r -t squashfs /dev/loop0 /.tmpfs/.sqfs
mkdir /.tmpfs/.overlay
# Probably redundant, but might be useful in the future for ejecting the CD
mkdir -p /.tmpfs/.overlay/dev/shm /.tmpfs/.overlay/proc
mkdir -m1777 /.tmpfs/.overlay/tmp
mkdir /.tmpfs/.cdrom
# Work around unionfs bug that causes tst-cancel16 glibc test to fail in Ch5
mkdir -m1777 /.tmpfs/.tmp
# Load the UnionFS module from the LiveCD.
#insmod /lib/unionfs.ko
# Join the overlay, cdrom and squashfs directories as a single directory
# under /.union
mkdir /.union
mount -w -t unionfs -o dirs=/.tmpfs/.overlay=rw:/.tmpfs/.cdrom=ro:/.tmpfs/.sqfs=ro unionfs /.union
# Then move the tmpfs directory (why?)
mount -o move /.tmpfs /.union/dev/shm
# Make the cdrom accessible as a device under the unionfs mount point.
# Make the tmp directory on the tmpfs accessible as tmp under the unionfs
# mount point.
mount -o bind /.union/dev/shm/.tmp /.union/tmp
#. /scripts/local

}

#####################################

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: