• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

bootable/newinstaller


Commit MetaInfo

Revision19c5cfa60dfda6c6cf7a405ee9773957637d907f (tree)
Time2009-08-19 21:45:06
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

add grub4dos for live usb menu selection

Change Summary

Incremental Difference

--- a/Android.mk
+++ b/Android.mk
@@ -56,13 +56,15 @@ ANDROID_SRC := /android-system
5656 USB_BOOT := $(PRODUCT_OUT)/usb_boot
5757
5858 usb_tmp_img := $(PRODUCT_OUT)/usb_tmp.img
59-$(usb_tmp_img): $(BUILT_IMG) | $(MKEXT2IMG)
59+$(usb_tmp_img): $(wildcard $(LOCAL_PATH)/usb/*) $(BUILT_IMG) | $(ACP) $(MKEXT2IMG)
6060 rm -rf $(USB_BOOT)
6161 mkdir -p $(USB_BOOT)$(ANDROID_SRC)
62- echo -n "$(BOARD_KERNEL_CMDLINE) SRC=$(ANDROID_SRC)" > $(USB_BOOT)/cmdline
63- ln $^ $(USB_BOOT)
64- mv $(USB_BOOT)/{ramdisk.img,system.*} $(USB_BOOT)$(ANDROID_SRC)
65- mv $(USB_BOOT)/initrd.img $(USB_BOOT)/ramdisk
62+ touch $(USB_BOOT)/ramdisk
63+ echo 1 > $(USB_BOOT)/cmdline
64+ ln $(BUILT_IMG) $(USB_BOOT)$(ANDROID_SRC)
65+ $(ACP) -fp $(<D)/* $(<D)/../install/grub/android-x86.xpm.gz $(USB_BOOT)
66+ ln -s grub4dos $(USB_BOOT)/kernel
67+ $(hide) sed -i "s|VER|$(VER)|; s|CMDLINE|$(BOARD_KERNEL_CMDLINE)|" $(USB_BOOT)/menu.lst
6668 num_blocks=`du -sk $(USB_BOOT) | tail -n1 | awk '{print $$1;}'`; \
6769 num_inodes=`find $(USB_BOOT) | wc -l`; \
6870 $(MKEXT2IMG) -d $(USB_BOOT) -b `expr $$num_blocks + 20480` -N `expr $$num_inodes + 15` -m 0 $@
--- a/initrd/init
+++ b/initrd/init
@@ -8,6 +8,13 @@
88 # with Android-x86 project.
99 #
1010
11+try_mount()
12+{
13+ RW=$1; shift
14+ # FIXME: any way to mount ntfs gracefully?
15+ mount -o $RW $@ || mount.ntfs-3g -o rw,force $@
16+}
17+
1118 if [ -n "$DEBUG" ]; then
1219 LOG=/tmp/log
1320 set -x
@@ -27,6 +34,8 @@ export PATH=$PATH:/system/bin
2734 if [ -n "$DEBUG" -o -n "$INSTALL" ]; then
2835 mknod /dev/tty2 c 4 2 && openvt
2936 mknod /dev/tty3 c 4 3 && openvt
37+else
38+ echo 0 0 0 0 > /proc/sys/kernel/printk
3039 fi
3140
3241 echo -n Detecting Android...
@@ -35,10 +44,7 @@ while [ 1 ]; do
3544 mdev -s
3645
3746 for device in /dev/sr* /dev/sd[a-z]*; do
38- # FIXME: any way to mount ntfs gracefully?
39- mount -o ro $device /mnt || \
40- mount.ntfs-3g -o rw $device /mnt || \
41- continue
47+ try_mount ro $device /mnt || continue
4248 cd /mnt/$SRC
4349 if [ ! -e ramdisk.img -o ! \( -e system.img -o -e system.sfs \) ]; then
4450 cd /
--- a/install/scripts/1-install
+++ b/install/scripts/1-install
@@ -103,11 +103,7 @@ install_to()
103103 mountpoint -q /hd && umount /hd
104104 while [ 1 ]; do
105105 format_fs $1
106- for m in mount /sbin/mount.*; do
107- # FIXME: how to mount fuse filesystem automatically?
108- $m /dev/$1 /hd && break
109- done
110- [ $? -eq 0 ] && break
106+ try_mount rw /dev/$1 /hd && break
111107 dialog --clear --title " Error " --defaultno --yesno \
112108 "\n Cannot mount /dev/$1\n Do you want to format it?" 8 37
113109 [ $? -ne 0 ] && return 255
@@ -177,7 +173,6 @@ install_hd()
177173
178174 do_install()
179175 {
180- echo "0 0 0 0" > /proc/sys/kernel/printk
181176 until install_hd; do
182177 if [ $retval -eq 255 ]; then
183178 dialog --title ' Error! ' --yes-label Retry --no-label Reboot \
Binary files /dev/null and b/usb/grub4dos differ
--- /dev/null
+++ b/usb/menu.lst
@@ -0,0 +1,20 @@
1+default=0
2+timeout=6
3+root (hd0,0)
4+splashimage=/android-x86.xpm.gz
5+
6+title Live USB - Run Android without Installation
7+ kernel /android-system/kernel CMDLINE quiet SRC=/android-system
8+ initrd /android-system/initrd.img
9+
10+title Live USB - VESA Mode
11+ kernel /android-system/kernel CMDLINE quiet vga=788 SRC=/android-system
12+ initrd /android-system/initrd.img
13+
14+title Live USB - Debug Mode
15+ kernel /android-system/kernel CMDLINE vga=788 SRC=/android-system DEBUG=1
16+ initrd /android-system/initrd.img
17+
18+title Installation - Install Android VER to harddisk
19+ kernel /android-system/kernel CMDLINE quiet SRC=/android-system INSTALL=1 DEBUG=
20+ initrd /android-system/initrd.img