Skip to content

Commit

Permalink
Add transferring message
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTheMan827 committed Jan 14, 2018
1 parent 7c01877 commit 4ad041b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.png -text
readme.txt text=auto eol=crlf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
out/
bin/
mod/usr/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "decodepng"]
path = decodepng
url = https://github.com/DanTheMan827/decodepng.git
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet

all: out/$(MOD_NAME)-$(GIT_COMMIT).hmod

out/$(MOD_NAME)-$(GIT_COMMIT).hmod:
mkdir -p out/
cd mod/; tar -czvf "../$@" *
out/$(MOD_NAME)-$(GIT_COMMIT).hmod: mod/usr/share/$(MOD_NAME)/transferring.xz
mkdir -p "out/"
cd "mod/"; tar -czvf "../$@" *
touch "$@"

mod/usr/share/$(MOD_NAME)/transferring.xz: bin/decodepng
mkdir -p "mod/usr/share/$(MOD_NAME)"
"./$<" "images/transferring.png" | xz -cze9 > "$@"

bin/decodepng:
mkdir -p "bin"
gcc -o "$@" decodepng/*.c '-DBUILD_DATE=""' '-DBUILD_COMMIT=""'
chmod +x "$@"

clean:
-rm -rf out/
-rm -rf "out/" "bin/" "mod/usr/"

.PHONY: clean

1 change: 1 addition & 0 deletions decodepng
Submodule decodepng added at ac7f36
Binary file added images/transferring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mod/etc/preinit.d/b7079_external_libretro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ externalizeLibretro(){

if [ ! -d "$externalPath" ]; then
echo "externalizeLibretro: external path not found, copying..."
xz -dc "$rootfs/usr/share/external_retroarch/transferring.xz" > /dev/fb0
mkdir -p "$externalPath" || return 4
copy "$localPath/" "$externalPath/" || return 5
rm -rf "$localPath" && mkdir "$localPath"
Expand Down
1 change: 1 addition & 0 deletions mod/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mountpoint -q "$localPath" && umount "$localPath"
mountpoint -q "${localPath#rootfs}" && umount "${localPath#$rootfs}"

if [ -d "$externalPath" ] && [ "$freeSpace" -gt "$(du "$externalPath" | tail -n 1 | awk '{ print $1 }')" ]; then
xz -dc "$rootfs/usr/share/external_retroarch/transferring.xz" > /dev/fb0
echo "Moving $externalPath to $localPath"
copy "$externalPath/" "$localPath" && rm -rf "$externalPath"
fi
Expand Down

0 comments on commit 4ad041b

Please sign in to comment.