finalize/finalize_helper.gm9

97 lines
3.4 KiB
Plaintext
Raw Normal View History

2024-02-16 13:24:55 +00:00
# Scriptrunner for https://3ds.hacks.guide/finalizing-setup file copying operations
2024-09-20 07:10:19 +00:00
# Ver. 1.9.0 - Last modified: 2024-04-07
2024-02-16 13:24:55 +00:00
set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files..."
set WRITE 0:/WRITE
rm -o -s $[WRITE]
2024-02-16 13:24:55 +00:00
if fdummy $[WRITE] 400
rm -o -s $[WRITE]
2024-02-16 13:24:55 +00:00
else
set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
echo "Error #24: SD is write-protected\n \nYour SD card is set to read-only.\nEnsure that the lock switch is flipped\nin the upright position.\nOtherwise, your SD card may be failing.\n \nIf this error persists, ask for help\non Discord: https://discord.gg/MWxPgEp"
poweroff
end
if find -f "0:/finalize (*).romfs" ROMFS
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
if find -f "0:/3ds/finalize (*).romfs" ROMFS
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
if find -f "0:/luma/payloads/finalize (*).romfs" ROMFS
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
if find -f "0:/luma/finalize (*).romfs" ROMFS
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
if find -f "0:/DCIM/finalize (*).romfs" ROMFS
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
if find -f "0:/Nintendo 3DS/finalize (*).romfs" ROMFS
echo "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit <A> on the next few prompts."
cp -w -o -s $[ROMFS] 0:/finalize.romfs
rm -o -s $[ROMFS]
end
2024-02-16 13:24:55 +00:00
if find 0:/3ds/finalize.romfs NULL
cp -w -o -s 0:/3ds/finalize.romfs 0:/finalize.romfs
rm -o -s 0:/3ds/finalize.romfs
end
if find 0:/luma/payloads/finalize.romfs NULL
cp -w -o -s 0:/luma/payloads/finalize.romfs 0:/finalize.romfs
rm -o -s 0:/luma/payloads/finalize.romfs
end
if find 0:/luma/finalize.romfs NULL
cp -w -o -s 0:/luma/finalize.romfs 0:/finalize.romfs
rm -o -s 0:/luma/finalize.romfs
end
if find 0:/DCIM/finalize.romfs NULL
cp -w -o -s 0:/DCIM/finalize.romfs 0:/finalize.romfs
rm -o -s 0:/DCIM/finalize.romfs
end
if find "0:/Nintendo 3DS/finalize.romfs" NULL
echo "Information #23: finalize.romfs in wrong location\n \nfinalize.romfs is in the wrong location.\nThis script will attempt to move it.\nPlease hit <A> on the next few prompts."
cp -w -o -s "0:/Nintendo 3DS/finalize.romfs" 0:/finalize.romfs
rm -o -s "0:/Nintendo 3DS/finalize.romfs"
end
if not find 0:/finalize.romfs NULL
set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
echo "Error #21: finalize.romfs not found\n \nfinalize.romfs could not be found on the SD card.\nCopy it to root of SD and try again."
poweroff
end
if not sha 0:/finalize.romfs FINALIZE_SHA256SUM
2024-02-16 13:24:55 +00:00
set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
echo "Error #22: finalize.romfs is invalid\n \nThe file finalize.romfs is corrupt or unreadable.\nRe-download it, copy it to root of SD, and try again.\n \nExpected: FINALIZE_SHA256SUM"
2024-02-16 13:24:55 +00:00
poweroff
else
imgmount 0:/finalize.romfs
cp -w -o -s G:/finalize/GodMode9.firm 0:/luma/payloads/GodMode9.firm
2024-02-16 13:24:55 +00:00
if not find 0:/gm9/scripts NULL
mkdir 0:/gm9/scripts
end
cp -w -o -s G:/finalize/finalize.gm9 0:/gm9/scripts/finalize.gm9
imgumount
2024-02-16 13:24:55 +00:00
end
if not boot 0:/luma/payloads/GodMode9.firm
echo "Error #25: Could not boot GodMode9\n \nThis normally happens due to insufficient SD space.\nPlease make at least 20MB of free space."
poweroff
end