-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for unRAID 6.10; add some docs on how to develop
- Loading branch information
Showing
9 changed files
with
251 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Developer How-To | ||
|
||
## Prerequisites | ||
|
||
unRAID installs plugins from an HTTP server, so in order to install your locally-modified version you'll need some way to serve the files over HTTP. There is no HTTP server included with this distribution, but several popular development environments include an easy way to launch one. | ||
|
||
1. NodeJS. This is the one I use. Just run `npx http-server` in the top level of the plugin repo (the directory that contains this file). This will serve the files at `http://[your ip address]:8080/`. | ||
2. Python (3+). This is untested, but it should work. Run `python -m http.server 8080` and the files will (should) be available at `http://[your ip address]:8080/`. | ||
|
||
## Getting Started | ||
|
||
Open up [`gow.plg`](gow.plg) and change the `gitPkgURL` entity to point to `http://[your ip address]:8080`. Be sure to use the IP address of the system you're doing the dev work on; this may not necessarily be your unRAID server. It should _not_ end with a trailing slash. Also change the `gitReleaseURL` entity to `http://[your ip address]:8080/package-dist`. It should likewise have no trailing slash. | ||
|
||
The majority of the functionality of this plugin is implemented in various "packages" (see the `packages/` directory); this provides a convenient mechanism to break the work down into manageable chunks with a standardized way of installing, uninstalling, reloading after reboot, etc. | ||
|
||
Installing and uninstalling packages is managed by the [`preinstall.sh`](scripts/preinstall.sh), [`install.sh`](scripts/install.sh), and [`uninstall.sh`](scripts/uninstall.sh) scripts. Any time you modify one of these, you'll need to update the MD5 and SHA256 hashes in [`gow.plg`](gow.plg). The SHA256 hash takes precedence if both exist, but the MD5 hash is left in for older versions of unRAID. (TODO: it's possible we don't need these anymore) | ||
|
||
Now it's time to try installing your development version of the plugin. Open a terminal on your unRAID server and uninstall the old version of GoW (if you have one installed), then install the new version: | ||
```sh | ||
$ plugin remove gow.plg | ||
$ plugin install http://[your ip address]:8080/gow.plg | ||
``` | ||
|
||
## How to add a new package | ||
|
||
1. Create a new directory under `packages/`, let's say `packages/new-pkg`. | ||
2. In `packages/new-pkg`, add a file called `root/install/slack-desc`. It's easiest to copy an existing one and modify it. | ||
3. Build any directory structure you like under `root/`. Any files you add will be automatically installed in their corresponding places under `/` when the plugin is installed or reloaded after reboot. | ||
4. If your new package needs to perform any actions on start or stop, add a shell script in `root/boot/config/plugins/gow/scripts/start/new-pkg.sh` or `root/boot/config/plugins/gow/scripts/stop/new-pkg.sh`. `start` corresponds to when the plugin is installed or reloaded after reboot, while `stop` is when the plugin is uninstalled. | ||
|
||
## How to build a package | ||
|
||
Packages are built using the [`utils/fmakepkg.sh`](utils/fmakepkg.sh) script. For the purposes of these steps, we'll assume the name of the package you're building is `your-pkg`. | ||
|
||
1. Make a directory at the top level called `package-dist` to hold packages while you're working on them. | ||
2. `cd` to `packages/your-pkg/root`. | ||
3. Run `../../../utils/fmakepkg.sh ../../../package-dist/your-pkg.txz`. | ||
4. `cd` to `../../../package-dist`. | ||
5. Generate `your-pkg.txz.md5` and `your-pkg.txz.sha256`. | ||
6. Uninstall and reinstall the plugin as above to pick up the new package. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
source vars.sh | ||
|
||
# What kind of GPUs do we have? | ||
has_nvidia=false | ||
has_non_nvidia=false | ||
|
||
if command -v lshw >/dev/null 2>&1; then | ||
while read line; do | ||
if [[ ${line,,} =~ nvidia ]]; then | ||
has_nvidia=true | ||
else | ||
has_non_nvidia=true | ||
fi | ||
done < <(lshw -C display 2>/dev/null | grep vendor) | ||
fi | ||
|
||
if [[ "$has_nvidia" = "true" && ! -f /boot/config/plugins/nvidia-driver.plg ]]; then | ||
if [ "$has_non_nvidia" = "true" ]; then | ||
# This user has both NVIDIA and non-NVIDIA cards, so don't prevent | ||
# installation, but provide a warning. | ||
echo "╔══════════╗" | ||
echo "║ WARNING! ║" | ||
echo "╚══════════╝" | ||
echo "Using Games on Whales with an NVIDIA GPU requires the Nvidia-Driver plugin, but you don't have it installed. If you want to use your NVIDIA GPU, please install Nvidia-Driver from Community Applications." | ||
else | ||
# This user only has NVIDIA GPUs, so it's an error to install GoW without the Nvidia-Driver plugin. | ||
echo "╔════════╗" | ||
echo "║ ERROR! ║" | ||
echo "╚════════╝" | ||
echo "Games on Whales requires the Nvidia-Driver plugin. Please install it from Community Applications and try again." | ||
exit 1 | ||
fi | ||
fi |
Oops, something went wrong.