1#!/bin/bash 2# SPDX-License-Identifier: GPL-2.0 3# Copyright (c) 2022 Huawei Device Co., Ltd. 4# 5# Description: Create a symbolic link for NewIP in Linux 5.10 6# 7# Author: Yang Yanjun <yangyanjun@huawei.com> 8# 9# Data: 2022-07-25 10# 11 12set -e 13 14OHOS_SOURCE_ROOT=$1 15KERNEL_BUILD_ROOT=$2 16PRODUCT_NAME=$3 17KERNEL_VERSION=$4 18NEWIP_SOURCE_ROOT=$OHOS_SOURCE_ROOT/kernel/linux/common_modules/newip 19 20function main() 21{ 22 pushd . 23 24 cd $KERNEL_BUILD_ROOT/include/linux/ 25 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/linux $NEWIP_SOURCE_ROOT/third_party/linux-5.10/include/linux)/*.h ./ 26 cd $KERNEL_BUILD_ROOT/include/net/netns 27 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/net/netns $NEWIP_SOURCE_ROOT/third_party/linux-5.10/include/net/netns)/*.h ./ 28 cd $KERNEL_BUILD_ROOT/include/net 29 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/net $NEWIP_SOURCE_ROOT/third_party/linux-5.10/include/net)/*.h ./ 30 cd $KERNEL_BUILD_ROOT/include/uapi/linux 31 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/uapi/linux $NEWIP_SOURCE_ROOT/third_party/linux-5.10/include/uapi/linux)/*.h ./ 32 33 if [ ! -d "$KERNEL_BUILD_ROOT/net/newip" ]; then 34 mkdir $KERNEL_BUILD_ROOT/net/newip 35 fi 36 37 cd $KERNEL_BUILD_ROOT/net/newip/ 38 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/net/newip $NEWIP_SOURCE_ROOT/src/linux-5.10/net/newip)/* ./ 39 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/net/newip $NEWIP_SOURCE_ROOT/src/common)/* ./ 40 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/net/newip $NEWIP_SOURCE_ROOT/third_party/linux-5.10/net/newip)/* ./ 41 cd $KERNEL_BUILD_ROOT/include/uapi/linux 42 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/include/uapi/linux $NEWIP_SOURCE_ROOT/src/common)/nip_addr.h nip_addr.h 43 44 cd $KERNEL_BUILD_ROOT/drivers/net/ 45 ln -s -f $(realpath --relative-to=$KERNEL_BUILD_ROOT/drivers/net/ $NEWIP_SOURCE_ROOT/src/linux-5.10/drivers/net/bt) 46 47 popd 48} 49 50main 51