* default signing key can be overridden with __gpg_signing_key
* added gpg dependency by default
* download retropie key from ubuntu keyserver if it doesn't exist in keyring
* added download helper function
* rework logic for rp_installBin and rp_createBin
* copy secret key to chroots for package building
This was adjusted previously to resolve an issue with a sdl2 "ne" check - but broke another case where
hasPackage usbmount "0.0.24" would return ok when usbmount had been previously installed but removed.
We now always do compareVersions when a version / boolean operator is used, but avoid comparing against
any versions of removed packages by blanking the version string of any removed package.
This should now handle installed/not installed packages and boolean operators correctly
* create a rp_getBinaryUrl function to get the binary url of a package
* if a module has a __binary_url and it returns an empty string, treat this as no binary available - this allows removing hardcoded logic for sdl1/sdl2 from getDepends
* if a module doesn't have this function but it has its own install_bin don't test for a binary and assume it's ok
this was done on the old getDepends and we need to keep this until the sdl1/sdl2 modules are improved
the sdl1/sdl2 modules have an install_bin which is called even if no binaries for a platform are available.
until we have some mechanism for a module to have it's own hasBinary type function we need to keep a check here.
* add a _mapDepends function to handle package renames on different systems and also better manage our customer packages
* rework existing logic, to more easily manage custom modules that satisfy dependencies
* custom modules are only used if they exist to avoid duplicating logic on top of our module platform flags
if a check was done such as
if hasPackage sdl2-dev 2.0.10 ne
and sdl2-dev wasn't installed, it would return as false due to the package not being installed. In this
case it should have returned ok, as the package installed is not equal to that version.
This will affect any other kms platforms (tinker), which I will need to revisit - but as the dispmanx backend works
on the rpi4, that's the first priority.
The previous method would prevent custom sdl1 being installed, but it
also caused erroneous flagging of libsdl1.2-dev for installation when
already installed.
* the function obtains an externally routable source IP address for the machine
* an IPv4 route is tried first and, if not found, then an IPv6 route is tried
* the function also handles queries for specific devices (used in `wifi.sh`)
* replace all instances of `ip route (...)` with new `getIPAddress` function
joy2key:
* Protect signal_handler from concurrent calls via multiple kill requests
* Daemonize to background as soon as signal handlers are registered;
guarantees that joy2keyStart/start_joy2key returns only when the script
is in a functional state (and thus the stop calls can't run too early).
* Ensure tty_fd is also closed on exit.
* Remove parent PID check (not useful when script daemonizes itself).
helper/runcommand:
* Don't run script in background.
* Remove parent PID variable (no longer needed).
* Clear joy2key PID upon kill to avoid unbalanced stop calls (although
the script now protects from this via signal_handler).
* Add 1 second sleep to stop functions to avoid problems on instant
stop/start (e.g. wikiview).
The sys.exit() function actually calls an exception (SystemExit), but our
script handles naked exceptions which can result in the script not terminating
properly. Fix by ensuring that all exceptions specify the relevant exception type only.
Additionally:
* Send default TERM signal, as issuing INT during early initialization can raise a KeyboardInterrupt exception.
* Open tty with 'append' flag to avoid ghost input
* Add check for 'js_fds' to avoid rare exception on quit during early init
* Modify script to quit automatically when parent process exits.
* Add joy2keyStop/stop_joy2key for certain rare edge cases.
* change existing calls which used --strip-components
* use multiple parameters for arguments which should allow additional arguments with spaces
* implements #2630
Without an explicit `return` command, functions in bash default to
returning the exit value of the last command executed.
The current implementation of `printMsgs()` uses `[[..]]` tests for
deciding on the output type (dialog, heading, console), however if
the last test (for heading) is false, then this will be the final
exit value to be returned from `printMsgs()`. In other words, for
all cases except "heading", it always will return `1` (false).
* Isolate update hook to installed modules
* Check specific target module version
* Trigger full scriptmodule install when check fails, to ensure
old module installations are also updated to latest version.
Introduce new DKMS helper function to consolidate DKMS management in
the relevant scriptmodules (customhidsony, mkarcadejoystick and xpad).
The helper will properly remove old versions of DKMS modules to prevent
"dkms.conf not found" errors occurring when removing a related scriptmodule
but an older DKMS module version was present.
Also fix the update hooks and ensure proper module reload when needed.
* Minor Bug: the `git branch -D $commit` command should run in `$dir`, otherwise it
fails if `$dir` is different than `$PWD`, for example:
function sources_module() {
# here $PWD is 'tmp/build/module'
gitPullOrClone "/other" https://github.com/user/repo branch commit
}
* Enhancement: print the status (branch/commit) of HEAD after any operation. It is
useful to know exactly at which branch/commit the pull/clone operation left the
requested repository, specially on calls without branch/commit arguments where
this information is not directly visible.
* allow modules to still use libpng12-dev but show a message for them to be updated
* change libpng-dev dependency to libpng12-dev for Jessie and older
* use a branch of the same name as the commit
* switch to chosen branch before doing git pull on update
* use -n to check if there is a parameter
* use PrintMsgs
Detecting stdin is tricky as discussed in #2467. Use a function
parameter instead of passing a custom launch script through stdin.
The new signature of addPort() is:
@fn addPort()
@param id id of the module / command
@param port name of the port
@param name display name for the launch script
@param cmd commandline to launch
@param game rom/game parameter (optional)
@param script launch script to use instead of the default (optional - requires game to be set)
This new signature does not break scripts using the previous signature.
Example usage with the new signature:
local script
read -r -d "" script <<_EOF_
#!/bin/bash
(: any custom launch script content)
_EOF
addPort "$md_id" "example" "Example Title" "$md_inst/game_exec" "" "$script"
In the case that /etc/fb.modes doesn't already exists,
ensureFBMode() will create an empty file only containing the
custom RetroPie video mode entry.
The above is problematic for example when `fbset` is not installed
beforehand. The package installation will detect the modified
version of /etc/fb.modes as user-customised and will prompt the user
what to do with the conflict, e.g. use the maintainer's version
(that doesn't include the RetroPie video mode entry) or keep the
modified version (that doesn't include the stock entries).
The safest solution is for ensureFBMode() to simply do nothing if
/etc/fb.modes doesn't exist already. After installing `fbset`, the
file will exist and ensureFBMode() will add the custom video mode
alongside the stock entries as expected.
In the case that /etc/fb.modes doesn't already exists,
ensureFBMode() will create an empty file only containing the
custom RetroPie video mode entry.
The above is problematic for example when `fbset` is not installed
beforehand. The package installation will detect the modified
version of /etc/fb.modes as user-customised and will prompt the user
what to do with the conflict, e.g. use the maintainer's version
(that doesn't include the RetroPie video mode entry) or keep the
modified version (that doesn't include the stock entries).
The safest solution is for ensureFBMode() to simply do nothing if
/etc/fb.modes doesn't exist already. After installing `fbset`, the
file will exist and ensureFBMode() will add the custom video mode
alongside the stock entries as expected.