OSDN Git Service

initial import
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 9 Jul 2009 09:54:28 +0000 (17:54 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 9 Jul 2009 09:54:28 +0000 (17:54 +0800)
17 files changed:
Android.mk [new file with mode: 0644]
boot/isolinux/isolinux.bin [new file with mode: 0644]
boot/isolinux/isolinux.cfg [new file with mode: 0644]
boot/isolinux/splash.png [new file with mode: 0644]
boot/isolinux/vesamenu.c32 [new file with mode: 0644]
initrd/bin/busybox [new file with mode: 0755]
initrd/bin/cfdisk [new file with mode: 0755]
initrd/bin/dialog [new file with mode: 0755]
initrd/bin/ld-linux.so.2 [new file with mode: 0755]
initrd/init [new file with mode: 0755]
initrd/lib/libc.so.6 [new file with mode: 0644]
initrd/lib/libcrypt.so.1 [new file with mode: 0644]
initrd/lib/libdl.so.2 [new file with mode: 0644]
initrd/lib/libm.so.6 [new file with mode: 0644]
initrd/lib/libncursesw.so.5 [new file with mode: 0644]
initrd/lib/libtinfo.so.5 [new file with mode: 0755]
initrd/lib/terminfo/l/linux [new file with mode: 0644]

diff --git a/Android.mk b/Android.mk
new file mode 100644 (file)
index 0000000..e99209b
--- /dev/null
@@ -0,0 +1,40 @@
+ifeq ($(TARGET_ARCH),x86)
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+#LIVECD_PATH := $(LOCAL_PATH)
+
+LOCAL_MODULE := newinstaller
+LOCAL_MODULE_TAGS := system_builder
+
+initrd_dir := $(LOCAL_PATH)/initrd
+initrd_bin := \
+       $(initrd_dir)/init \
+       $(wildcard $(initrd_dir)/*/*)
+
+installer_ramdisk := $(PRODUCT_OUT)/initrd.img
+$(installer_ramdisk): $(initrd_bin) | $(ACP)
+       rm -rf $(TARGET_INSTALLER_OUT)
+       $(ACP) -pr $(initrd_dir) $(TARGET_INSTALLER_OUT)
+       ln -s /bin/ld-linux.so.2 $(TARGET_INSTALLER_OUT)/lib
+       mkdir -p $(addprefix $(TARGET_INSTALLER_OUT)/,android mnt proc sys sbin tmp)
+       $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@
+
+boot_dir := $(LOCAL_PATH)/boot
+boot_bin := $(wildcard $(boot_dir)/isolinux/*)
+
+BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,ramdisk.img system.img initrd.img)
+BUILT_IMG += $(if $(TARGET_PREBUILT_KERNEL),$(TARGET_PREBUILT_KERNEL),$(PRODUCT_OUT)/kernel)
+
+ISO_IMAGE := $(PRODUCT_OUT)/$(TARGET_PRODUCT).iso
+$(ISO_IMAGE): $(BUILT_IMG) $(boot_bin)
+       @echo ----- Making iso image ------
+       genisoimage -vJURT -b isolinux/isolinux.bin -c isolinux/boot.cat \
+               -no-emul-boot -boot-load-size 4 -boot-info-table \
+               -input-charset utf-8 -V "Android LiveCD" -o $@ \
+               $(boot_dir) $(BUILT_IMG)
+
+.PHONY: iso_img
+iso_img: $(ISO_IMAGE)
+
+endif
diff --git a/boot/isolinux/isolinux.bin b/boot/isolinux/isolinux.bin
new file mode 100644 (file)
index 0000000..5df9556
Binary files /dev/null and b/boot/isolinux/isolinux.bin differ
diff --git a/boot/isolinux/isolinux.cfg b/boot/isolinux/isolinux.cfg
new file mode 100644 (file)
index 0000000..493970c
--- /dev/null
@@ -0,0 +1,28 @@
+default vesamenu.c32
+#prompt 1
+timeout 600
+
+menu background splash.png
+menu title Android Live & Installation CD
+menu color border 0 #ffffffff #00000000
+menu color sel 7 #ffffffff #ff000000
+menu color title 0 #ffffffff #00000000
+menu color tabmsg 0 #ffffffff #00000000
+menu color unsel 0 #ffffffff #00000000
+menu color hotsel 0 #ff000000 #ffffffff
+menu color hotkey 7 #ffffffff #ff000000
+
+label live
+       menu label Live CD - Run Android without installation
+       kernel /kernel
+       append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc vga=788
+
+label debug
+       menu label Live CD - Debug mode
+       kernel /kernel
+       append initrd=/initrd.img root=/dev/ram0 androidboot.hardware=eeepc vga=788 DEBUG=1
+
+label install
+       menu label Installation - Install Android to harddisk
+       kernel /kernel
+       append initrd=/initrd.img root=/dev/ram0 console=ttyS1,115200n8 console=tty0 androidboot.hardware=eeepc vga=788 INSTALL=1
diff --git a/boot/isolinux/splash.png b/boot/isolinux/splash.png
new file mode 100644 (file)
index 0000000..8ed3627
Binary files /dev/null and b/boot/isolinux/splash.png differ
diff --git a/boot/isolinux/vesamenu.c32 b/boot/isolinux/vesamenu.c32
new file mode 100644 (file)
index 0000000..7eafbc4
Binary files /dev/null and b/boot/isolinux/vesamenu.c32 differ
diff --git a/initrd/bin/busybox b/initrd/bin/busybox
new file mode 100755 (executable)
index 0000000..b934dfd
Binary files /dev/null and b/initrd/bin/busybox differ
diff --git a/initrd/bin/cfdisk b/initrd/bin/cfdisk
new file mode 100755 (executable)
index 0000000..869ea13
Binary files /dev/null and b/initrd/bin/cfdisk differ
diff --git a/initrd/bin/dialog b/initrd/bin/dialog
new file mode 100755 (executable)
index 0000000..371455a
Binary files /dev/null and b/initrd/bin/dialog differ
diff --git a/initrd/bin/ld-linux.so.2 b/initrd/bin/ld-linux.so.2
new file mode 100755 (executable)
index 0000000..a4a6d5f
Binary files /dev/null and b/initrd/bin/ld-linux.so.2 differ
diff --git a/initrd/init b/initrd/init
new file mode 100755 (executable)
index 0000000..7664e9c
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/busybox sh
+
+if [ -n "$DEBUG" ]; then
+       LOG=/tmp/log
+       set -x
+else
+       LOG=/dev/null
+       [ -e $LOG ] || busybox mknod $LOG c 1 3
+fi
+exec 2> $LOG
+
+busybox mount -t proc proc /proc
+busybox mount -t sysfs sys /sys
+
+busybox --install -s
+
+export PATH=$PATH:/system/bin
+
+if [ -n "$DEBUG" ]; then
+       mknod /dev/tty2 c 4 2 && openvt
+       mknod /dev/tty3 c 4 3 && openvt
+fi
+
+echo -n Detecting Android...
+
+while [ 1 ]; do
+       mdev -s
+
+       for device in /dev/sr* /dev/sd[a-z]*; do
+               mount $device /mnt || continue
+               cd /mnt/$SRC
+               if [ ! -e ramdisk.img -o ! -e system.img ]; then
+                       umount /mnt
+                       continue
+               fi
+               mount -t tmpfs tmpfs /android
+               cd /android
+               zcat /mnt/$SRC/ramdisk.img | cpio -id > /dev/null
+               mount -o loop,ro /mnt/$SRC/system.img system
+               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 .
+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
+fi
+
+# load lan driver
+# TODO
+# load wifi driver
+# TODO
+
+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
+else
+       exec switch_root /android /init
+fi
+
+sh # aviod kernel panic
diff --git a/initrd/lib/libc.so.6 b/initrd/lib/libc.so.6
new file mode 100644 (file)
index 0000000..398893f
Binary files /dev/null and b/initrd/lib/libc.so.6 differ
diff --git a/initrd/lib/libcrypt.so.1 b/initrd/lib/libcrypt.so.1
new file mode 100644 (file)
index 0000000..de04710
Binary files /dev/null and b/initrd/lib/libcrypt.so.1 differ
diff --git a/initrd/lib/libdl.so.2 b/initrd/lib/libdl.so.2
new file mode 100644 (file)
index 0000000..2fd828a
Binary files /dev/null and b/initrd/lib/libdl.so.2 differ
diff --git a/initrd/lib/libm.so.6 b/initrd/lib/libm.so.6
new file mode 100644 (file)
index 0000000..05b50a4
Binary files /dev/null and b/initrd/lib/libm.so.6 differ
diff --git a/initrd/lib/libncursesw.so.5 b/initrd/lib/libncursesw.so.5
new file mode 100644 (file)
index 0000000..7316847
Binary files /dev/null and b/initrd/lib/libncursesw.so.5 differ
diff --git a/initrd/lib/libtinfo.so.5 b/initrd/lib/libtinfo.so.5
new file mode 100755 (executable)
index 0000000..e7ae3ad
Binary files /dev/null and b/initrd/lib/libtinfo.so.5 differ
diff --git a/initrd/lib/terminfo/l/linux b/initrd/lib/terminfo/l/linux
new file mode 100644 (file)
index 0000000..2c3ceb7
Binary files /dev/null and b/initrd/lib/terminfo/l/linux differ