mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
RPi: improve upload script, upload mixer files & all startup scripts
This commit is contained in:
+14
-13
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# upload script for network-connected devices via scp (eg Raspberry Pi)
|
||||||
|
|
||||||
if [[ "$#" < 2 ]]; then
|
if [[ "$#" < 2 ]]; then
|
||||||
echo "usage: scp_upload.sh SRC1 [SRC2 ...] DEST"
|
echo "usage: scp_upload.sh SRC1 [SRC2 ...] DEST"
|
||||||
@@ -13,20 +14,20 @@ else
|
|||||||
echo "\$AUTOPILOT_HOST is set to $host"
|
echo "\$AUTOPILOT_HOST is set to $host"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Uploading..."
|
user=pi
|
||||||
|
if [ -n "${AUTOPILOT_USER}" ]; then
|
||||||
|
user=${AUTOPILOT_USER}
|
||||||
|
fi
|
||||||
|
|
||||||
# Get last argument
|
# Get last argument
|
||||||
for last; do true; done
|
for last; do true; done
|
||||||
|
|
||||||
# Go through source files and push them one by one.
|
# All except last argument
|
||||||
i=0
|
length=$(($#-1))
|
||||||
for arg
|
src_files=${@:1:$length}
|
||||||
do
|
|
||||||
if [[ $((i+1)) == "$#" ]]; then
|
echo "Uploading $src_files..."
|
||||||
break
|
|
||||||
fi
|
# Upload files
|
||||||
# echo "Pushing $arg to $last"
|
scp -r $src_files ${user}@${host}:$last
|
||||||
#adb push $arg $last
|
|
||||||
scp $arg pi@$host:$last
|
|
||||||
((i+=1))
|
|
||||||
done
|
|
||||||
|
|||||||
@@ -53,11 +53,13 @@ elseif ("${BOARD}" STREQUAL "rpi")
|
|||||||
-Wl,--end-group
|
-Wl,--end-group
|
||||||
)
|
)
|
||||||
|
|
||||||
|
file(GLOB RPI_CONFIG_FILES ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config)
|
||||||
px4_add_scp_push(OUT upload
|
px4_add_scp_push(OUT upload
|
||||||
OS ${OS}
|
OS ${OS}
|
||||||
BOARD ${BOARD}
|
BOARD ${BOARD}
|
||||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/px4
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/px4
|
||||||
${PX4_SOURCE_DIR}/posix-configs/rpi/px4.config
|
${RPI_CONFIG_FILES}
|
||||||
|
${PX4_SOURCE_DIR}/ROMFS
|
||||||
DEPENDS px4
|
DEPENDS px4
|
||||||
DEST /home/pi)
|
DEST /home/pi)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user