OSDN Git Service

add squashfs support
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 10 Jul 2009 09:29:04 +0000 (17:29 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 10 Jul 2009 12:39:33 +0000 (20:39 +0800)
Android.mk
initrd/init

index e99209b..0e9573e 100644 (file)
@@ -2,11 +2,15 @@ ifeq ($(TARGET_ARCH),x86)
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-#LIVECD_PATH := $(LOCAL_PATH)
-
 LOCAL_MODULE := newinstaller
 LOCAL_MODULE_TAGS := system_builder
 
+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
+
 initrd_dir := $(LOCAL_PATH)/initrd
 initrd_bin := \
        $(initrd_dir)/init \
@@ -17,7 +21,7 @@ $(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)
+       mkdir -p $(addprefix $(TARGET_INSTALLER_OUT)/,android mnt proc sys sbin tmp sfs)
        $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@
 
 boot_dir := $(LOCAL_PATH)/boot
@@ -37,4 +41,9 @@ $(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 7664e9c..076513b 100755 (executable)
@@ -36,7 +36,12 @@ while [ 1 ]; do
                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
+               mount -o loop,ro /mnt/$SRC/system.img /sfs
+               if [ -e /sfs/system.img ]; then
+                       mount -o loop,ro /sfs/system.img system
+               else
+                       mount --move /sfs system
+               fi
                mkdir cache sdcard
                mount -t tmpfs tmpfs data
                mount -t tmpfs tmpfs cache