Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
qtrpi/deploy-qtrpi.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
61 lines (49 sloc)
1.96 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source ${0%/*}/utils/common.sh | |
OUTPUT_DIR=$ROOT/raspi/qt5pi | |
check_env_vars | |
cd_root | |
function usage() { | |
cat <<EOF | |
Usage: $0 [options] | |
-h| --help Display help text. | |
-p| --prepare-rpi Prepare the Raspberry Pi device by: | |
- Installing package dependencies for Qt | |
- Add /usr/local/qt5pi/lib to the ldd list of directories | |
- Fix libEGL and libGLESv2 links | |
EOF | |
} | |
# Parse arguments | |
while [[ $# -gt 0 ]]; do | |
KEY="$1" | |
case $KEY in | |
-h|--help) | |
DISPLAY_HELP=true | |
;; | |
-p|--prepare-rpi) | |
PREPARE_RPI=true | |
;; | |
*) | |
;; | |
esac | |
shift | |
done | |
if [[ $DISPLAY_HELP ]]; then | |
usage | |
exit 0 | |
fi | |
if [[ $PREPARE_RPI ]]; then | |
TARGET_USER=$(echo $TARGET_HOST | cut -d@ -f1) | |
ssh $TARGET_HOST "sudo mkdir /usr/local/qt5pi ; sudo chown -R ${TARGET_USER}:users /usr/local/qt5pi" | |
ssh $TARGET_HOST 'sudo apt-get install -y apt-transport-https' | |
ssh $TARGET_HOST 'sudo apt-get install -y libts-0.0-0 libinput5 fontconfig' | |
ssh $TARGET_HOST "sudo sh -c 'echo /usr/local/qt5pi/lib > /etc/ld.so.conf.d/99-qt5pi.conf'" | |
# to fix which version of libEGL should be picked by Qt applications (/opt/vc rather than /usr/lib/....) | |
ssh $TARGET_HOST "sudo sh -c 'rm /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0'" | |
ssh $TARGET_HOST "sudo sh -c 'ln -sf /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0'" | |
ssh $TARGET_HOST "sudo sh -c 'ln -sf /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1'" | |
ssh $TARGET_HOST "sudo sh -c 'ln -sf /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0'" | |
ssh $TARGET_HOST "sudo sh -c 'ln -sf /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2'" | |
fi | |
rsync -avz $OUTPUT_DIR $TARGET_HOST:/usr/local/ | |
ssh $TARGET_HOST 'sudo ldconfig' | |