1#!/bin/bash 2# Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd 3# This file contains confidential and proprietary information of 4# OSWare Technology Co., Ltd 5# 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17 18set -e 19 20export OUT_DIR=$1 21export BUILD_TYPE=$2 22export KERNEL_ARCH=$3 23export PRODUCT_PATH=vendor/osware/imx8mm 24export DEVICE_NAME=$5 25export KERNEL_VERSION=$6 26LINUX_KERNEL_OUT=${OUT_DIR}/kernel/src_tmp/${KERNEL_VERSION} 27export OHOS_ROOT_PATH=$(pwd)/../../.. 28# it needs adaptation for more device target 29kernel_image="" 30if [ "$KERNEL_ARCH" == "arm" ];then 31 kernel_image="uImage" 32elif [ "$KERNEL_ARCH" == "arm64" ];then 33 kernel_image="Image" 34fi 35 36export KERNEL_IMAGE=${kernel_image} 37LINUX_KERNEL_IMAGE_FILE=${LINUX_KERNEL_OUT}/arch/${KERNEL_ARCH}/boot/${kernel_image} 38 39make -f kernel.mk 40 41if [ -f "${LINUX_KERNEL_IMAGE_FILE}" ];then 42 echo "Image: ${LINUX_KERNEL_IMAGE_FILE} build success" 43else 44 echo "Image: ${LINUX_KERNEL_IMAGE_FILE} build failed!!!" 45 exit 1 46fi 47 48exit 0 49