From 62f3cde1305f9f5a556fbde3a825aeb260dcc030 Mon Sep 17 00:00:00 2001 From: Daniel Radtke Date: Fri, 20 Oct 2017 20:24:09 -0500 Subject: [PATCH] :confetti_ball: Initial commit --- custom_boxart.hmod/S51customboxart | 17 +++++++++++++++++ custom_boxart.hmod/gamecodes.txt | Bin 0 -> 702 bytes custom_boxart.hmod/install | 5 +++++ custom_boxart.hmod/readme.txt | 12 ++++++++++++ custom_boxart.hmod/uninstall | 3 +++ 5 files changed, 37 insertions(+) create mode 100644 custom_boxart.hmod/S51customboxart create mode 100644 custom_boxart.hmod/gamecodes.txt create mode 100644 custom_boxart.hmod/install create mode 100644 custom_boxart.hmod/readme.txt create mode 100644 custom_boxart.hmod/uninstall diff --git a/custom_boxart.hmod/S51customboxart b/custom_boxart.hmod/S51customboxart new file mode 100644 index 0000000..f699271 --- /dev/null +++ b/custom_boxart.hmod/S51customboxart @@ -0,0 +1,17 @@ +#!/bin/sh + +# Init scripts are executed with "start" argument when system boots and with "stop" argument during shutdown +# So we need to check that it's boot state, not shutdown +[ -z "$1" ] || [ "$1" == "start" ] || exit 0 + +source "/etc/preinit" +script_init + +ls -l "$squashfs$gamepath" | grep 'CLV-' | awk '{ print $9 }' | while read gamecode; do + if [ -f "$installpath/boxart/$gamecode.png" ]; then + mount -o bind "$installpath/boxart/$gamecode.png" "$squashfs$gamepath/${gamecode}/${gamecode}.png" + fi + if [ -f "$installpath/boxart/${gamecode}_small.png" ]; then + mount -o bind "$installpath/boxart/${gamecode}_small.png" "$squashfs$gamepath/${gamecode}/${gamecode}_small.png" + fi +done < /dev/stdin diff --git a/custom_boxart.hmod/gamecodes.txt b/custom_boxart.hmod/gamecodes.txt new file mode 100644 index 0000000000000000000000000000000000000000..c5c1244957ff80ea48d94778775e39953cebe109 GIT binary patch literal 702 zcmV;v0zv&BiwFR@r0Q7!1MQblYuhjo$MbCHcer_hK5U6CCyv>=JhWX0gFO^l24jq( z*m5jlTb?8*DP6z&PIj_(C0$ln+ClYuiG9-DNsj-zGcT2y>lCwuOXyWNi?=Ub zMRn%2nJ|iEx|Ssn=cymbvqCbO6s)h8dUrXt>3e5bIvoa0CipG3}SpsG*dt!6?wuWPz~OkN-yUVFQc+B&QC!L&?Z|Oyl-NhENM|;=9K5Gqyq7qGhCjLbkUL=#B?TXLl_k!~ zqGa$6yoAj?r4wG>X|L*%@B9m3Tm2`4;jR8ZH1*$)0;~VWU`zimi$6E@INp=@b@WfY kH;ct$u~;k?i^XEGSS%Kc#bU8oESBfUPbf8>=>RAI0Ma{G&;S4c literal 0 HcmV?d00001 diff --git a/custom_boxart.hmod/install b/custom_boxart.hmod/install new file mode 100644 index 0000000..339890e --- /dev/null +++ b/custom_boxart.hmod/install @@ -0,0 +1,5 @@ +local script="S51customboxart" +copy "$script" "$rootfs/etc/init.d/" +chmod +x "$rootfs/etc/init.d/$script" +mkdir -p "$installpath/boxart/" +return 1 diff --git a/custom_boxart.hmod/readme.txt b/custom_boxart.hmod/readme.txt new file mode 100644 index 0000000..b311662 --- /dev/null +++ b/custom_boxart.hmod/readme.txt @@ -0,0 +1,12 @@ +=== Custom Boxart === + +This module creates a folder at /var/lib/hakchi/boxart + +You can upload custom boxart png images over FTP to this folder. + +Example filenames: + +CLV-P-SAABE.png +CLV-P-SAABE_small.png + +If any of the two files exist for the respective game code, it will be used instead of the stock. \ No newline at end of file diff --git a/custom_boxart.hmod/uninstall b/custom_boxart.hmod/uninstall new file mode 100644 index 0000000..b991f4e --- /dev/null +++ b/custom_boxart.hmod/uninstall @@ -0,0 +1,3 @@ +local script="S51customboxart" +rm "$rootfs/etc/init.d/$script" +rm -r "$installpath/boxart/"