+++ /dev/null
-#
-# Copyright (C) 2009-2011 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
-#
-ifeq ($(LINUX_KERNEL_VERSION),kernel-3.10)
-ifneq ($(strip $(MTK_EMULATOR_SUPPORT)),yes)
-ifneq ($(strip $(MTK_PROJECT_NAME)),)
-
-ifneq ($(wildcard $(call my-dir)/arch/$(TARGET_ARCH)/configs/$(KERNEL_DEFCONFIG)),)
-
-KERNEL_DIR := $(call my-dir)
-ROOTDIR := $(abspath $(TOP))
-
-ifneq ($(filter /% ~%,$(OUT_DIR)),)
-KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
-else
-KERNEL_OUT := $(ROOTDIR)/$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
-endif
-
-ifeq ($(TARGET_ARCH), arm64)
- ifeq ($(MTK_APPENDED_DTB_SUPPORT), yes)
- TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/Image.gz-dtb
- else
- TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/Image.gz
- endif
-else
- ifeq ($(MTK_APPENDED_DTB_SUPPORT), yes)
- TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/zImage-dtb
- else
- TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/zImage
- endif
-endif
-TARGET_PREBUILT_KERNEL_BIN := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/zImage.bin
-
-TARGET_KERNEL_CONFIG := $(KERNEL_OUT)/.config
-KERNEL_HEADERS_INSTALL := $(KERNEL_OUT)/usr
-
-ifneq ($(strip $(TARGET_NO_KERNEL)),true)
- INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
-else
- INSTALLED_KERNEL_TARGET :=
-endif
-
-ifeq ($(KERNEL_CROSS_COMPILE),)
-ifeq ($(TARGET_ARCH), arm64)
-KERNEL_CROSS_COMPILE := aarch64-linux-android-
-else
-KERNEL_CROSS_COMPILE := arm-eabi-
-endif
-endif
-
-$(KERNEL_OUT):
- mkdir -p $@
-
-.PHONY: kernel kernel-defconfig kernel-menuconfig clean-kernel
-kernel-menuconfig: | $(KERNEL_OUT)
- $(MAKE) -C $(KERNEL_DIR) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) MTK_TARGET_PROJECT=${MTK_TARGET_PROJECT} CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) ROOTDIR=$(ROOTDIR) menuconfig
-
-kernel-savedefconfig: | $(KERNEL_OUT)
- cp $(TARGET_KERNEL_CONFIG) $(KERNEL_DIR)/arch/$(TARGET_ARCH)/configs/$(KERNEL_DEFCONFIG)
-
-$(TARGET_PREBUILT_KERNEL): kernel
- @echo Done kernel
-
-$(TARGET_KERNEL_CONFIG) kernel-defconfig: $(KERNEL_DIR)/arch/$(TARGET_ARCH)/configs/$(KERNEL_DEFCONFIG) | $(KERNEL_OUT)
- $(MAKE) -C $(KERNEL_DIR) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) MTK_TARGET_PROJECT=${MTK_TARGET_PROJECT} CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) ROOTDIR=$(ROOTDIR) $(KERNEL_DEFCONFIG)
- $(MAKE) -C $(KERNEL_DIR) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) MTK_TARGET_PROJECT=${MTK_TARGET_PROJECT} CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) ROOTDIR=$(ROOTDIR) oldconfig
-
-$(KERNEL_HEADERS_INSTALL): $(TARGET_KERNEL_CONFIG) | $(KERNEL_OUT)
- $(MAKE) -C $(KERNEL_DIR) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) MTK_TARGET_PROJECT=${MTK_TARGET_PROJECT} CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) ROOTDIR=$(ROOTDIR) headers_install
-
-kernel: $(TARGET_KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL) | $(KERNEL_OUT)
- $(MAKE) -C $(KERNEL_DIR) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) MTK_TARGET_PROJECT=${MTK_TARGET_PROJECT} CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) ROOTDIR=$(ROOTDIR)
-
-$(INSTALLED_KERNEL_TARGET): kernel
-
-ifeq ($(strip $(MTK_HEADER_SUPPORT)),yes)
-$(TARGET_PREBUILT_KERNEL_BIN): $(TARGET_PREBUILT_KERNEL) | $(HOST_OUT_EXECUTABLES)/mkimage
- $(HOST_OUT_EXECUTABLES)/mkimage $< KERNEL 0xffffffff > $@
-
-$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL_BIN) | $(ACP)
- $(copy-file-to-target)
-else
-$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
- $(copy-file-to-target)
-endif
-
-clean-kernel:
- @rm -rf $(KERNEL_OUT)
-
-endif
-endif
-endif
-endif # Ifeq ($(LINUX_KERNEL_VERSION),kernel-3.10)
-
+++ /dev/null
-#!/bin/bash
-# Default settings
-verfile="android.ver"
-curcfg=".config"
-release="n"
-rebuild="n"
-clean="n"
-makeflags="-w"
-makedefs="V=0"
-makejobs=${MAKEJOBS}
-curdir=`pwd`
-if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ];then
- outdir=../${MTK_ROOT_OUT}/KERNEL_OBJ
- mkdir -p $outdir
- mkdir -p mediatek/custom
- ln -fns ../../../${MTK_ROOT_CUSTOM_OUT} mediatek/custom/out
-fi
-
-usage() {
- echo "Usage: $0 {release|rebuild|clean|silent|verbose|single} [config-xxx]"
- echo " config file will be generated if build with TARGET_PRODUCT"
- exit 1
-}
-
-make_clean() {
- echo "**** Cleaning ****"
- nice make ${makeflags} ${makedefs} distclean
-}
-
-
-# Main starts here
-while test -n "$1"; do
- case "$1" in
- release)
- release="y"
- ;;
- rebuild)
- rebuild="y"
- ;;
- clean)
- clean="y"
- ;;
- mrproper)
- mrproper="y"
- ;;
- silent)
- makeflags="-ws"
- makedefs="V=0"
- ;;
- verbose)
- makeflags="-w"
- makedefs="V=1"
- ;;
- single)
- makejobs=""
- ;;
- *)
- export TARGET_PRODUCT=$1
- ;;
- esac
- shift
-done
-
-source ../mediatek/build/shell.sh ../ kernel
-defcfg="${MTK_ROOT_GEN_CONFIG}/kconfig"
-if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- makeflags+=" O=$outdir"
-fi
-
-if [ ! -z $KMOD_PATH ]; then
- if [ ! -e $KMOD_PATH ]; then
- echo "Invalid KMOD_PATH:$KMOD_PATH"
- echo "CURDIR=$curdir"
- exit 1;
- fi
-fi
-
-# clean if it is necessary
-if [ "${clean}" == "y" ]; then
- if [ ! -z $KMOD_PATH ]; then
- echo "Clean kernel module PROJECT=$MTK_PROJECT PATH=$KMOD_PATH";
- if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- make M="$KMOD_PATH" O=$outdir clean
- else
- make M="$KMOD_PATH" clean
- fi
- exit $?
- else
- make_clean; exit $?;
- fi
-fi
-
-if [ "${mrproper}" == "y" ]; then
- make mrproper; exit $?;
-fi
-
-if [ "${rebuild}" == "y" ]; then make_clean; fi
-
-echo "**** Configuring / $defcfg / ****"
-# select correct configuration file
-if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- make mediatek-configs O=$outdir
-else
- make mediatek-configs
-fi
-
-# Config DRAM size according to central Project Configuration file setting
-# Todo:
-# Need a robust mechanism to control Kconfig content by central Config setting
-# Move below segment to a configuration file for extension
-if [ "$CUSTOM_DRAM_SIZE" == "3G" ]; then
- # Config DRAM size as 3G (0x18000000).
- sed --in-place=.orig \
- -e 's/\(CONFIG_MAX_DRAM_SIZE_SUPPORT=\).*/\10x18000000/' \
- $outdir/.config
-else
- if [ "$CUSTOM_DRAM_SIZE" == "2G" ]; then
- # Config DRAM size as 2G (0x10000000).
- sed --in-place=.orig \
- -e 's/\(CONFIG_MAX_DRAM_SIZE_SUPPORT=\).*/\10x10000000/' \
- -e 's/\(CONFIG_RESERVED_MEM_SIZE_FOR_PMEM=\).*/\10x1700000/' \
- $outdir/.config
- else
- if [ "$CUSTOM_DRAM_SIZE" == "4G" ]; then
- # Config DRAM size as 4G (0x20000000).
- sed --in-place=.orig \
- -e 's/\(CONFIG_MAX_DRAM_SIZE_SUPPORT=\).*/\10x20000000/' \
- $outdir/.config
- else
- if [ "$CUSTOM_DRAM_SIZE" == "6G" ]; then
- # Config DRAM size as 6G (0x30000000).
- sed --in-place=.orig \
- -e 's/\(CONFIG_MAX_DRAM_SIZE_SUPPORT=\).*/\10x30000000/' \
- -e 's/\(CONFIG_CMDLINE=.*\)"/\1 vmalloc=280M"/' \
- -e 's/.*\(CONFIG_HIGHMEM\).*/\1=y/' \
- -e '$ a\# CONFIG_HIGHPTE is not set' \
- -e '$ a\# CONFIG_DEBUG_HIGHMEM is not set' \
- $outdir/.config
- else
- if [ "$CUSTOM_DRAM_SIZE" == "8G" ]; then
- # Config DRAM size as 8G (0x40000000).
- sed --in-place=.orig \
- -e 's/\(CONFIG_MAX_DRAM_SIZE_SUPPORT=\).*/\10x40000000/' \
- -e 's/\(CONFIG_CMDLINE=.*\)"/\1 vmalloc=280M"/' \
- -e 's/.*\(CONFIG_HIGHMEM\).*/\1=y/' \
- -e '$ a\# CONFIG_HIGHPTE is not set' \
- -e '$ a\# CONFIG_DEBUG_HIGHMEM is not set' \
- $outdir/.config
- fi
- fi
- fi
- fi
-fi
-
-# update configuration
-nice make ${makeflags} ${makedefs} silentoldconfig
-
-if [ ! -z $KMOD_PATH ]; then
- echo "Build kernel module PROJECT=$MTK_PROJECT PATH=$KMOD_PATH";
- if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- make M="$KMOD_PATH" O=$outdir modules
- else
- make M="$KMOD_PATH" modules
- fi
- exit $?
-fi
-
-echo "**** Building ****"
-make ${makeflags} ${makejobs} ${makedefs}
-
-if [ $? -ne 0 ]; then exit 1; fi
-
-echo "**** Successfully built kernel ****"
-
-mkimg="${MTK_ROOT_BUILD}/tools/mkimage"
-if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- if [ "${TARGET_ARCH}" == "arm64" ]; then
- kernel_img="${outdir}/arch/arm64/boot/Image"
- if [ "${MTK_APPENDED_DTB_SUPPORT}" == "yes" ]; then
- kernel_zimg="${outdir}/arch/arm64/boot/Image.gz-dtb"
- else
- kernel_zimg="${outdir}/arch/arm64/boot/Image.gz"
- else
- kernel_img="${outdir}/arch/arm/boot/Image"
- if [ "${MTK_APPENDED_DTB_SUPPORT}" == "yes" ]; then
- kernel_zimg="${outdir}/arch/arm/boot/zImage-dtb"
- else
- kernel_zimg="${outdir}/arch/arm/boot/zImage"
- fi
-else
- if [ "${TARGET_ARCH}" == "arm64" ]; then
- kernel_img="${curdir}/arch/arm64/boot/Image"
- if [ "${MTK_APPENDED_DTB_SUPPORT}" == "yes" ]; then
- kernel_zimg="${curdir}/arch/arm64/boot/Image.gz-dtb"
- else
- kernel_zimg="${curdir}/arch/arm64/boot/Image.gz"
- else
- kernel_img="${curdir}/arch/arm/boot/Image"
- if [ "${MTK_APPENDED_DTB_SUPPORT}" == "yes" ]; then
- kernel_zimg="${curdir}/arch/arm/boot/zImage-dtb"
- else
- kernel_zimg="${curdir}/arch/arm/boot/zImage"
- fi
-fi
-
-echo "**** Generate download images ****"
-
-if [ ! -x ${mkimg} ]; then chmod a+x ${mkimg}; fi
-
-if [ "${KBUILD_OUTPUT_SUPPORT}" == "yes" ]; then
- ${mkimg} ${kernel_zimg} KERNEL > $outdir/kernel_${MTK_PROJECT}.bin
-else
- ${mkimg} ${kernel_zimg} KERNEL > kernel_${MTK_PROJECT}.bin
-fi
-
-copy_to_legacy_download_flash_folder $outdir/kernel_${MTK_PROJECT}.bin rootfs_${MTK_PROJECT}.bin