From 5d92f59106039eed808236eb66241ca733f9f643 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Sun, 12 Sep 2021 22:48:14 +0200 Subject: [PATCH] changes --- .gitignore | 3 ++- build.sh | 29 +++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 402403f..4ded959 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ tools/ librealsense/ sysroot-relativelinks.py toolchain.cmake -output +pirealsense2_1.0-1/usr/ +!pirealsense2_1.0-1/DEBIAN/* librealsense2_pyrealsense2_aarch64.tar.gz \ No newline at end of file diff --git a/build.sh b/build.sh index 0a80e33..cad20a9 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,8 @@ TOOLCHAIN_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020 LIBREALSENSE_GIT="https://github.com/IntelRealSense/librealsense.git" SYSROOT_TOOL_URL="https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py" CURDIR=$(pwd) -PI_USER_HOST="naresh@192.168.0.110" +PI_USER_HOST="root@192.168.0.106" +DPKG_NAME="pirealsense2_1.0-1" # Download the toolchain mkdir -p ./tools @@ -27,6 +28,11 @@ cd $CURDIR rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/lib sysroot/ rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/usr/include sysroot/usr/ rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/usr/lib sysroot/usr/ +if [ $? == 1 ] +then + echo "Problem getting Raspberry Pi libraries. Please check connection configuration." + exit +fi #rsync -avz --rsync-path="sudo rsync" $PI_USER_HOST:/opt/vc sysroot/opt/ @@ -60,15 +66,22 @@ cmake ../ -DBUILD_EXAMPLES=false \ -DPython_INCLUDE_DIR="${SYSROOT}/usr/include/python3.8" \ -DPython_LIBRARY="${SYSROOT}/usr/lib/aarch64-linux-gnu/libpython3.8.so" \ -DLIBUSB_LIB="${SYSROOT}/usr/lib/aarch64-linux-gnu/libusb-1.0.so.0.2.0" \ + -DFORCE_RSUSB_BACKEND=true \ -DCMAKE_TOOLCHAIN_FILE=${CURDIR}/toolchain.cmake -make -j14 +make -j12 # Collect built binaries and tar up -mkdir -p $CURDIR/output -make DESTDIR=$CURDIR/output install +mkdir -p $CURDIR/$DPKG_NAME +make DESTDIR=$CURDIR/$DPKG_NAME install -cd $CURDIR/output -tar cvzf $CURDIR/librealsense2_pyrealsense2_aarch64.tar.gz ./* +exit; -cd $CURDIR -rm -rf ./sysroot ./tools ./librealsense ./output ./sysroot-relativelinks.py ./toolchain.cmake +shopt -s globstar +for i in $SYSROOT/**/*cpython*; do + NEW_FILENAME=$(echo "$i" | sed "s/x86_64/aarch64/g") + mv "$i" "$NEW_FILENAME" +done + +dpkg-deb --build $DPKG_NAME + +# rm -rf ./sysroot ./tools ./librealsense ./output ./sysroot-relativelinks.py ./toolchain.cmake