Commit graph

392 commits

Author SHA1 Message Date
Jools Wills
ddabb2a902 system / packages - added signing of binary packages
* 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
2020-09-10 06:25:45 +01:00
Jools Wills
9cafd9f3eb Revert "helpers - temporarily disable all libretro git urls due to libretro being hacked"
This reverts commit c3cdcd5333.
2020-08-17 11:27:30 +01:00
Jools Wills
c3cdcd5333 helpers - temporarily disable all libretro git urls due to libretro being hacked 2020-08-16 06:27:39 +01:00
Jools Wills
62cbe817b8 system / helpers - use an array for __platforn_flags
* set 32/64bit flag early to be used in platform configuration
 * add __platform to platform flags early on rather in isPlatform check
2020-07-30 04:28:30 +01:00
Jools Wills
c500b21e3d helpers - remove old backward compatibility code 2020-07-03 04:19:16 +01:00
Jools Wills
5908ba5960 helpers - fix up port removal logic
* don't remove port launch script unless the port emulators.cfg is empty
 * call delSystem with the correct parameters
2020-07-03 04:14:40 +01:00
Jools Wills
9808c28a0b helpers - fix system removal logic in addSystem and remove from addEmulators 2020-07-03 04:02:21 +01:00
Timothy Allen
2f55d0bed8 exclude modprobe when in chroot 2020-06-26 23:53:41 -04:00
Jools Wills
60632e1dcd helpers - rework hasPackage logic to fix some cases where it failed
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
2020-05-26 02:59:08 +01:00
Jools Wills
12414f49eb sdl1 / sdl2 - add __binary_url functions and rework packaging logic
* 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
2020-03-17 04:37:02 +00:00
Jools Wills
3b6947c0e5 helpers - we need to check for __has_binaries and choose binary/source install for custom packages
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.
2020-03-13 19:40:58 +00:00
Jools Wills
e03ab92b0d helpers - rework getDepends logic
* 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
2020-03-10 02:12:03 +00:00
Jools Wills
eaab48a9b0 helpers - fix hasPackage returning incorrect status when not installed in some cases
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.
2020-03-10 01:52:16 +00:00
Jools Wills
ee074bcb1c helpers - use __memory_avail in rpSwapOn 2020-03-08 06:26:07 +00:00
hissingshark
87d1e19b0e Advertise Vero4K as a Mali platform 2020-03-02 06:38:46 +00:00
Jools Wills
4e36f6ebd9 enable our custom sdl1 and dispmanx config for kms backend
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.
2020-02-05 05:52:36 +00:00
Jools Wills
a8296475fa helpers / getDepends - add a virtual package LINUX-HEADERS to map to header package for rpi / Debian / Ubuntu 2020-02-01 00:09:40 +00:00
Jools Wills
cf5c76ce35 Merge remote-tracking branch 'retropie/master' into fkms_rpi4 2019-12-23 06:43:28 +00:00
Jools Wills
07b681c41d helpers - added an adminRsync function for use with admin modules for uploading data to our server 2019-12-20 18:00:50 +00:00
Jools Wills
8a2468cf4b Merge remote-tracking branch 'retropie/master' into fkms_rpi4 2019-09-13 04:24:40 +01:00
Jools Wills
84d976ad1c helpers / gitPullOrClone - add a depth parameter and default to shallow cloning - #2678
* use a depth of 0 for xroar to do a full depth clone as the repository doesn't support shallow cloning
2019-09-11 04:52:55 +01:00
Jools Wills
5af44c12b7 Merge remote-tracking branch 'retropie/master' into fkms_rpi4 2019-07-29 15:59:04 +01:00
Conn O'Griofa
acd4f0ae2a helpers: getDepends: exclude sdl1 properly for mesa targets
The previous method would prevent custom sdl1 being installed, but it
also caused erroneous flagging of libsdl1.2-dev for installation when
already installed.
2019-07-29 06:06:11 +01:00
hissingshark
b82d8ca921 gitPullOrClone sets a branch of "master" if none supplied, but then doesn't enforce it. A branch selection of "master" is ignored and the repository's default is used - which may not be master at all e.g. Reicast made the default a very unstable alpha branch. 2019-07-16 06:59:45 +01:00
Conn O'Griofa
573423214f helpers: don't install SDL1 on fkms targets 2019-07-04 03:34:20 +01:00
Jools Wills
ec94daa840 helpers / joy2key - map escape onto button 3
* allows exiting from alsamixer with a gamepad when launched from RetroPie-Setup
2019-06-24 00:35:05 +01:00
Jools Wills
93ec8acf82 helpers - don't use our custom sdl2 by default on x11 target
* resolves issues with recent Ubuntu packages having dependencies on a specific sdl2 version - eg libavdevice58
2019-05-11 17:04:17 +01:00
Hugo Hromic
1e849710d8 helpers - add getIPAddress() function
* 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
2019-03-27 18:39:24 +00:00
Conn O'Griofa
750a61e48f joy2key: daemonize to prevent early-init related errors
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).
2019-03-17 01:12:08 +00:00
Conn O'Griofa
f614804f23 joy2key: fix sys.exit() by avoiding naked exceptions
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.
2019-03-10 02:43:12 +00:00
Jools Wills
f22f92d13e helpers / downloadAndExtract - allow additional parameters for both tar and unzip
* change existing calls which used --strip-components
 * use multiple parameters for arguments which should allow additional arguments with spaces
 * implements #2630
