gpu: nvgpu: unit: copy largest libraries last

For some units that depend on libraries, tmake generates
what seems to be stub libraries, with all functions
implemented as a simple 'ret' instruction.

For instance, libfalcon_utf.so can be seen in multiple places:
du -b $(sudo find . -name libfalcon_utf.so)
7808	./nvidia/kernel/nvgpu/userspace/units/pmu-l4t_64/libfalcon_utf.so
7808	./nvidia/kernel/nvgpu/userspace/units/acr-l4t_64/libfalcon_utf.so
7808	./nvidia/kernel/nvgpu/userspace/units/falcon/falcon_tests-l4t_64/libfalcon_utf.so
76968	./nvidia/kernel/nvgpu/userspace/units/falcon-l4t_64/libfalcon_utf.so
76968	./systemimage/home/nvgpu_unit/units/libfalcon_utf.so

The "real" library is in falcon-l4t_64/, and it contains actual code.

But install-unit.sh copies all *.so files to nvgpu_unit/units on target.
In some cases, we end up with a "stub" library being used instead of
the expected one.

To avoid this, make sure to copy the largest libraries (in bytes) last.
Also, remove the '-u' option of rsync to force the copy.

Jira NVGPU-4089

Change-Id: I3832373db9c5aa72ad9ce59eb09ec031609a69e4
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2215319
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-10-10 17:55:48 -04:00
committed by Alex Waterman
parent 6907aee633
commit 0d8eddc2e0

View File

@@ -38,7 +38,7 @@ usage() {
# It helps a lot of you set up an authorized key on the target! Otherwise
# you may have a lot of typing to do...
jcp() {
cmd="rsync -qru $1 $target:$2"
cmd="rsync -qr $1 $target:$2"
echo "> $cmd"
$cmd
}
@@ -125,7 +125,7 @@ jcp $TOP/kernel/nvgpu/userspace/required_tests.json \
jcp $TOP/kernel/nvgpu/userspace/firmware/ nvgpu_unit/firmware/
find $nvgpu_bins/userspace/units -name "*.so" -not -path "*unit.so" \
-not -path "*drv.so" -exec ls {} \; | while read unit_so ; do
-not -path "*drv.so" -exec du -b {} \; | sort -n | while read size unit_so ; do
jcp $unit_so nvgpu_unit/units/
done