-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ff5a0a7
Showing
7 changed files
with
94 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,2 @@ | ||
* text=auto eol=lf | ||
|
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,4 @@ | ||
out/ | ||
mod/sfdisk | ||
util-linux-2.31.1/ | ||
util-linux-2.31.1.tar.xz |
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,54 @@ | ||
MOD_NAME := $(shell head -n 1 mod/readme.md | cut -c 3-) | ||
MOD_CREATOR := DanTheMan827 | ||
MOD_CATEGORY := SD | ||
GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`") | ||
GIT_TAG := $(shell git describe --tags) | ||
MOD_FILENAME := $(shell basename "`git config --get remote.origin.url`" .hmod.git) | ||
|
||
all: out/$(MOD_FILENAME)-$(GIT_COMMIT).hmod | ||
|
||
out/$(MOD_FILENAME)-$(GIT_COMMIT).hmod: mod/sfdisk | ||
mkdir -p out/ temp/ | ||
mkdir -p out/ temp/ | ||
rsync -a mod/ temp/ --links --delete | ||
|
||
printf "%s\n" \ | ||
"---" \ | ||
"Name: $(MOD_NAME)" \ | ||
"Creator: $(MOD_CREATOR)" \ | ||
"Category: $(MOD_CATEGORY)" \ | ||
"Version: $(GIT_TAG)" \ | ||
"Packed on: $(shell date)" \ | ||
"Git commit: $(GIT_COMMIT)" \ | ||
"---" > temp/readme.md | ||
|
||
sed 1d mod/readme.md >> temp/readme.md | ||
cd temp/; tar -czvf "../$@" * | ||
rm -r temp/ | ||
touch "$@" | ||
|
||
mod/sfdisk: util-linux-2.31.1/sfdisk.static | ||
cp "$<" "$@" | ||
chmod +x "$@" | ||
|
||
util-linux-2.31.1/sfdisk.static: util-linux-2.31.1/configure | ||
cd "util-linux-2.31.1/" && \ | ||
./configure --host=arm-linux-gnueabihf --enable-static-programs=sfdisk --without-tinfo --without-util --without-ncurses && \ | ||
make sfdisk.static && \ | ||
arm-linux-gnueabihf-strip sfdisk.static | ||
|
||
util-linux-2.31.1/configure: util-linux-2.31.1.tar.xz | ||
tar -xJvf "$<" | ||
touch "$@" | ||
|
||
util-linux-2.31.1.tar.xz: | ||
wget "https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.1.tar.xz" -O "$@" --no-use-server-timestamps | ||
|
||
|
||
clean: clean-hmod | ||
-rm -rf "util-linux-2.31.1.tar.xz" "util-linux-2.31.1/" | ||
|
||
clean-hmod: | ||
-rm -rf "out/" "mod/sfdisk" | ||
|
||
.PHONY: clean clean-hmod |
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,25 @@ | ||
[ ! -b "/dev/mmcblk0" ] && echo "No SD card found, did you install the SD uboot?" && (rm "$transferpath/sfdisk"; return 1) | ||
|
||
sdprep="$transferpath/sdprep" | ||
|
||
chmod +x "$transferpath/sfdisk" | ||
|
||
echo "Partitioning and formatting SD card" | ||
echo "" | ||
|
||
"$transferpath/sfdisk" "/dev/mmcblk0" <<EOT | ||
,,L | ||
EOT | ||
|
||
rm "$transferpath/sfdisk" | ||
|
||
yes | mke2fs -t ext4 -L data -b 4K -E stripe-width=32 -O ^huge_file,^metadata_csum /dev/mmcblk0p1 | ||
|
||
mkdir "$sdprep" | ||
mount "/dev/mmcblk0p1" "$sdprep" || (echo "Error mounting SD card" && return 1) | ||
|
||
mkdir -p "$sdprep/$modname/games" "$sdprep/$modname/saves" | ||
|
||
sync | ||
umount "$sdprep" && rmdir "$sdprep" | ||
|
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,5 @@ | ||
# Hakchi SD Prep | ||
|
||
This will **erase all data on the SD card** and format it with EXT4. | ||
|
||
It will also create the needed directories so that hakchi will store saves and games on the card. |
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,3 @@ | ||
return 0 | ||
no-uninstall | ||
|
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 @@ | ||
mod/readme.md |