2 echo "Welcome to Vogue Linux"
4 mount -t proc proc /proc
6 mount -t sysfs sys /sys
16 while [ ! -d /sys/block/mmcblk0 ] ; do
17 echo "Waiting for SD Card"
23 # Try unpartitioned card
24 if [ ! -d /sys/block/mmcblk0/$partition ] ; then
29 echo "Running an fsck on the SD card"
30 dosfsck -y /dev/block/$partition
31 mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/$partition /sdcard
32 [ $? -eq 0 ] || fail "Failed to mount the SD card. Cannot continue."
34 CARD_PATH=`/bin/grep -o "rel_path=.*" /proc/cmdline | /bin/sed -e "s/.*rel_path=//g" -e "s/ .*//g"`
36 if [ "$CARD_PATH" = "" ];then
40 if [ -d /sdcard/$CARD_PATH ] ; then
41 card=/sdcard/$CARD_PATH
46 if [ -f $card/rootfs.img ] ; then
47 root="$card/rootfs.img"
49 elif [ -f $card/rootfs.sqsh ]; then
50 root="$card/rootfs.sqsh"
53 fail "Failed to find rootfs on SD Card. You need to unzip a rootfs zip file to the root of your SD card."
57 losetup /dev/block/loop2 $root
58 [ $? -eq 0 ] || fail "Failed to mount rootfs on SD Card."
60 if [ $SQUASHFS -eq 0 ]; then
61 e2fsck -y /dev/block/loop2
62 mount -t ext2 -o noatime,nodiratime,sync,ro /dev/block/loop2 /rfs
63 [ $? -eq 0 ] || fail "Failed to mount rootfs"
65 mount -t squashfs -o noatime,nodiratime,sync,ro /dev/block/loop2 /rfs
66 [ $? -eq 0 ] || fail "Failed to mount rootfs"
70 mount -t tmpfs -o size=100K tmpfs /rfs/dev
77 echo "Switching to rootfs..."
78 exec switch_root /rfs /init