OSDN Git Service

Update for multiple x86 platforms support
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 10 Dec 2009 07:43:32 +0000 (15:43 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 10 Dec 2009 07:43:32 +0000 (15:43 +0800)
A target should define its own detect_hardware function
in TARGET_INITRD_SCRIPTS.

Android.mk
initrd/init
initrd/scripts/0-auto-detect
initrd/scripts/1-install

index 2e2b61f..efd74b0 100644 (file)
@@ -24,12 +24,13 @@ initrd_bin := \
        $(wildcard $(initrd_dir)/*/*)
 
 INITRD_RAMDISK := $(PRODUCT_OUT)/initrd.img
-$(INITRD_RAMDISK): $(initrd_bin) | $(ACP) $(MKBOOTFS)
+$(INITRD_RAMDISK): $(initrd_bin) $(TARGET_INITRD_SCRIPTS) | $(ACP) $(MKBOOTFS)
        rm -rf $(TARGET_INSTALLER_OUT)
        $(ACP) -pr $(initrd_dir) $(TARGET_INSTALLER_OUT)
+       $(if $(TARGET_INITRD_SCRIPTS),$(ACP) -p $(TARGET_INITRD_SCRIPTS) $(TARGET_INSTALLER_OUT)/scripts)
        ln -s /bin/ld-linux.so.2 $(TARGET_INSTALLER_OUT)/lib
        mkdir -p $(addprefix $(TARGET_INSTALLER_OUT)/,android mnt proc sys tmp sfs hd)
-       echo "VER=$(VER)" > $(TARGET_INSTALLER_OUT)/scripts/10-ver
+       echo "VER=$(VER)" > $(TARGET_INSTALLER_OUT)/scripts/00-ver
        $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@
 
 INSTALL_RAMDISK := $(PRODUCT_OUT)/install.img
index bb69f43..130ef26 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/busybox sh
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2009/07/18
+# Last updated 2009/12/10
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -101,8 +101,20 @@ for s in `ls /scripts/* /mnt/$SRC/scripts/*`; do
        source $s
 done
 
-detect_hardware
-do_install
+# A target should provide its detect_hardware function.
+# On success, return 0 with the following values set.
+#
+# FB0DEV: framebuffer driver
+# LANDEV: lan driver
+# WIFDEV: wifi driver
+# SNDDEV: sound driver
+# CAMDEV: camera driver
+# PREDEV: any module the drivers depend on but can't be loaded automatically
+# EXTMOD: any other module
+
+[ "$AUTO" != "1" ] && detect_hardware 2> /dev/null && FOUND=1
+
+[ -n "$INSTALL" ] && do_install
 
 load_modules
 mount_data
index 9805f9a..3ace761 100644 (file)
@@ -1,12 +1,18 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2009/08/14
+# Last updated 2009/12/10
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
 # with Android-x86 project.
 #
 
+error()
+{
+       echo $*
+       return 1
+}
+
 # An auto detect function provided by kinneko
 auto_detect()
 {
@@ -19,110 +25,6 @@ auto_detect()
        cat /sys/bus/*/devices/*/modalias | dev2mod
 }
 
-# FB0DEV: framebuffer driver
-# LANDEV: lan driver
-# WIFDEV: wifi driver
-# SNDDEV: sound driver
-# CAMDEV: camera driver
-# PREDEV: any module the drivers depend on but can't be loaded automatically
-# EXTMOD: any other module
-
-asus_info()
-{
-       # common for all Eee PC models
-       [ -c /dev/fb0 ] || FB0DEV=i915
-       EXTMOD=eeepc-laptop
-       PREDEV=snd-hda-codec-realtek
-       SNDDEV=snd-hda-intel
-       CAMDEV=uvcvideo
-
-       board=`cat /sys/class/dmi/id/product_name`
-       # assume Eee PC models
-       case "$board" in
-               700|701|702|900)
-                       LANDEV=atl2
-                       WIFDEV=ath5k
-                       ;;
-               701SD|900SD)
-                       LANDEV=atl1e
-                       WIFDEV=rtl8187se
-                       ;;
-               900A|904HD|1000HD)
-                       LANDEV=atl1e
-                       WIFDEV=ath5k
-                       ;;
-               901|1000|1000H)
-                       LANDEV=atl1e
-                       WIFDEV=rt2860sta
-                       ;;
-               ET1602*)
-                       FB0DEV=
-                       UVESA_MODE=${UVESA_MODE:-1366x768}
-                       LANDEV=r8169
-                       WIFDEV=rt2860sta
-                       ;;
-               T91)
-                       FB0DEV=
-                       UVESA_MODE=${UVESA_MODE:-1024x600}
-                       LANDEV=atl1e
-                       WIFDEV=ath9k
-                       ;;
-               A6VM*)
-                       EXTMOD=asus-laptop
-                       LANDEV=skge
-                       WIFDEV=ipw2200
-                       ;;
-               *)
-                       LANDEV=atl1e
-                       WIFDEV=ath9k
-                       ;;
-       esac
-}
-
-vbox_info()
-{
-       LANDEV=pcnet32
-       SNDDEV="snd-sb16 isapnp=0 irq=5"
-       VESA=1
-}
-
-qemu_info()
-{
-       LANDEV=8139cp
-       SNDDEV=snd-ens1370
-}
-
-vmware_info()
-{
-       LANDEV=pcnet32
-       SNDDEV=snd-ens1371
-}
-
-detect_hardware()
-{
-       [ "$AUTO" = "1" ] && return
-       case "`cat /sys/class/dmi/id/uevent`" in
-               *ASUSTeK*)
-                       get_info=asus_info
-                       ;;
-               *Acer*AO*)
-                       get_info=ao_info
-                       ;;
-               *VirtualBox*)
-                       get_info=vbox_info
-                       ;;
-               *QEMU*)
-                       get_info=qemu_info
-                       ;;
-               *VMware*)
-                       get_info=vmware_info
-                       ;;
-               *)
-                       ;;
-       esac
-       [ -n "$get_info" ] && $get_info && FOUND=1
-}
-
 find_network_dev_name()
 {
        wififound=0
index 9ba86f3..676619d 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2009/08/17
+# Last updated 2009/12/10
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -9,6 +9,6 @@
 
 do_install()
 {
-       [ -z "$INSTALL" ] && return
-       dialog --title " WARNING " --msgbox '\n  Installation is not implemented yet.\n  Press OK to run live version.' 8 45
+       error -e '\n  Android-x86 installer is not available.\n  Press RETURN to run live version.\n'
+       read
 }