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 "kernel/linux/common_modules" 22 "third_party/bounds_checking_function" 23 "device/soc/hisilicon/common/platform/wifi" 24 "third_party/FreeBSD/sys/dev/evdev" 25 "drivers/hdf_core" 26 "prebuilts/clang/ohos/linux-x86_64/llvm/bin" 27) 28 29function is_kernel_change 30{ 31 ROOT_PATH=$1 32 BUILD_INFO_PATH=$ROOT_PATH/out/kernel/checkpoint 33 34 if [ ! -d "$BUILD_INFO_PATH" ]; then 35 mkdir -p $BUILD_INFO_PATH 36 fi 37 38 touch $BUILD_INFO_PATH/last_build.info 39 rm -f $BUILD_INFO_PATH/current_build.info 40 41 for dep in ${DEPS[@]} 42 do 43 if [[ $dep == "prebuilts/clang/ohos/linux-x86_64/llvm/bin" ]];then 44 echo $dep: >> $BUILD_INFO_PATH/current_build.info 45 echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $BUILD_INFO_PATH/current_build.info 46 cd $ROOT_PATH/$dep 47 md5sum clang >> $BUILD_INFO_PATH/current_build.info 48 cd - 49 echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $BUILD_INFO_PATH/current_build.info 50 else 51 echo $dep: >> $BUILD_INFO_PATH/current_build.info 52 echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $BUILD_INFO_PATH/current_build.info 53 cd $ROOT_PATH/$dep 54 git log -n 2 >> $BUILD_INFO_PATH/current_build.info 55 cd - 56 echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" >> $BUILD_INFO_PATH/current_build.info 57 fi 58 59 done 60 61 diff $BUILD_INFO_PATH/last_build.info $BUILD_INFO_PATH/current_build.info 62} 63