3rd party repositories can be checked out to RetroPie-Setup/ext
Repositories should be structured so you have:
ext/REPOSITORY/scriptmodules
Modules are only read from the following subfolders of scriptmodules
* emulators
* libretrocores
* ports
* supplementary
* admin
Previously, allthough all modules were read in, we only displayed modules that were enabled for
the current system. This has caused some confusion in the past with people installing RetroPie on another
system and wondering where a package is.
Now all packages are shown via retropie_packages.sh and in setup menus with information if they are
not enabled for the current system.
rather than multiple arrays for each module info we now use a single array with
__mod_info(ID/KEY) where key is type/desc/help/licence/flags etc
we still keep __mod_id() - a standard indexed array with every module id (used for setup menus etc) and
__mod_idx() which references the index # from the id
this will make it easier to extend in the future
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.
Make sure the function can be run outside of an install by creating needed folders.
Use download function rather than wget for wad download
De-Duplicate paths
Use mktemp for temporary files (game_data actually had a typo on $__tmpdir, so it used the current folder).
Make sure destination exists, so the function works outside of a full install, and de-duplicate paths
Also de-duplicate descent1/descent2 paths using dest_d1/dest_d2 vars, making sure they exist
in case the function is called outside of a full install. Also update urls to the new https location.
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