#!/bin/sh echo Starting System... mount -t proc proc /proc if [ -n "$XANDROSBOOTDEBUG" ]; then /bin/busybox sh set -x fi ROOT=`cat /proc/cmdline | sed 's/.*root=// ; s/ .*//'` USER=`cat /proc/cmdline | sed 's/.*eee_user=// ; s/ .*//'` VERSION=`cat /proc/version | cut -f3 -d" "` mount -t ext2 -o ro $ROOT /mnt-system if [ $? -ne 0 ]; then echo Could not mount OS on $ROOT. Starting debugging shell.... /bin/busybox sh fi # load some useful things insmod /mnt-system/lib/modules/$VERSION/kernel/drivers/usb/core/usbcore.ko > /dev/null insmod /mnt-system/lib/modules/$VERSION/kernel/drivers/usb/host/ehci-hcd.ko > /dev/null insmod /mnt-system/lib/modules/$VERSION/kernel/drivers/usb/storage/libusual.ko > /dev/null insmod /mnt-system/lib/modules/$VERSION/kernel/drivers/usb/storage/usb-storage.ko > /dev/null insmod /modules/dm-mod.ko insmod /modules/dm-crypt.ko insmod /mnt-system/lib/modules/$VERSION/kernel/crypto/aes.ko insmod /mnt-system/lib/modules/$VERSION/kernel/crypto/blkcipher.ko insmod /mnt-system/lib/modules/$VERSION/kernel/crypto/cbc.ko insmod /mnt-system/lib/modules/$VERSION/kernel/crypto/sha256.ko insmod /mnt-system/lib/modules/$VERSION/kernel/crypto/cryptomgr.ko if [ $USER = "ram" ]; then mount -t tmpfs tmpfs /mnt-user retval=$? mkdir -p /mnt-user/home/user /mnt-system/bin/chown 1000:1000 /mnt-user/home/user echo -n > /mnt-user/home/user/.firstrundone else echo Waiting for user overlay device $USER while ! grep -q $USER /proc/partitions; do sleep 1; done echo User overlay found. if cryptsetup isLuks /dev/$USER; then cryptsetup luksOpen /dev/$USER ${USER}_crypt USER=dm-0 fi mount -t ext3 -o rw,noatime,nodiratime /dev/$USER /mnt-user retval=$? fi if [ $retval -ne 0 ]; then echo Error mounting user partition. Starting debugging shell.... /bin/busybox sh fi if [ -n "$XANDROSBOOTDEBUG" ]; then /bin/busybox sh fi mount -t unionfs -o dirs=/mnt-user=rw:/mnt-system=ro unionfs /mnt if [ $? -ne 0 ]; then echo Could not mount unionfs. Starting debugging shell.... /bin/busybox sh fi mount --move /mnt-system /mnt/mnt umount -l /mnt-user umount /proc if [ -n "$INIT" ]; then if [ -n "$XANDROSBOOTDEBUG" ]; then exec switch_root /mnt $INIT /mnt/dev/console else exec switch_root /mnt $INIT /mnt/dev/null fi else exec switch_root /mnt /sbin/fastinit "$@" /mnt/dev/console fi echo echo Init Failed. Starting emergency shell.... /bin/busybox sh