• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# Copyright (c) 2021 HiHope Open Source Organization .
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -e
17
18pushd ${1}
19ROOT_DIR=${5}
20export PRODUCT_PATH=${4}
21
22KERNEL_SRC_TMP_PATH=${ROOT_DIR}/out/kernel/src_tmp/linux-5.10
23KERNEL_SOURCE=${ROOT_DIR}/kernel/linux/linux-5.10
24KERNEL_PATCH=${ROOT_DIR}/kernel/linux/patches/linux-5.10/rk3568_patch/kernel.patch
25HDF_PATCH=${ROOT_DIR}/kernel/linux/patches/linux-5.10/rk3568_patch/hdf.patch
26KERNEL_CONFIG_FILE=${ROOT_DIR}/kernel/linux/config/linux-5.10/arch/arm64/configs/rk3568_standard_defconfig
27
28rm -rf ${KERNEL_SRC_TMP_PATH}
29mkdir -p ${KERNEL_SRC_TMP_PATH}
30
31cp -arf ${KERNEL_SOURCE}/* ${KERNEL_SRC_TMP_PATH}/
32
33cd ${KERNEL_SRC_TMP_PATH}
34
35#����HDF patch
36bash ${ROOT_DIR}/drivers/adapter/khdf/linux/patch_hdf.sh ${ROOT_DIR} ${KERNEL_SRC_TMP_PATH} ${HDF_PATCH}
37
38#����kernel patch
39patch -p1 < ${KERNEL_PATCH}
40
41cp -rf ${3}/kernel/logo* ${KERNEL_SRC_TMP_PATH}/
42
43#����config
44cp -rf ${KERNEL_CONFIG_FILE} ${KERNEL_SRC_TMP_PATH}/arch/arm64/configs/rockchip_linux_defconfig
45
46#�����ں�
47if [ "enable_ramdisk" == "${6}" ]; then
48	./make-ohos.sh TB-RK3568X0 enable_ramdisk
49else
50    ./make-ohos.sh TB-RK3568X0 disable_ramdisk
51fi
52
53mkdir -p ${2}
54
55if [ "enable_ramdisk" != "${6}" ]; then
56	cp boot_linux.img ${2}/boot_linux.img
57fi
58cp resource.img ${2}/resource.img
59cp ${3}/loader/parameter_5_10.txt ${2}/parameter.txt
60cp ${3}/loader/MiniLoaderAll.bin ${2}/MiniLoaderAll.bin
61cp ${3}/loader/uboot_5_10.img ${2}/uboot.img
62popd
63