2019-02-27 06:36:28 +00:00
Hugo Hromic
106d21b64e helpers - fix printMsgs() return value
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).
2019-02-25 11:50:35 +00:00
Conn O'Griofa
37a96b40c2 helpers: fix dkmsManager remove for "added" modules
"dkms status" uses different formatting for modules that are "added"
compared to installed modules.
2019-02-25 00:05:43 +00:00
Conn O'Griofa
12cbfceaba dkmsManager: remove update_hook
This might cause issues due to unexpected module rebuilds on script update.
2019-02-07 21:42:18 +00:00
Conn O'Griofa
ebb2309ae7 joy2keyStart: add delay to work around launch issue
Reference: https://retropie.org.uk/forum/topic/21139/error-and-gui-terminates-back-to-es-when-launching-retropie-setup-direct-on-machine-libudev-but-ssh-is-ok
2019-02-06 23:36:28 +00:00
Conn O'Griofa
0f443c1b18 dkmsmanager: improve update hook
* 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.
2019-02-06 20:35:43 +00:00
Conn O'Griofa
1b8dfdefca helpers: add dkmsManager helper function
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.
2019-02-06 00:27:14 +00:00
Hugo Hromic
24ccc56274 helpers / gitPullOrClone - ensure git branch command runs in $dir and print HEAD status
* 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.
2019-01-29 11:37:54 +00:00
Jools Wills
b9a08d28fb helpers / addEmulator - adjust the logic for automatic RA cmd generation
* match against any cmd parameter that is an .so in $md_inst
2018-12-06 14:05:42 +00:00
Jools Wills
a65cc3280a helpers - add ~/.cache ~/.config ~/.local ~/.local/share folder used by some modules 2018-12-05 20:37:52 +00:00
Jools Wills
f474d0fcbd switch to newer package name libpng-dev over libpng12-dev for dependencies.
* 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
2018-10-18 19:08:56 +01:00
Jools Wills
e25569323b helpers / gitPullOrClone - fix calling a second time when a specific commit is used
* 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
2018-10-18 14:19:44 +01:00
Jools Wills
c86f0e835d addPort - remove script parameter and handle in scriptmodule 2018-08-23 16:34:04 +01:00
Hugo Hromic
9534c179b8 helpers - replace stdin support in addPort() with a function parameter
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"
2018-08-22 17:52:50 +01:00
Hugo Hromic
a367202167 helpers - remove stdin support from applyPatch()
Detecting stdin is tricky as discussed in #2467. Instead, all patches
are now required to be in files in each module's $md_data directory.
2018-08-22 17:52:29 +01:00
Hugo Hromic
aeb4094dde helpers - getDepends(): add workaround for libraspberrypi-bin in osmc and xbian
Similar to `libraspberrypi-dev` having different names in osmc and xbian,
the `libraspberrypi-bin` package also has different names in these OSs.
2018-08-16 15:22:13 +01:00
Hugo Hromic
f0a42cffc4 helpers - ensureFBMode(): no-op if /etc/fb.modes doesn't exist
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.
2018-08-16 09:59:44 +01:00
Jools Wills
869a8002a7
Revert "dependency fixes to helpers, runcommand and mupen64plus" 2018-08-16 02:07:30 +01:00
Hugo Hromic
0ba2a63b36 helpers - ensureFBMode(): no-op if /etc/fb.modes doesn't exist
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.
2018-08-12 11:06:00 +01:00
hissingshark
3e21a64598 Add detection/build params/fixes for Vero4k and let gitPullOrClone wind back to a specific commit 2018-07-19 09:08:19 +01:00