2021-09-13 08:56:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
|
|
|
|
#
|
|
|
|
# This software is licensed under the terms of the GNU General Public
|
|
|
|
# License version 2, as published by the Free Software Foundation, and
|
|
|
|
# may be copied, distributed, and modified under those terms.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
OHOS_SOURCE_ROOT=$1
|
|
|
|
KERNEL_BUILD_ROOT=$2
|
|
|
|
HDF_PATCH_FILE=$3
|
|
|
|
|
|
|
|
ln_list=(
|
|
|
|
$OHOS_SOURCE_ROOT/drivers/adapter/khdf/linux drivers/hdf/khdf
|
|
|
|
$OHOS_SOURCE_ROOT/drivers/framework drivers/hdf/framework
|
|
|
|
$OHOS_SOURCE_ROOT/drivers/framework/include include/hdf
|
|
|
|
)
|
|
|
|
|
|
|
|
cp_list=(
|
|
|
|
$OHOS_SOURCE_ROOT/third_party/bounds_checking_function ./
|
2021-12-16 09:03:01 +00:00
|
|
|
$OHOS_SOURCE_ROOT/device/soc/hisilicon/common/platform/wifi drivers/hdf/
|
2021-09-13 08:56:31 +00:00
|
|
|
$OHOS_SOURCE_ROOT/third_party/FreeBSD/sys/dev/evdev drivers/hdf/
|
|
|
|
)
|
|
|
|
|
2021-11-29 02:44:18 +00:00
|
|
|
function copy_external_compents()
|
2021-09-13 08:56:31 +00:00
|
|
|
{
|
|
|
|
for ((i=0; i<${#cp_list[*]}; i+=2))
|
|
|
|
do
|
2021-11-29 02:44:18 +00:00
|
|
|
dst_dir=${cp_list[$(expr $i + 1)]}/${cp_list[$i]##*/}
|
2021-10-20 09:45:36 +00:00
|
|
|
mkdir -p $dst_dir
|
|
|
|
cp -arfL ${cp_list[$i]}/* $dst_dir/
|
2021-09-13 08:56:31 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-11-29 02:44:18 +00:00
|
|
|
function ln_hdf_repos()
|
2021-09-13 08:56:31 +00:00
|
|
|
{
|
|
|
|
for ((i=0; i<${#ln_list[*]}; i+=2))
|
|
|
|
do
|
2021-11-29 02:44:18 +00:00
|
|
|
ln -sf ${ln_list[$i]} ${ln_list[$(expr $i + 1)]}
|
2021-09-13 08:56:31 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-11-29 02:44:18 +00:00
|
|
|
function main()
|
2021-09-13 08:56:31 +00:00
|
|
|
{
|
|
|
|
cd $KERNEL_BUILD_ROOT
|
|
|
|
patch -p1 < $HDF_PATCH_FILE
|
|
|
|
ln_hdf_repos
|
|
|
|
copy_external_compents
|
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2021-10-20 09:45:36 +00:00
|
|
|
main
|