```
Post Link Common
/bin/sh: 1: /home/runner/work/qgroundcontrol/qgroundcontrol/deploy/linux-fixup-rpaths.bash: not found
make: *** [staging/QGroundControl] Error 127
Makefile:2944: recipe for target 'staging/QGroundControl' failed
Error: Process completed with exit code 2.
```
- script is clean according to shellcheck.net
- added the script to the QGCPostLinkCommon
- added patchelf to the Dockerfile and the github workflows for Linux
* For https://github.com/mavlink/qgroundcontrol/pull/9947
this solves libairmap and most of the qt libraries. but note some defects still exist:
```
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
The above error is solved with `QT_PLUGIN_PATH=./Qt/plugins`.
After that, the below error message shows up:
```
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
./QGroundControl: symbol lookup error: /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
```
Setting `LD_LIBRARY_PATH=./Qt/libs` appears to solve that one.
It looks like some of the Qt libraries need to be configured? I spent a half hour looking at that and didn't find a quick/easy solution.
* QT_PLUGIN_PATH might be solved with `QCoreApplication::addLibraryPath()` set to `QCoreApplication::applicationDirPath() / "Qt/libs"`, but I'm not 100% sure if it needs to be platform specific.
* I'm not sure which library is trying to poke at `libQt5XcbQpa` or how to solve that at runtime.
Both of the environment variables can be avoided by using `qt.conf` in the same directory:
```
$ cat <<EOF | tee qt.conf
[Paths]
Prefix=./
Libraryes=Qt/libs
Plugins=Qt/plugins
EOF
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
./QGroundControl: symbol lookup error: /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
```
which reaches us to the same undefined symbol error pointing to a system-installed Qt-5 library...
A little bit of a rabbit hole suggests that `patchelf` can solve our problem:
```
$ ldd ./Qt/plugins/platforms/libqxcb.so | grep -i libQt
./Qt/plugins/platforms/libqxcb.so: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by ./Qt/plugins/platforms/libqxcb.so)
libQt5XcbQpa.so.5 => /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007f8c6ad23000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f8c6a616000)
libQt5DBus.so.5 => /lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007f8c6a57a000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f8c6a02f000)
$ patchelf --set-rpath \$ORIGIN/../../libs ./Qt/plugins/platforms/libqxcb.so
$ ldd staging/Qt/plugins/platforms/libqxcb.so | grep -i libQt
libQt5XcbQpa.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5XcbQpa.so.5 (0x00007fceceef1000)
libQt5Gui.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5Gui.so.5 (0x00007fcece479000)
libQt5DBus.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5DBus.so.5 (0x00007fcece1eb000)
libQt5Core.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5Core.so.5 (0x00007fcecd9f5000)
```
However, `patchelf` is not available on all systems...
In case when you would like to bind some MAV commands
to some joystick's buttons, you can now create a json file
which will be parsed at runtime.
It is usefull when you need to send a custom command from the joystick.
But this command is not supported by the firmware, or not relevant to be included to QGC.
Example:
Create a file JoystickMavCommands.json and place it with a binary:
"commands": [
{
"id": 31010,
"name": "Enable Autonomy",
"param1": 1.0
}
]
After executing the QGC, you will be able to bind "Enable Autonomy" to a button,
by clicking to the button, MAV_CMD_USER_1 (31010) with param1 1.0 will be sent.
If there is no json file, nothing will happen.
The _mavlinkCameraStorageSupported currently tests that
_mavlinkCamera.storageStatus === QGCCameraControl.STORAGE_NOT_SUPPORTED
Which is the opposite of what the name of the property suggests.
Two uses of the property expect that it does what it says, while one
use expects what it actually does.
This changes the test to make the property actually mean what it says
and fixes the use that requires the opposite case.
The SERIAL_CONSOLE message now includes a target_system and
target_comonent which prevents serial messages being sent to the wrong
vehicle in case there are multiple vehicles connected.
More background:
https://github.com/mavlink/mavlink/pull/1725