OSDN Git Service

add squashfs support
[android-x86/bootable-newinstaller.git] / Android.mk
1 ifeq ($(TARGET_ARCH),x86)
2 LOCAL_PATH := $(call my-dir)
3 include $(CLEAR_VARS)
4
5 LOCAL_MODULE := newinstaller
6 LOCAL_MODULE_TAGS := system_builder
7
8 define build-squashfs-target
9         $(if $(shell $(MKSQUASHFS) -version | grep "version [0-3].[0-9]"),\
10                 $(error Your mksquashfs is too old to work with kernel 2.6.29. Please upgrade to squashfs-tools 4.0))
11         $(hide) $(MKSQUASHFS) $(1) $(2) -noappend
12 endef
13
14 initrd_dir := $(LOCAL_PATH)/initrd
15 initrd_bin := \
16         $(initrd_dir)/init \
17         $(wildcard $(initrd_dir)/*/*)
18
19 installer_ramdisk := $(PRODUCT_OUT)/initrd.img
20 $(installer_ramdisk): $(initrd_bin) | $(ACP)
21         rm -rf $(TARGET_INSTALLER_OUT)
22         $(ACP) -pr $(initrd_dir) $(TARGET_INSTALLER_OUT)
23         ln -s /bin/ld-linux.so.2 $(TARGET_INSTALLER_OUT)/lib
24         mkdir -p $(addprefix $(TARGET_INSTALLER_OUT)/,android mnt proc sys sbin tmp sfs)
25         $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@
26
27 boot_dir := $(LOCAL_PATH)/boot
28 boot_bin := $(wildcard $(boot_dir)/isolinux/*)
29
30 BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,ramdisk.img system.img initrd.img)
31 BUILT_IMG += $(if $(TARGET_PREBUILT_KERNEL),$(TARGET_PREBUILT_KERNEL),$(PRODUCT_OUT)/kernel)
32
33 ISO_IMAGE := $(PRODUCT_OUT)/$(TARGET_PRODUCT).iso
34 $(ISO_IMAGE): $(BUILT_IMG) $(boot_bin)
35         @echo ----- Making iso image ------
36         genisoimage -vJURT -b isolinux/isolinux.bin -c isolinux/boot.cat \
37                 -no-emul-boot -boot-load-size 4 -boot-info-table \
38                 -input-charset utf-8 -V "Android LiveCD" -o $@ \
39                 $(boot_dir) $(BUILT_IMG)
40
41 .PHONY: iso_img
42 iso_img: $(ISO_IMAGE)
43
44 # use squashfs for iso, unless explictly disabled
45 ifneq ($(USE_SQUASHFS),0)
46 iso_img: MKSQUASHFS = $(shell which mksquashfs)
47 endif
48
49 endif