1#!/bin/bash 2# Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd 3# This file contains confidential and proprietary information of 4# OSWare Technology Co., Ltd 5# 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17 18set -e 19 20OHOS_SOURCE_ROOT=$1 21KERNEL_BUILD_ROOT=$2 22 23function patch_imx() 24{ 25 cd $KERNEL_BUILD_ROOT 26 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0001_linux_arch.patch 27 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0002_linux_block.patch 28 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0003_linux_crypto.patch 29 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0004_linux_fs.patch 30 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0005_linux_include.patch 31 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0006_linux_init.patch 32 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0007_linux_kernel.patch 33 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0008_linux_net.patch 34 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0009_linux_sound.patch 35 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/0010_linux_tools.patch 36 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0011_linux_drivers_acpi.patch 37 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0012_linux_drivers_ata.patch 38 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0013_linux_drivers_base.patch 39 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0014_linux_drivers_bus.patch 40 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0015_linux_drivers_clk.patch 41 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0016_linux_drivers_crypto.patch 42 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0017_linux_drivers_dma_dmabuf.patch 43 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0018_linux_drivers_firmware.patch 44 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0019_linux_drivers_gpio.patch 45 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0020_linux_drivers_gpu.patch 46 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0021_linux_drivers_hwmon.patch 47 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0022_linux_drivers_i2c.patch 48 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0023_linux_drivers_iio.patch 49 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0024_linux_drivers_input.patch 50 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0025_linux_drivers_irqchip.patch 51 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0026_linux_drivers_mailbox.patch 52 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0027_linux_drivers_media.patch 53 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0028_linux_drivers_memory.patch 54 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0029_linux_drivers_mfd.patch 55 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0030_linux_drivers_pci_misc_nvmem_of_mtd_mmc.patch 56 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0031_linux_drivers_perf_phy_pinctrl_ptp_pwm.patch 57 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0032_linux_drivers_regulator_remoteproc_reset_rpmsg_rtc.patch 58 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0033_linux_drivers_soc_scsi_spi_tee_thermal.patch 59 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0034_linux_drivers_usb_vfio_wdt_tty_uio.patch 60 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0035_linux_drivers_video.patch 61 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0036_linux_drivers_staging.patch 62 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0037_linux_drivers_net.patch 63 patch -p1 < $OHOS_SOURCE_ROOT/imx8mm_patch/patches/drivers/0038_linux_drivers_mxc.patch 64 cd - 65} 66 67function patch_link() 68{ 69 cd $KERNEL_BUILD_ROOT/scripts/dtc/include-prefixes 70 # delete the dtc contents 71 rm -rf arm64 dt-bindings 72 73 # redo the dtc contents 74 ln -s ../../../arch/arm64 . 75 ln -s ../../../include/dt-bindings . 76 cd - 77} 78 79function main() 80{ 81 patch_imx 82 patch_link 83} 84 85main 86