1#!/bin/bash 2# Copyright (c) 2021 Huawei Device Co., Ltd. 3# This program is free software; you can redistribute it and/or modify 4# it under the terms of the GNU General Public License as published by 5# the Free Software Foundation; either version 2 of the License, or 6# (at your option) any later version. 7# 8# This program is distributed in the hope that it will be useful, 9# but WITHOUT ANY WARRANTY; without even the implied warranty of 10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# GNU General Public License for more details. 12# 13# You should have received a copy of the GNU General Public License 14# along with this program. If not, see <http://www.gnu.org/licenses/>. 15 16set -e 17 18#$1 - kernel build script work dir 19#$2 - kernel build script stage dir 20#$3 - GN target output dir 21 22echo build_kernel 23pushd ${1} 24./kernel_module_build.sh ${2} ${4} ${5} ${6} ${7} ${8} 25mkdir -p ${3} 26rm -rf ${3}/../../../kernel.timestamp 27cp ${2}/kernel/OBJ/${8}/arch/arm/boot/uImage ${3}/uImage 28if [ "$7" == "hi3751v350" ];then 29 cp ${2}/kernel/OBJ/${8}/arch/arm/boot/dts/hi3751v350.dtb ${3}/dtbo.img 30 cat ${2}/kernel/OBJ/${8}/arch/arm/boot/zImage ${3}/dtbo.img > ${3}/zImage-dtb 31else 32 cp ${2}/kernel/OBJ/${8}/arch/arm/boot/zImage-dtb ${3}/zImage-dtb 33fi 34popd 35