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 0000000..c5c1244 Binary files /dev/null and b/custom_boxart.hmod/gamecodes.txt differ 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/"