label live
menu label Live CD - Run Android without installation
kernel /kernel
- append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc
+ append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc quiet
label vesa
menu label Live CD - VESA mode
kernel /kernel
- append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc vga=788
+ append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc vga=788 quiet
label debug
menu label Live CD - Debug mode
mount --move /sfs system
fi
mkdir cache sdcard
- mount -t tmpfs tmpfs data
mount -t tmpfs tmpfs cache
- mount -t tmpfs tmpfs sdcard
echo " found at $device"
break
done
mountpoint -q /android && break
sleep 1
echo -n .
+ if [ -n "$DEBUG" ]; then
+ echo -e "\nType 'exit' to continue booting...\n"
+ sh
+ fi
done
ln -s android/system /
ln -s ../system/lib/modules /lib
-# load framebuffer driver
-if [ ! -e /dev/fb0 ]; then
- modprobe drm
- # TODO: auto detect and load correct driver
- modprobe i915
+if [ -n "$DATA" ]; then
+ mount $DATA data
+elif [ -d /mnt/$SRC/data ]; then
+ mount --bind /mnt/$SRC/data data
+else
+ mount -t tmpfs tmpfs data
+fi
+if [ -n "$SDCARD" ]; then
+ mount $SDCARD sdcard
+elif [ -d /mnt/$SRC/sdcard ]; then
+ mount --bind /mnt/$SRC/sdcard sdcard
+else
+ mount -t tmpfs tmpfs sdcard
fi
-# load lan driver
-# TODO
-# load wifi driver
-# TODO
+# load scripts
+for s in `ls /scripts/* /mnt/$SRC/scripts/*`; do
+ source $s
+done
+
+for m in $ALL_MODULES; do
+ modprobe $m
+done
+
+[ -n "$INSTALL" ] && install_hd
if [ -n "$DEBUG" ]; then
echo -e "\nUse Alt-F1/F2/F3 to switch between virtual consoles"
echo -e "Type 'exit' to enter Android...\n"
-
# FIXME: all error messages in the shell are sent to $LOG
sh
chroot /android /init
--- /dev/null
+# TODO: implement a more generic auto detection by scanning /sys
+# For now we just look up the machine name.
+
+# FBDEV: framebuffer driver
+# LANDEV: lan driver
+# WIFDEV: wifi driver
+# SNDDEV: sound driver
+# CAMDEV: camera driver
+
+get_asus_info()
+{
+ board=`cat /sys/class/dmi/id/board_name`
+ # assume Eee PC models
+ case "$board" in
+ 700|701|900)
+ LANDEV=atl2
+ WIFDEV=ath5k
+ ;;
+ 701SD|900SD)
+ LANDEV=atl1e
+ WIFDEV=rtl8187se
+ ;;
+ 900A|904HD)
+ LANDEV=atl1e
+ WIFDEV=ath5k
+ ;;
+ *)
+ LANDEV=atl1e
+ WIFDEV=ath9k
+# WIFDEV=rt2860sta
+ ;;
+ esac
+
+ # common for all Eee PC models
+ FBDEV=i915
+ SNDDEV="snd-hda-codec-realtek snd-hda-intel"
+ CAMDEV=uvcvideo
+}
+
+get_vbox_info()
+{
+ LANDEV=pcnet32
+ SNDDEV=snd-intel8x0
+}
+
+get_qemu_info()
+{
+ LANDEV=8139cp
+ SNDDEV=snd-ens1370
+}
+
+check_product()
+{
+ grep -q "$1" /sys/class/dmi/id/uevent
+}
+
+detect_hardware()
+{
+ check_product ASUSTeK && get_asus_info
+ check_product VirtualBox && get_vbox_info
+ check_product QEMU && get_qemu_info
+}
+
+detect_hardware
+
+ALL_MODULES="$FBDEV $LANDEV $WIFDEV $SNDDEV $CAMDEV"