• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) 2023 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#kernel deps dir, must be a git repo
16DEPS=(
17    "kernel/linux/build"
18    "kernel/linux/linux-5.10"
19    "kernel/linux/patches"
20    "kernel/linux/config"
21    "third_party/bounds_checking_function"
22    "device/soc/hisilicon/common/platform/wifi"
23    "third_party/FreeBSD/sys/dev/evdev"
24    "drivers/hdf_core"
25    "prebuilts/clang/ohos/linux-x86_64/llvm/bin"
26)
27
28function is_kernel_change
29{
30    ROOT_PATH=$1
31    BUILD_INFO_PATH=$ROOT_PATH/out/kernel/checkpoint
32
33    if [ ! -d "$BUILD_INFO_PATH" ]; then
34        mkdir -p $BUILD_INFO_PATH
35    fi
36
37    touch $BUILD_INFO_PATH/last_build.info
38    rm -f $BUILD_INFO_PATH/current_build.info
39
40    for dep in ${DEPS[@]}
41    do
42        if [[ $dep == "prebuilts/clang/ohos/linux-x86_64/llvm/bin" ]];then
43            echo $dep: >> $BUILD_INFO_PATH/current_build.info
44            echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $BUILD_INFO_PATH/current_build.info
45            cd $ROOT_PATH/$dep
46            md5sum clang >> $BUILD_INFO_PATH/current_build.info
47            cd -
48            echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $BUILD_INFO_PATH/current_build.info
49        else
50            echo $dep: >> $BUILD_INFO_PATH/current_build.info
51            echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $BUILD_INFO_PATH/current_build.info
52            cd $ROOT_PATH/$dep
53            git log -n 2 >> $BUILD_INFO_PATH/current_build.info
54            cd -
55            echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $BUILD_INFO_PATH/current_build.info
56        fi
57
58    done
59
60    diff $BUILD_INFO_PATH/last_build.info $BUILD_INFO_PATH/current_build.info
61}
62