3 # By Chih-Wei Huang <cwhuang@linux.org.tw>
4 # Last updated 2009/07/18
6 # License: GNU Public License
7 # We explicitely grant the right to use the scripts
8 # with Android-x86 project.
11 if [ -n "$DEBUG" ]; then
16 [ -e $LOG ] || busybox mknod $LOG c 1 3
20 busybox mount -t proc proc /proc
21 busybox mount -t sysfs sys /sys
25 export PATH=$PATH:/system/bin
27 if [ -n "$DEBUG" ]; then
28 mknod /dev/tty2 c 4 2 && openvt
29 mknod /dev/tty3 c 4 3 && openvt
32 echo -n Detecting Android...
37 for device in /dev/sr* /dev/sd[a-z]*; do
38 mount $device /mnt || continue
40 if [ ! -e ramdisk.img -o ! -e system.img ]; then
44 mount -t tmpfs tmpfs /android
46 zcat /mnt/$SRC/ramdisk.img | cpio -id > /dev/null
47 mount -o loop,ro /mnt/$SRC/system.img /sfs
48 if [ -e /sfs/system.img ]; then
49 mount -o loop,ro /sfs/system.img system
51 mount --move /sfs system
54 mount -t tmpfs tmpfs cache
55 echo " found at $device"
58 mountpoint -q /android && break
61 if [ -n "$DEBUG" ]; then
62 echo -e "\nType 'exit' to continue booting...\n"
67 ln -s android/system /
69 ln -s ../system/lib/modules /lib
71 if [ -n "$DATA" ]; then
73 elif [ -d /mnt/$SRC/data ]; then
74 mount --bind /mnt/$SRC/data data
76 mount -t tmpfs tmpfs data
78 if [ -n "$SDCARD" ]; then
80 elif [ -d /mnt/$SRC/sdcard ]; then
81 mount --bind /mnt/$SRC/sdcard sdcard
83 mount -t tmpfs tmpfs sdcard
87 for s in `ls /scripts/* /mnt/$SRC/scripts/*`; do
93 [ -n "$INSTALL" ] && install_hd
95 if [ -n "$DEBUG" ]; then
96 echo -e "\nUse Alt-F1/F2/F3 to switch between virtual consoles"
97 echo -e "Type 'exit' to enter Android...\n"
99 # FIXME: all error messages in the shell are sent to $LOG
101 chroot /android /init
103 exec switch_root /android /init
106 sh # aviod kernel panic