forked from kaylorchen/rk3588_dev_rootfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
executable file
·29 lines (25 loc) · 1.08 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
apt update
apt install -y --no-install-recommends vim libopencv-dev g++ gcc \
fakeroot devscripts libspdlog-dev libsystemd-dev libcap-dev liblz4-dev \
libgcrypt-dev libzstd-dev debhelper rknpu2-dev librockchip-mpp-dev librga-dev \
libstb-dev libturbojpeg0-dev libjpeg-turbo8-dev librga2 libboost-dev \
libboost-system1.74-dev kaylordut-dev libbytetrack libyaml-cpp-dev
# 转换绝对路径软链接为相对路径的脚本
TARGET_DIR="/usr/lib" # 指定目标目录
# 使用find命令查找所有的软链接
find "${TARGET_DIR}" -type l | while read -r symlink; do
# 获取软链接指向的目标
target=$(readlink "${symlink}")
# 确定链接是否为绝对路径
if [[ "${target}" = /* ]]; then
# 计算相对路径
relative_target=$(realpath --relative-to="$(dirname "${symlink}")" "${target}")
# 删除原有软链接
rm "${symlink}"
# 创建新的软链接,使用相对路径
ln -sv "${relative_target}" "${symlink}"
echo "链接已更新:${symlink} -> ${relative_target}"
fi
done
echo "所有绝对路径软链接已转换为相对路径。"