forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
armbian-gaming
customize launcher for @NicoD-SBC (v2)
- add image suffix `-gaming`
- Loading branch information
1 parent
c44fbbf
commit 44e547d
Showing
1 changed file
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# Copyright (c) 2023 Ricardo Pardini <[email protected]> | ||
# This file is a part of the Armbian Build Framework https://github.com/armbian/build/ | ||
# | ||
|
||
# Creates a launcher script for NicoD's armbian-gaming project. | ||
# Script will clone (or pull if already cloned) from NicoD's repo and run his script. | ||
|
||
function extension_prepare_config__800_nicod_launcher() { | ||
EXTRA_IMAGE_SUFFIXES+=("-gaming") # global array; '800' hook is pretty much at the end | ||
return 0 | ||
} | ||
|
||
function pre_customize_image__add_nicod_launcher() { | ||
display_alert "Adding NicoD's armbian-gaming launcher" "${EXTENSION}" "info" | ||
|
||
local launcher_dir="${SDCARD}/usr/local/bin" | ||
local launcher_file="${launcher_dir}/nicod-armbian-gaming" | ||
run_host_command_logged mkdir -pv "${launcher_dir}" | ||
|
||
cat <<- 'NICOD_GAMING_LAUNCHER_SCRIPT' > "${launcher_file}" | ||
#!/usr/bin/env bash | ||
if [[ ! -d ~/armbian-gaming ]]; then | ||
git clone https://github.com/NicoD-SBC/armbian-gaming.git ~/armbian-gaming | ||
fi | ||
cd ~/armbian-gaming | ||
git pull || true | ||
bash armbian-gaming.sh "$@" | ||
NICOD_GAMING_LAUNCHER_SCRIPT | ||
|
||
run_host_command_logged chmod -v +x "${launcher_file}" | ||
display_alert "Added NicoD's armbian-gaming launcher" "${EXTENSION}" "info" | ||
} |