# Copyright 2009-2010, The Android-x86 Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ifeq ($(TARGET_ARCH),x86) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) VER ?= $(shell date +"%F") 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 define check-density eval d=$$(grep ^ro.sf.lcd_density $(INSTALLED_DEFAULT_PROP_TARGET) $(INSTALLED_BUILD_PROP_TARGET) | sed 's|\(.*\)=\(.*\)|\2|'); \ [ -z "$$d" ] || ( awk -v d=$$d ' BEGIN { \ if (d <= 180) { \ label="liveh"; dpi="HDPI"; \ } else { \ label="livem"; dpi="MDPI"; \ } \ } { \ if (match($$2, label)) \ s=5; \ else if (match($$0, dpi)) \ s=4; \ else \ s=0; \ for (i = 0; i < s; ++i) \ getline; \ gsub(" DPI=[0-9]*",""); print $$0; \ }' $(1) > $(1)_ && mv $(1)_ $(1) ) endef initrd_dir := $(LOCAL_PATH)/initrd initrd_bin := \ $(initrd_dir)/init \ $(wildcard $(initrd_dir)/*/*) systemimg := $(PRODUCT_OUT)/system.$(if $(MKSQUASHFS),sfs,img) INITRD_RAMDISK := $(PRODUCT_OUT)/initrd.img $(INITRD_RAMDISK): $(initrd_bin) $(systemimg) $(TARGET_INITRD_SCRIPTS) | $(ACP) $(MKBOOTFS) rm -rf $(TARGET_INSTALLER_OUT) $(ACP) -pr $(initrd_dir) $(TARGET_INSTALLER_OUT) $(if $(TARGET_INITRD_SCRIPTS),$(ACP) -p $(TARGET_INITRD_SCRIPTS) $(TARGET_INSTALLER_OUT)/scripts) ln -s /bin/ld-linux.so.2 $(TARGET_INSTALLER_OUT)/lib mkdir -p $(addprefix $(TARGET_INSTALLER_OUT)/,android mnt proc sys tmp sfs hd) echo "VER=$(VER)" > $(TARGET_INSTALLER_OUT)/scripts/00-ver $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@ INSTALL_RAMDISK := $(PRODUCT_OUT)/install.img $(INSTALL_RAMDISK): $(wildcard $(LOCAL_PATH)/install/*/*) | $(MKBOOTFS) $(TARGET_OUT_OPTIONAL_EXECUTABLES)/busybox $(if $(TARGET_INSTALL_SCRIPTS),$(ACP) -p $(TARGET_INSTALL_SCRIPTS) $(TARGET_INSTALLER_OUT)/scripts) $(MKBOOTFS) $(dir $(dir $( $@ boot_dir := $(PRODUCT_OUT)/boot $(boot_dir): $(wildcard $(LOCAL_PATH)/boot/isolinux/*) $(systemimg) $(GENERIC_X86_CONFIG_MK) | $(ACP) rm -rf $@ $(ACP) -pr $(dir $(