Added support kernel incremental build

Signed-off-by: yijian <salient.yijian@huawei.com>
This commit is contained in:
yijian
2021-11-01 19:57:55 +08:00
parent 0857e6786b
commit f78ff357c1
3 changed files with 56 additions and 1 deletions
+12
View File
@@ -36,10 +36,22 @@ if (defined(ohos_lite)) {
kernel_build_script_dir = "//kernel/linux/build"
kernel_source_dir = "//kernel/linux/$linux_kernel_version"
action("check_build") {
script = "check_build.sh"
sources = [ kernel_source_dir ]
outputs = [ "$root_build_dir/kernel.timestamp" ]
args = [
rebase_path(kernel_source_dir, root_build_dir),
rebase_path("$root_build_dir/packages/phone/images/uImage"),
rebase_path("$root_build_dir/kernel.timestamp"),
]
}
action("build_kernel") {
script = "build_kernel.sh"
sources = [ kernel_source_dir ]
deps = [ ":check_build" ]
product_path = "vendor/$product_company/$product_name"
build_type = "standard"
outputs = [ "$root_build_dir/packages/phone/images/uImage" ]
+2 -1
View File
@@ -19,10 +19,11 @@ set -e
#$2 - kernel build script stage dir
#$3 - GN target output dir
echo build_kernel
pushd ${1}
./kernel_module_build.sh ${2} ${4} ${5} ${6} ${7} ${8}
mkdir -p ${3}
rm -rf ${3}/../../../kernel.timestamp
cp ${2}/kernel/OBJ/${8}/arch/arm/boot/uImage ${3}/uImage
cp ${2}/kernel/OBJ/${8}/arch/arm/boot/zImage-dtb ${3}/zImage-dtb
popd
Executable
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
# Copyright (c) 2021 Huawei Device Co., Ltd.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -e
function readfile ()
{
for file in $1/*
do
if [ -d $file ];then
readfile $file $2 $3
elif [ $file -nt $2 ]; then
echo $file is update
touch $3;
return
fi
done
}
echo $1 for check kernel dir
echo $2 for output image
echo $3 for timestamp
if [ -e $2 ]; then
readfile $1 $2 $3
if [ $3 -nt $2 ]; then
echo "need update $2"
rm -rf $2;
fi
fi