USB_BOOT := $(PRODUCT_OUT)/usb_boot
usb_tmp_img := $(PRODUCT_OUT)/usb_tmp.img
-$(usb_tmp_img): $(BUILT_IMG) | $(MKEXT2IMG)
+$(usb_tmp_img): $(wildcard $(LOCAL_PATH)/usb/*) $(BUILT_IMG) | $(ACP) $(MKEXT2IMG)
rm -rf $(USB_BOOT)
mkdir -p $(USB_BOOT)$(ANDROID_SRC)
- echo -n "$(BOARD_KERNEL_CMDLINE) SRC=$(ANDROID_SRC)" > $(USB_BOOT)/cmdline
- ln $^ $(USB_BOOT)
- mv $(USB_BOOT)/{ramdisk.img,system.*} $(USB_BOOT)$(ANDROID_SRC)
- mv $(USB_BOOT)/initrd.img $(USB_BOOT)/ramdisk
+ touch $(USB_BOOT)/ramdisk
+ echo 1 > $(USB_BOOT)/cmdline
+ ln $(BUILT_IMG) $(USB_BOOT)$(ANDROID_SRC)
+ $(ACP) -fp $(<D)/* $(<D)/../install/grub/android-x86.xpm.gz $(USB_BOOT)
+ ln -s grub4dos $(USB_BOOT)/kernel
+ $(hide) sed -i "s|VER|$(VER)|; s|CMDLINE|$(BOARD_KERNEL_CMDLINE)|" $(USB_BOOT)/menu.lst
num_blocks=`du -sk $(USB_BOOT) | tail -n1 | awk '{print $$1;}'`; \
num_inodes=`find $(USB_BOOT) | wc -l`; \
$(MKEXT2IMG) -d $(USB_BOOT) -b `expr $$num_blocks + 20480` -N `expr $$num_inodes + 15` -m 0 $@
# with Android-x86 project.
#
+try_mount()
+{
+ RW=$1; shift
+ # FIXME: any way to mount ntfs gracefully?
+ mount -o $RW $@ || mount.ntfs-3g -o rw,force $@
+}
+
if [ -n "$DEBUG" ]; then
LOG=/tmp/log
set -x
if [ -n "$DEBUG" -o -n "$INSTALL" ]; then
mknod /dev/tty2 c 4 2 && openvt
mknod /dev/tty3 c 4 3 && openvt
+else
+ echo 0 0 0 0 > /proc/sys/kernel/printk
fi
echo -n Detecting Android...
mdev -s
for device in /dev/sr* /dev/sd[a-z]*; do
- # FIXME: any way to mount ntfs gracefully?
- mount -o ro $device /mnt || \
- mount.ntfs-3g -o rw $device /mnt || \
- continue
+ try_mount ro $device /mnt || continue
cd /mnt/$SRC
if [ ! -e ramdisk.img -o ! \( -e system.img -o -e system.sfs \) ]; then
cd /
mountpoint -q /hd && umount /hd
while [ 1 ]; do
format_fs $1
- for m in mount /sbin/mount.*; do
- # FIXME: how to mount fuse filesystem automatically?
- $m /dev/$1 /hd && break
- done
- [ $? -eq 0 ] && break
+ try_mount rw /dev/$1 /hd && break
dialog --clear --title " Error " --defaultno --yesno \
"\n Cannot mount /dev/$1\n Do you want to format it?" 8 37
[ $? -ne 0 ] && return 255
do_install()
{
- echo "0 0 0 0" > /proc/sys/kernel/printk
until install_hd; do
if [ $retval -eq 255 ]; then
dialog --title ' Error! ' --yes-label Retry --no-label Reboot \
--- /dev/null
+default=0
+timeout=6
+root (hd0,0)
+splashimage=/android-x86.xpm.gz
+
+title Live USB - Run Android without Installation
+ kernel /android-system/kernel CMDLINE quiet SRC=/android-system
+ initrd /android-system/initrd.img
+
+title Live USB - VESA Mode
+ kernel /android-system/kernel CMDLINE quiet vga=788 SRC=/android-system
+ initrd /android-system/initrd.img
+
+title Live USB - Debug Mode
+ kernel /android-system/kernel CMDLINE vga=788 SRC=/android-system DEBUG=1
+ initrd /android-system/initrd.img
+
+title Installation - Install Android VER to harddisk
+ kernel /android-system/kernel CMDLINE quiet SRC=/android-system INSTALL=1 DEBUG=
+ initrd /android-system/initrd.img