OSDN Git Service

Compress squashfs to system.sfs to avoid confused.
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 23 Jul 2009 04:03:09 +0000 (12:03 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 23 Jul 2009 04:03:09 +0000 (12:03 +0800)
Android.mk
initrd/init

index 5bf8768..aa4d3fd 100644 (file)
@@ -5,11 +5,16 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := newinstaller
 LOCAL_MODULE_TAGS := system_builder
 
+# use squashfs for iso, unless explictly disabled
+ifneq ($(USE_SQUASHFS),0)
+MKSQUASHFS = $(shell which mksquashfs)
+
 define build-squashfs-target
        $(if $(shell $(MKSQUASHFS) -version | grep "version [0-3].[0-9]"),\
                $(error Your mksquashfs is too old to work with kernel 2.6.29. Please upgrade to squashfs-tools 4.0))
        $(hide) $(MKSQUASHFS) $(1) $(2) -noappend
 endef
+endif
 
 initrd_dir := $(LOCAL_PATH)/initrd
 initrd_bin := \
@@ -27,7 +32,7 @@ $(installer_ramdisk): $(initrd_bin) | $(ACP) $(MKBOOTFS)
 boot_dir := $(LOCAL_PATH)/boot
 boot_bin := $(wildcard $(boot_dir)/isolinux/*)
 
-BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,ramdisk.img system.img initrd.img)
+BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,ramdisk.img system.$(if $(MKSQUASHFS),sfs,img) initrd.img)
 BUILT_IMG += $(if $(TARGET_PREBUILT_KERNEL),$(TARGET_PREBUILT_KERNEL),$(PRODUCT_OUT)/kernel)
 
 ISO_IMAGE := $(PRODUCT_OUT)/$(TARGET_PRODUCT).iso
@@ -41,9 +46,4 @@ $(ISO_IMAGE): $(BUILT_IMG) $(boot_bin)
 .PHONY: iso_img
 iso_img: $(ISO_IMAGE)
 
-# use squashfs for iso, unless explictly disabled
-ifneq ($(USE_SQUASHFS),0)
-iso_img: MKSQUASHFS = $(shell which mksquashfs)
-endif
-
 endif
index 5d7ba74..7c3a2de 100755 (executable)
@@ -37,18 +37,18 @@ while [ 1 ]; do
        for device in /dev/sr* /dev/sd[a-z]*; do
                mount -o ro $device /mnt || continue
                cd /mnt/$SRC
-               if [ ! -e ramdisk.img -o ! -e system.img ]; then
+               if [ ! -e ramdisk.img -o ! \( -e system.img -o -e system.sfs \) ]; 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 /sfs
-               if [ -e /sfs/system.img ]; then
-                       mount -o loop,ro /sfs/system.img system
+               if [ -e /mnt/$SRC/system.sfs ]; then
+                       mount -o loop /mnt/$SRC/system.sfs /sfs
+                       mount -o loop /sfs/system.img system
                else
-                       mount --move /sfs system
+                       mount -o loop /mnt/$SRC/system.img system
                fi
                mkdir cache sdcard
                mount -t tmpfs tmpfs cache