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 := \
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
.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
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