The 'xorg' (meta)-package will install the necessary packages to run an Xorg server and to launch applications under an Xorg environment.
We need to map 'xorg' for:
- Pi5 needs an additional package that provides configuration for Xorg, without it the server will not start. Unfortunately the package has no reverse dependency (for now), so it must be installed explicitely.
- One of the recommended packages installed is the 'xserver-xorg-legacy' package, which breaks our x11 apps launched from `runcommand`. We already uninstall it when the setup script starts (regardless of how it was installed), but let's not install it ourselves when 'xorg' is a dependency for one of our own scriptmodules.
NOTE: `runcommand` breakage under `-legacy` is due to our redirection of STDIN/STDOUT. The `-legacy` provided wrapper checks whether the current controlling tty is a 'real console' tty by looking at the major/minor device numbers and bails out if it's not 4/1.
Added support for detecting if running on a Armbian built system.
Armbian is built on Debian/Ubuntu, so we're not changing the OS release/name.
* Added support for Armbian's Linux kernel package naming, in order to be able to install the kernel headers.
* Removed the ZRAM config from our own menu, Since Armbian has its own configuration tool (`armbian-config`) that handles it. ZRAM is configured and enabled y default on Armbian images.
Starting with the Bookworm RaspiOS release, the Linux kernel package is no longer a monolithic package and it has been split in several packages, named after their build configuration, which in turn is dictated by the Pi model and architecture (`armhf`/`aarch64`).
This change adds support for the Linux kernel headers packages on the new OS release, which followed a similar split from the previously used `raspberrypi-kernel-headers` package.
NOTES:
* mixed kernel/userland archs are not supported. By default, an `armhf` RaspiOS installation will boot the Pi4/Pi5 with the 64bit kernel, but the corresponding headers package is not installable. While the Pi4 can still boot a 32bit kernel by adding `arm_64bit=0` to `/boot{/firmware}/config.txt`, the Pi5 does not have this capability.
* on the RaspiOS Bookworm images the Linux kernel images/headers are already installed, the mapping and installation will have effect if the user explicitely removes the header packages.
The `libfreetype6-dev` package has been replaced with `libfreetype-dev` since Debian 11 _bullseye_ [1].
It's not present in the current Debian testing (_trixie_) and Ubuntu 23.10 [2]
Added a mapping for the package, since it will help installing RetroPie on Ubuntu 23.10.
When we stop supporting _buster_, we can remove the mapping and replace any `libfreetype6-dev` dependencies in the scriptmodules with the new package.
[1] https://packages.debian.org/bullseye/libfreetype6-dev - marked as 'transitional'
[2] https://packages.ubuntu.com/search?keywords=libfreetype6-dev - removed from Ubuntu 23.10
On a multiarch system both amd64 and i386 versions of a package may be installed.
This would cause both to be returned by dpkg-query on a single line causing the extracting of version and install status to fail.
It now splits the output onto multiple lines and grabs the first line to workaround this.
Fixes#3679
Added more info about the usage and mentioned the return value to differentiate between ok/cancel buttons.
Modified the prompt text for the `dialog` based inputbox so it's similar to how the OSK script shows it.
If the OSK is installed it will be used for input, otherwise it will fall back to using dialog --inputbox
function takes 3 parameters:
The title of the dialog, the default text and a minimum number of characters to accept.
Adjusted wifi module to use the new inputBox. There is no need to redirect cmd output with 2>&1 >/dev/tty as the inputBox function does this.
There was a mix of compareVersions "$__os_debian_ver" OP $arg and [[ "$__os_debian_ver OP $arg ]] around the code.
As $__os_debian_ver is always an integer, use the bash built in operators for performance.
The compareVersions call is significantly slower as it uses an external command (dpkg).
In the past unsupported scriptmodules for a platform were not loaded, so rp_hasModule would only return true if the module was available for the platform.
As we now load all modules for displaying of information in retropie_setup / retropie_packages output, rp_hasModule function will return true, so we need to use rp_isEnabled instead.
This fixes installing scriptmodules with an sdl1.2-dev dependency on non RPi (eg x86/x11), that previously forced our custom sdl1 and then failed as it's disabled for the target.
Removed deprecated and unused shader parameter support from ensureSystemretroconfig.
defaultRAConfig takes a single parameter for the system name, but also allows additional
parameter pairs to be added to set default ini configuration key/values
eg. defaultRAConfig "dreamcast" "fps_show" "true"
It also uses $md_conf_root as a base, which ensureSystemretroconfig didn't handle, so we save and reset
this for backward compatibility for anything still using ensureSystemretroconfig
When doing a shallow clone, also add --shallow-submodules which will do a shallow clone of submodules
with depth 1.
This significantly speeds up checkouts of repositories with a lot of submodules (eg lr-tic80).
When env __persistent_repos is 1, we do full checkouts of repositories. This allows users with diskspace to spare
to speed up source updates, by avoiding doing a shallow clone everytime.
However, it was not working for cases where a module switched to a newer tag/branch as remote changes were not
fetched first. This is now fixed.
Also fixed errors thrown when calling gitPullOrClone on an existing repository when doing git pull, when HEAD
is detached (for tags) or there is no tracking branch.
Move much of the helpers.sh start/stop logic and default parameters to a joy2key wrapper script.
Switch runcommand.sh to use new wrapper script
Add tab button to "y" key for use in edit dialogs
Remove runcommand $md_inst on update. If old joy2key is present in runcommand install, trigger joy2key module install.
Remove system.sh python3-sdl2 dependency check - moved to joy2key_depends
Added a new `joy2key` implementation, using PySDL2 for joystick event handling.
PySDL2 is a python module that wraps SDL2 (and other SDL libraries) using the built-in `ctypes` module.
Pros:
* event handling is simplified a bit, using SDL's event loop.
* (subjective) the code is a bit more structured and easy to follow.
* joystick handling is rewritten based on EmulationStation code, movement is smoother and scrolling is improved.
* support for input repeat to improve scrolling, just keep the input pressed and scrolling continues
Cons:
* module is a bit larger (296 LOC vs 224 in current joy2key.py)
* needs PySDL2 (which might not be packaged, see the notes below) and SDL2
* arguably, device config to keyboard event mapping is more complex (abstracted as InputDev)
Notes:
* availability of PySDL2 as a system package is good, but it's not standard in Debian 10 (stable) at the moment.
The module is present though (as a backport) in Ubuntu 18.04 (and later) and Raspberry Pi OS (Buster).
When it will be universally available, we should probably revisit the code that checks for the version and make it a hard requirement in `get_retropie_depends`, similar to `python3-pyudev`.
* added PgUp/PgDown to the default parameters for `joy2key`, they are mapped in a similar fashion to EmulationStation to the shoulder buttons. This doesn't apply to Runcommand's invocation, since it uses a different set of parameters.
* added a configuration option in `runcommand` for selecting the joy2key version used. Default is the SDL version (when PySDL2 is installed), with the ability to fallback to the previous version (udev based).
This replaces the function __get_current_backends from backends.sh and makes it available to other modules.
Reworded the setBackend function description using emulator.cfg key instead of module_id as some modules
have multiple emulator entries, and the backend config is managed per entry.
Curl can throw an error "(23) Failed writing body" if piping the output to grep, or something that closes the stream
early due to the way curl buffers. Adding --no-buffer when output is stdout (dest of "-") fixes this. This error
didn't cause any failures but _get_branch_mame could cause this error to be logged.
Also switched "-s" to "--silent". We have a lot of curl arguments and it's more intuitive to use the descriptive
names.
This replaces the dispmanx module functionality and reworks the way backend configuration is done,
including adding support for choosing to use X11 for modules using sdl1 or sdl2. A new supplementary
module "backends" handles the configuration (replacing the dispmanx module).
On upgrade /opt/retropie/configs/all/dispmanx.cfg is renamed to /opt/retropie/configs/all/backends.cfg
Existing settings in this file will still work, but will be updated when using the backends configuration.
Previously for some modules that use sdl1, a flag "dispmanx" was set to specify that the code worked
with the sdl1 dispmanx driver on videocore/fkms on the RPI.
This has been replaced with the flags "sdl1" "sdl2" and "sdl1-videocore"
The backend module will use the flags to determine which driver backends are available for current system.
For modules such as advmame which use sdl1 on videocore and sdl2 on other systems, the sdl1-videocore flag
can be used which will only apply to the rpi1-3 using the legacy drivers.
The setDispmanx call to default a module to the dispmanx driver has been replaced with setBackend,
but the setDispmanx function is left for 3rd party module compatibility.
Calls to setDispmanx should be replaced with a call such as:
setBackend "$md_id" "dispmanx"
But support for dispmanx should be checked in the module - eg
hasPlatform "dispmanx" && setBackend "$md_id" "dispmanx"
Module hooks for configure_dispmanx_on / conigure_dispmanx_off are no longer used (only used by fuse).
Instead a function _backend_set_ID is called, with the backend to use, and a force parameter.
By default no existing backend configuration is changed when calling setBackend, unless an additional
parameter of 1 is added. This is so a module won't overwrite a user's existing configuration.
If a module is set to launch under dispmanx, runcommand will handle it as before, but will also
now handle launching sdl1 and sdl2 modules under X. It will also run the matchbox-window-manager
which is required by some software.
If switching a module to launch under X it will check for the correct dependencies. If not installed
the user will be asked to confirm installation.
Create a new function isConnected in helpers.sh which calls getIPAddress, but also sets a new global
__NET_ERRMSG if not connected. This is used in setup.sh and packages.sh so we don't duplicate the same
message between files.
Split out a new function runCurl from the download function, to do lower level curl calls, but capture any
errors into __NET_ERRMSG for display in setup.sh or via the packaging functions. Use a connect timeout of 10
in the download function rather than 60 which is quite long, but keep the 60 second limit on no data transfer.
Adjust rp_remoteFileExists to use runCurl, so we can capture any error when checking a remote file,
and use this value for display in setup and in logs etc. Switch to using long versions of curl options for
readability, and add --show-error so we still output errors when being silent.
Also switch rp_getFileDate to use new runCurl function, so that any curl argument overrides are handled, and use
long format parameters also. No error handling is done here though.
rp_module_repo is currently in the format
TYPE URL BRANCH COMMIT
where type is file, git or svn
If rp_module_repo URL BRANCH or COMMIT starts with a : the rest is considered to be a function that
will return the URL, BRANCH, or COMMIT via an echo. This allows for using of the new rp_module_repo
by modules that use some logic to determine what branch / commit is used.
eg. Some modules will use an older branch based on the system they are running on.
These variables are resolved before use, as some modules query the net for information, so we only
want to check these just before they are used.
curl outputs the download progress to stderr, and there doesn't seem a way to output progress
to stdout and errors to stderr.
this means we capture the progress also, but on error, extract the last line of output for error display
Use a connect timeout of 60, with a speed limit of 1, and speed time of 60, so curl will abort if no data
is transferred for 60 seconds.
__curl_args can be set to override curl options - these are added after the defaults, which will override
them if provided.
adjust download and downloadAndVerify functions to use bash builtin to extract basename of url,
and test if destination is a folder. If it's a folder download to basename of url to that folder
A destination parameter of - will now output to stdout, for use in modules where they call wget directly.
We can now replace them with a download call, and also catch/log errors, but it also de-duplicates having
each function handle wget/curl itself. It can also be used to capture output into a variable etc.
Modified the `dkmsManager` function to account for cases when the running
kernel is replaced before the module installation, so `dkms` cannot build the module.
If the module cannot be built for the running kernel version, then instruct `dkms` to build
for the installed kernels that have a valid `build` folder/symlink present.
Installations performed under a 'chroot' are also handled with the new additions,
so there is no need for separate handling.
This covers situations when the user does an upgrade of the distro's packages and
RetroPie's drivers at the same time. Raspberry Pi OS replaces the current kernel
and the kernel headers for the running version are no longer found, so the driver(s) installed
are not updated from their scriptmodule by `dkmsManager`.
As a side note, Raspberry Pi OS has 4 kernels shipped with the same package:
- kernel.img ($ver+) for Pi 0/1
- kernel7.img ($ver-v7+) for Pi 2/3
- kernel7l.img ($ver-v7l+) for Pi4
- kernel8.img ($ver-v8+) for Pi4 with the `aarch64` architecture (enabled by `arm_64bit` option in `configtxt`)
For each kernel, there's a corresponding folder under `/lib/modules`. Explained in [1].
The 'chroot' installation didn't install the module for all the versions on the RPI image, it chose
the last sub-folder (which would be the `$ver-v8+`, for `aarch64`), so the latest images don't have the `xpad` driver installed correctly.
Ref:
[1] the `kernel` option from https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
* switched to use -eq so it will be less strict with for example whitespace in value
* do a test for -eq 0 rather than just else, to avoid defaulting to 0 in the case of a bad config