Skip to content

Commit

Permalink
fix: skip symlink when copy bin to |${NV_DIR}|. (#15)
Browse files Browse the repository at this point in the history
* fix: skip symlink when copy bin to |${NV_DIR}|.

* fix: use |${FIND_BASE}| when find the lib and bin.

* style.

Co-authored-by: linquan <[email protected]>
  • Loading branch information
linquanisaac and linquan committed Apr 8, 2020
1 parent 1f3c5e3 commit 16d156c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build/copy-bin-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ function check_arch() {
}

function copy_lib() {
for target in $(find /usr -name "${1}*" | grep -v "stubs"); do
for target in $(find ${FIND_BASE} -name "${1}*" | grep -v "stubs"); do
if [[ $(objdump -p ${target} 2>/dev/null | grep -o "SONAME") == "SONAME" ]]; then
copy_directory ${target} "${NV_DIR}/lib$(check_arch ${target})"
fi
done
}

function copy_bin() {
for target in $(find /usr -name "${1}"); do
for target in $(find ${FIND_BASE} -name "${1}"); do
if [[ -L ${target} ]]; then
echo "${target} is symlink"
continue
fi
copy_directory ${target} "${NV_DIR}/bin/"
done
}
Expand Down Expand Up @@ -80,4 +84,4 @@ done
rm -rf libnvidia-ml.so
rel_path=$(readlink -f libnvidia-ml.so.1)
ln -s $(basename ${rel_path}) libnvidia-ml.so
)
)

0 comments on commit 16d156c

Please sign in to comment.