11bd4fe43Sopenharmony_ci#!/bin/bash
21bd4fe43Sopenharmony_ci#
31bd4fe43Sopenharmony_ci# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
41bd4fe43Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
51bd4fe43Sopenharmony_ci# you may not use this file except in compliance with the License.
61bd4fe43Sopenharmony_ci# You may obtain a copy of the License at
71bd4fe43Sopenharmony_ci#
81bd4fe43Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
91bd4fe43Sopenharmony_ci#
101bd4fe43Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
111bd4fe43Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
121bd4fe43Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131bd4fe43Sopenharmony_ci# See the License for the specific language governing permissions and
141bd4fe43Sopenharmony_ci# limitations under the License.
151bd4fe43Sopenharmony_ci#
161bd4fe43Sopenharmony_ci# Description: Menuconfig entry
171bd4fe43Sopenharmony_ci#
181bd4fe43Sopenharmony_ciset -e
191bd4fe43Sopenharmony_ciCROOT=$(pwd)
201bd4fe43Sopenharmony_ci
211bd4fe43Sopenharmony_cibuild_uboot_patch() {
221bd4fe43Sopenharmony_ci	if [ ! -d $CROOT/third_party/u-boot-v2019.07/u-boot-v2019.07/ ]; then
231bd4fe43Sopenharmony_ci		tar -zxf u-boot-v2019.07.tar.gz
241bd4fe43Sopenharmony_ci		cd u-boot-v2019.07
251bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-13103.patch
261bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-13104.patch
271bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-13105.patch
281bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-13106.patch
291bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-14192-14193-14199.patch
301bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-14194-14198.patch
311bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-14195.patch
321bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-14196.patch
331bd4fe43Sopenharmony_ci		patch -p1 < ./../patch/CVE-2019-14197-14200-14201-14202-14203-14204.patch
341bd4fe43Sopenharmony_ci		patch -p1 < ./../hisilicon_patch/hisilicon-u-boot-v2019.07.patch
351bd4fe43Sopenharmony_ci	fi
361bd4fe43Sopenharmony_ci}