• Lv0
    粉丝0

积分0 / 贡献0

提问3答案被采纳0文章0

编译5.0源码时发生报错4000

zyxzyx 显示全部楼层 发表于 2024-12-31 17:12:43

【问题描述】

  1. 编译时发生以下问题:[OHOS ERROR] [4401/68711] ACTION //device/board/hihope/rk3568/kernel:kernel(//build/toolchain/ohos:ohos_clang_arm64)
  2. [OHOS ERROR] FAILED: ../kernel/src_tmp/linux-5.10/boot_linux ../kernel/checkpoint/compile_check [OHOS ERROR] /usr/bin/env ../../device/board/hihope/rk3568/kernel/build_kernel.sh ../../kernel/linux/linux-5.10 /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568/packages/phone/images /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/device/board/hihope/rk3568 vendor/hihope/rk3568 /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony rockchip rk3568 hihope linux-5.10 root default disable_lto_O0 enable_ramdisk [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/kernel/linux/linux-5.10 [OHOS ERROR] 0a1,169 [OHOS ERROR] > kernel/linux/build: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit 89095aa0503d5acdd4d6753866b34f750ea3f1d9 [OHOS ERROR] > Merge: c2a1193 6c9a513 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Thu Sep 5 10:14:55 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !218 代码差异整改 [OHOS ERROR] > Merge pull request !218 from yaowenrui/OpenHarmony-5.0-Release [OHOS ERROR] > [OHOS ERROR] > commit 6c9a513d0a5cbdebba86d6a1f7daed1e0e7d6e71 [OHOS ERROR] > Author: yaowenrui <yaowenrui2@huawei.com> [OHOS ERROR] > Date: Thu Sep 5 09:41:39 2024 +0800 [OHOS ERROR] > [OHOS ERROR] > 蓝黄区代码差异整改 [OHOS ERROR] > [OHOS ERROR] > Signed-off-by: yaowenrui <yaowenrui2@huawei.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > kernel/linux/linux-5.10: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit 3ca24778a7879cc01cbd03fabd89b3dd2243e796 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Thu Aug 29 08:24:41 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !1554 sharefs revert 解耦 [OHOS ERROR] > Merge pull request !1554 from tl/OpenHarmony-5.0-Release [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > kernel/linux/linux-6.6: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit e44fe5532e40a4c5c6e0c7fe20b3766079a9ffdc [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Tue Aug 27 05:47:37 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !49 OAT.xml update [OHOS ERROR] > Merge pull request !49 from yaowenrui/OpenHarmony-5.0-Release [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > kernel/linux/patches: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit 52179376f521d3280a7809ed65f69fc93d6e4585 [OHOS ERROR] > Merge: 2abc9d4 0df2210 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Thu Sep 5 10:15:23 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !489 代码差异整改 [OHOS ERROR] > Merge pull request !489 from yaowenrui/OpenHarmony-5.0-Release [OHOS ERROR] > [OHOS ERROR] > commit 0df221082e7ac0b6ee37f6b92924c8eac0dff2be [OHOS ERROR] > Author: yaowenrui <yaowenrui2@huawei.com> [OHOS ERROR] > Date: Thu Sep 5 08:42:05 2024 +0800 [OHOS ERROR] > [OHOS ERROR] > 蓝黄区代码差异整改 [OHOS ERROR] > [OHOS ERROR] > Signed-off-by: yaowenrui <yaowenrui2@huawei.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > kernel/linux/config: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit 29f996bdce29d12cf322553001c2c19ea47798be [OHOS ERROR] > Merge: e53df7b 0ad94b5 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Wed Jul 3 08:39:58 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !385 增加Linux-6.6内核版本config分层 [OHOS ERROR] > Merge pull request !385 from AlgoIdeas/master [OHOS ERROR] > [OHOS ERROR] > commit e53df7b3539a92c72f17f3069c64de63f106634a [OHOS ERROR] > Merge: bcfe70a 36b25bc [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Wed Jul 3 04:47:19 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !386 fix OAT.xml ignore linux-6.6 config files [OHOS ERROR] > Merge pull request !386 from AlgoIdeas/master [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > kernel/linux/common_modules: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit bca5e6a38904894de98bb42d2c19cef03fc984be [OHOS ERROR] > Merge: 85cb31a 5de8f55 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Mon Aug 26 11:26:30 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !138 rss 默认添加 qos 权限 [OHOS ERROR] > Merge pull request !138 from plusOneSecond/OpenHarmony-5.0-Release [OHOS ERROR] > [OHOS ERROR] > commit 5de8f5511a8fba768de5aad0c0fd2e55ece3e957 [OHOS ERROR] > Author: Brian <ling.qiwei@foxmail.com> [OHOS ERROR] > Date: Thu Aug 22 15:09:44 2024 +0800 [OHOS ERROR] > [OHOS ERROR] > rss 默认添加 qos 权限 [OHOS ERROR] > [OHOS ERROR] > Signed-off-by: Brian <ling.qiwei@foxmail.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > third_party/bounds_checking_function: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit 1f362686fc6f22acdbfbae6b1328597c4b52a24d [OHOS ERROR] > Merge: c98309a b1c8b37 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Wed May 29 13:46:20 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !57 安全函数库依赖整改 [OHOS ERROR] > Merge pull request !57 from hw_llm/master [OHOS ERROR] > [OHOS ERROR] > commit b1c8b377d8f0f8f35cdfb04ec35b74f60fb2923b [OHOS ERROR] > Author: hw_llm <liu.limin@huawei.com> [OHOS ERROR] > Date: Wed May 29 09:10:55 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > Description: bounds check 部件整改 [OHOS ERROR] > IssueNo: https://gitee.com/openharmony/third_party_bounds_checking_function/issues/I9T6UO [OHOS ERROR] > Feature Or Bugfix: Feature [OHOS ERROR] > Binary Source: No [OHOS ERROR] > Signed-off-by: hw_llm <liu.limin@huawei.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > device/soc/hisilicon/common/platform/wifi: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit e7706d5d1b33f03c676164f501edc452828c8f68 [OHOS ERROR] > Merge: df0fcc3 f2bc899 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Mon Jun 3 12:29:34 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !348 修改OAT告警 [OHOS ERROR] > Merge pull request !348 from KevinQian/master [OHOS ERROR] > [OHOS ERROR] > commit f2bc8993a1b3cc25acd67a9fbffac424d6c3039e [OHOS ERROR] > Author: KevinQian <kevin.qian@hisilicon.com> [OHOS ERROR] > Date: Mon Jun 3 11:49:00 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > update OAT.xml. [OHOS ERROR] > [OHOS ERROR] > Signed-off-by: KevinQian <kevin.qian@hisilicon.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > third_party/FreeBSD/sys/dev/evdev: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit a1e930fa186986498649d8b5654d708460086af5 [OHOS ERROR] > Merge: ea87803 610cf1a [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Sat Sep 14 07:41:20 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !114 support pac [OHOS ERROR] > Merge pull request !114 from Jasonye/cherry-pick-1725959900 [OHOS ERROR] > [OHOS ERROR] > commit 610cf1a47ff2c1f36847a8580bc600dbf61ffaa9 [OHOS ERROR] > Author: yeyuning <yeyuning2@huawei.com> [OHOS ERROR] > Date: Thu Sep 5 10:31:53 2024 +0800 [OHOS ERROR] > [OHOS ERROR] > enable pac [OHOS ERROR] > (cherry picked commit from <gitee.com//openharmony/third_party_FreeBSD/commit/00b7aac83005ec80b95ffe4e5b0c1857fadd0c73> [OHOS ERROR] > [OHOS ERROR] > Signed-off-by: zhenghui <zhenghui25@huawei.com> [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > drivers/hdf_core: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > commit d2350a28b94e8199d66e9392ddf4c475b66b1b9a [OHOS ERROR] > Merge: bf490b82 95191793 [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Wed Sep 18 09:48:28 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !2275 【HDF_CORE】HDF驱动框架领域 使能PAC后向CFI - 5.0-release [OHOS ERROR] > Merge pull request !2275 from wangyk/cherry-pick-1725955245 [OHOS ERROR] > [OHOS ERROR] > commit bf490b82f635879ff6888d41f340b1221d506adb [OHOS ERROR] > Merge: c06b62d5 3cebeeac [OHOS ERROR] > Author: openharmony_ci <120357966@qq.com> [OHOS ERROR] > Date: Wed Sep 18 07:06:52 2024 +0000 [OHOS ERROR] > [OHOS ERROR] > !2285 蓝黄release分支代码同步 [OHOS ERROR] > Merge pull request !2285 from Richard丶H/OpenHarmony-5.0-Release [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] > prebuilts/clang/ohos/linux-x86_64/llvm/bin: [OHOS ERROR] > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [OHOS ERROR] > 277792a0b97e7f1a3b1c92097ba62ef4 clang [OHOS ERROR] > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [OHOS ERROR] kernel or it's deps changed, start source update. [OHOS ERROR] patching file arch/arm64/kernel/vmlinux.lds.S [OHOS ERROR] Hunk #1 succeeded at 201 with fuzz 2. [OHOS ERROR] patching file drivers/Kconfig [OHOS ERROR] patching file drivers/Makefile [OHOS ERROR] Hunk #1 succeeded at 192 with fuzz 1 (offset 1 line). [OHOS ERROR] patching file drivers/hdf/Makefile [OHOS ERROR] patching file drivers/hid/Makefile [OHOS ERROR] patching file drivers/hid/hid-core.c [OHOS ERROR] Hunk #2 succeeded at 1542 (offset 17 lines). [OHOS ERROR] Hunk #3 succeeded at 1957 (offset 21 lines). [OHOS ERROR] Hunk #4 succeeded at 2128 (offset 21 lines). [OHOS ERROR] Hunk #5 succeeded at 2146 (offset 21 lines). [OHOS ERROR] Hunk #6 succeeded at 2234 (offset 21 lines). [OHOS ERROR] patching file drivers/hid/hid-input.c [OHOS ERROR] Hunk #2 succeeded at 1441 (offset 21 lines). [OHOS ERROR] Hunk #3 succeeded at 1900 (offset 21 lines). [OHOS ERROR] Hunk #4 succeeded at 2021 (offset 21 lines). [OHOS ERROR] patching file drivers/input/misc/Makefile [OHOS ERROR] patching file drivers/input/misc/rk805-pwrkey.c [OHOS ERROR] patching file drivers/input/mousedev.c [OHOS ERROR] patching file drivers/usb/core/notify.c [OHOS ERROR] patching file drivers/usb/dwc3/gadget.c [OHOS ERROR] Hunk #1 succeeded at 3706 (offset 73 lines). [OHOS ERROR] Hunk #2 succeeded at 3714 (offset 73 lines). [OHOS ERROR] patching file include/linux/hid.h [OHOS ERROR] patching file include/linux/usb.h [OHOS ERROR] Hunk #1 succeeded at 2024 (offset 5 lines). [OHOS ERROR] /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/kernel/src_tmp/linux-5.10

OHOS ERROR] exceptions.ohos_exception.OHOSException: COMPILE Failed! Please check error in /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568/error.log, and for more build information in /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568/build.log [OHOS ERROR]

[OHOS ERROR] Code: 4000 [OHOS ERROR] [OHOS ERROR] Reason: COMPILE Failed! Please check error in /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568/error.log, and for more build information in /home/zhang/Desktop/OpenHarmony-v5.0.0-Release/OpenHarmony/out/rk3568/build.log [OHOS ERROR] [OHOS ERROR] Error Type: Ninja build error [OHOS ERROR] [OHOS ERROR] Description: An unknown error occurred while executing 'ninja -C'. [OHOS ERROR] [OHOS ERROR] Solution: no solution [OHOS ERROR] =====build error=====

【运行环境】

ubuntu20.04 ROM版本: DevEvoStudio版本: SDK版本:

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

精彩评论1

zyxzyx

沙发 发表于 3 天前
报错文件如下:
!/bin/bash

# Copyright (c) 2021-2023 HiHope Open Source Organization .
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

pushd ${1}
ROOT_DIR=${5}
export PRODUCT_PATH=${4}
export DEVICE_COMPANY=${6}
export DEVICE_NAME=${7}
export PRODUCT_COMPANY=${8}
KERNEL_VERSION=${9}
KERNEL_FORM=${10}
KERNEL_PROD=${11}
ENABLE_LTO_O0=${12}

KERNEL_SRC_TMP_PATH=${ROOT_DIR}/out/kernel/src_tmp/${KERNEL_VERSION}
KERNEL_OBJ_TMP_PATH=${ROOT_DIR}/out/kernel/OBJ/${KERNEL_VERSION}
KERNEL_SOURCE=${ROOT_DIR}/kernel/linux/${KERNEL_VERSION}
KERNEL_PATCH_PATH=${ROOT_DIR}/kernel/linux/patches/${KERNEL_VERSION}
KERNEL_PATCH=${ROOT_DIR}/kernel/linux/patches/${KERNEL_VERSION}/rk3568_patch/kernel.patch
BUILD_SCRIPT_PATH=${3}
NEWIP_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/newip/apply_newip.sh
TZDRIVER_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/tzdriver/apply_tzdriver.sh
XPM_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/xpm/apply_xpm.sh
CED_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/container_escape_detection/apply_ced.sh
HIDEADDR_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/memory_security/apply_hideaddr.sh
QOS_AUTH_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/qos_auth/apply_qos_auth.sh
UNIFIED_COLLECTION_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/ucollection/apply_ucollection.sh
CODE_SIGN_PATCH_FILE=${ROOT_DIR}/kernel/linux/common_modules/code_sign/apply_code_sign.sh

HARMONY_CONFIG_PATH=${ROOT_DIR}/kernel/linux/config/${KERNEL_VERSION}
DEVICE_CONFIG_PATH=${ROOT_DIR}/kernel/linux/config/${KERNEL_VERSION}/${DEVICE_NAME}
DEFCONFIG_BASE_FILE=${HARMONY_CONFIG_PATH}/base_defconfig
DEFCONFIG_TYPE_FILE=${HARMONY_CONFIG_PATH}/type/standard_defconfig
DEFCONFIG_FORM_FILE=${HARMONY_CONFIG_PATH}/form/${KERNEL_FORM}_defconfig
DEFCONFIG_ARCH_FILE=${DEVICE_CONFIG_PATH}/arch/arm64_defconfig
DEFCONFIG_PROC_FILE=${DEVICE_CONFIG_PATH}/product/${KERNEL_PROD}_defconfig

RAMDISK_ARG="disable_ramdisk"
MAKE_OHOS_ENV="GPUDRIVER=mali"
export KBUILD_OUTPUT=${KERNEL_OBJ_TMP_PATH}

source ${BUILD_SCRIPT_PATH}/kernel/kernel_source_checker.sh

for i in "$@"
do
    case $i in
        enable_ramdisk)
            RAMDISK_ARG=enable_ramdisk
            ;;
        enable_mesa3d)
            MAKE_OHOS_ENV="GPUDRIVER=mesa3d"
            ;;
    esac
done

function copy_and_patch_kernel_source()
{
    rm -rf ${KERNEL_SRC_TMP_PATH}
    mkdir -p ${KERNEL_SRC_TMP_PATH}

    rm -rf ${KERNEL_OBJ_TMP_PATH}
    mkdir -p ${KERNEL_OBJ_TMP_PATH}

    cp -arf ${KERNEL_SOURCE}/* ${KERNEL_SRC_TMP_PATH}/

    cd ${KERNEL_SRC_TMP_PATH}

    #HDF patch
    bash ${ROOT_DIR}/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${KERNEL_PATCH_PATH} ${DEVICE_NAME}

    #update linux-6.6 kernel stdarg.h path to linux/stdarg.h
    if [ ${KERNEL_VERSION} == "linux-6.6" ]
    then
      sed -i 's/<stdarg.h>/<linux\/stdarg.h>/' ${KERNEL_SRC_TMP_PATH}/bounds_checking_function/include/securec.h
      sed -i 's/"stdarg.h"/"linux\/stdarg.h"/' ${ROOT_DIR}/drivers/hdf_core/framework/support/platform/src/fwk/platform_device.c
    fi

    #kernel patch
    patch -p1 < ${KERNEL_PATCH}

    #newip
    if [ -f $NEWIP_PATCH_FILE ]; then
        bash $NEWIP_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #tzdriver
    if [ -f $TZDRIVER_PATCH_FILE ]; then
        bash $TZDRIVER_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #xpm
    if [ -f $XPM_PATCH_FILE ]; then
        bash $XPM_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #ced
    if [ -f $CED_PATCH_FILE ]; then
        bash $CED_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #qos_auth
    if [ -f $QOS_AUTH_PATCH_FILE ]; then
        bash $QOS_AUTH_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #hideaddr
    if [ -f $HIDEADDR_PATCH_FILE ]; then
        bash $HIDEADDR_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #ucollection
    if [ -f $UNIFIED_COLLECTION_PATCH_FILE ]; then
        bash $UNIFIED_COLLECTION_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    #code_sign
    if [ -f $CODE_SIGN_PATCH_FILE ]; then
        bash $CODE_SIGN_PATCH_FILE ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${DEVICE_NAME} ${KERNEL_VERSION}
    fi

    cp -rf ${BUILD_SCRIPT_PATH}/kernel/logo* ${KERNEL_SRC_TMP_PATH}/

    #config
    if [ ! -f "$DEFCONFIG_FORM_FILE" ]; then
        DEFCONFIG_FORM_FILE=
        echo "warning no form config file $(DEFCONFIG_FORM_FILE)"
    fi
    if [ ! -f "$DEFCONFIG_PROC_FILE" ]; then
        DEFCONFIG_PROC_FILE=
        echo "warning no prod config file $(DEFCONFIG_PROC_FILE)"
    fi
    bash ${ROOT_DIR}/kernel/linux/${KERNEL_VERSION}/scripts/kconfig/merge_config.sh -O ${KERNEL_SRC_TMP_PATH}/arch/arm64/configs/ -m ${DEFCONFIG_TYPE_FILE} ${DEFCONFIG_FORM_FILE} ${DEFCONFIG_ARCH_FILE} ${DEFCONFIG_PROC_FILE} ${DEFCONFIG_BASE_FILE}
    mv ${KERNEL_SRC_TMP_PATH}/arch/arm64/configs/.config ${KERNEL_SRC_TMP_PATH}/arch/arm64/configs/rockchip_linux_defconfig

    #selinux config patch
    for arg in "$@"; do
        if [ "$arg" = "is_release" ]; then
            echo "close selinux kernel config CONFIG_SECURITY_SELINUX_DEVELOP in release version"
            ${KERNEL_SOURCE}/scripts/config --file ${KERNEL_SRC_TMP_PATH}/arch/arm64/configs/rockchip_linux_defconfig -d SECURITY_SELINUX_DEVELOP
        fi
    done

    if [ $MAKE_OHOS_ENV == "GPUDRIVER=mesa3d" ]; then
        python ${ROOT_DIR}/third_party/mesa3d/ohos/modifyDtsi.py ${KERNEL_SRC_TMP_PATH}/arch/arm64/boot/dts/rockchip/rk3568.dtsi
    fi
}

set +e
is_kernel_change ${ROOT_DIR}
KERNEL_SOURCE_CHANGED=$?
set -e
if [ ${KERNEL_SOURCE_CHANGED}  -ne 0 ]; then
    echo "kernel or it's deps changed, start source update."
    copy_and_patch_kernel_source
else
    echo "no changes to kernel, skip source copy."
fi

cd ${KERNEL_SRC_TMP_PATH}

eval $MAKE_OHOS_ENV ./make-ohos.sh TB-RK3568X0 $RAMDISK_ARG ${ENABLE_LTO_O0}

# revert linux-6.6 hdf stdarg.h path
if [ ${KERNEL_VERSION} == "linux-6.6" ]
then
  sed -i 's/"linux\/stdarg.h"/"stdarg.h"/' ${ROOT_DIR}/drivers/hdf_core/framework/support/platform/src/fwk/platform_device.c
fi

mkdir -p ${2}

if [ "enable_ramdisk" != "${13}" ]; then
    cp ${KERNEL_OBJ_TMP_PATH}/boot_linux.img ${2}/boot_linux.img
fi
cp ${KERNEL_OBJ_TMP_PATH}/resource.img ${2}/resource.img
cp ${3}/loader/MiniLoaderAll.bin ${2}/MiniLoaderAll.bin
cp ${3}/loader/uboot.img ${2}/uboot.img

if [ "enable_absystem" == "${15}" ]; then
    cp ${3}/loader/parameter_ab.txt ${2}/parameter_ab.txt
    cp ${3}/loader/config_ab.cfg ${2}/config_ab.cfg
else
    cp ${3}/loader/parameter.txt ${2}/parameter.txt
    cp ${3}/loader/config.cfg ${2}/config.cfg
fi

popd

../kernel/src_tmp/${KERNEL_VERSION}/make-boot.sh ..

if [ ${KERNEL_SOURCE_CHANGED} -ne 0 ]; then
    cp ${ROOT_DIR}/out/kernel/checkpoint/last_build.info ${ROOT_DIR}/out/kernel/checkpoint/last_build.backup
    cp ${ROOT_DIR}/out/kernel/checkpoint/current_build.info ${ROOT_DIR}/out/kernel/checkpoint/last_build.info
    echo "kernel compile finish, save build info."
else
    echo "kernel compile finish."
fi

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部