Skip to content

Commit

Permalink
feat: #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Skekfly committed Apr 11, 2023
1 parent bd1fbd0 commit d7b1c92
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# garlicos-updater

this project is used for updating Anbernic [RG35XX](https://anbernic.com/fr/products/rg35xx) powered by [GarlicOS](https://www.patreon.com/posts/76561333) with the latest version.
this project is used for updating Anbernic [RG35XX](https://anbernic.com/fr/products/rg35xx) powered
by [GarlicOS](https://www.patreon.com/posts/76561333) with the latest version.
It also copies the `saves` dir on your computer.
Int and Ext SD card are considered.

**=> There is no warranty of operation without errors. At your own risks. <=**

## Prerequisite

1. Enable adb on your device by creating a file named `enableADB` on the misc mount point
2. edit `garlicos-updater.cfg`
2. edit `garlicos-updater.cfg`

| Variable | Optional | Description |
|--------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| garlicOsDownloadPath_001 | | latest download link ([here](https://www.patreon.com/posts/76561333), named `RG35XX-CopyPasteOnTopOfStock.7z.001`) |
| garlicOsDownloadPath_002 | | latest download link ([here](https://www.patreon.com/posts/76561333), named `RG35XX-CopyPasteOnTopOfStock.7z.002`) |
| adbDeviceId | | adb device id (`adb devices`) |
| saveDir | x | local dir where to save `saves` (example : `/home/Skekfly/saves`). It copies `saves` only if `saveDir` is set. (From Ext SD card if there is one, Int SD card otherwise) |
| saveDir | x | local dir where to save `saves` (example : `/home/Skekfly/saves`). It copies `saves` only if `saveDir` is set (From Ext SD card if there is one, Int SD card otherwise). |
| resetCfg | x | `true` or `false` (default = false). Replace `retroarch.cfg` and the current theme by those in the update archive. |

## How to

1. power on your device
2. Set the latest download links (001 & 002) in `garlicos-updater.cfg`
3. connect your device on the computer via USB
Expand Down
30 changes: 25 additions & 5 deletions garlicos-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,34 @@ wget -O garlicOS.7z.002 "$garlicOsDownloadPath_002" || exit

echo "# Updating misc"
adb shell mount -o rw,remount /misc
if [ ! "$resetCfg" = true ]; then
adb -s "$adbDeviceId" shell cp -v /misc/boot_logo.bmp.gz /misc/current_boot_logo.bmp.gz || exit
fi
adb -s "$adbDeviceId" push --sync misc/* /misc/ || exit
if [ ! "$resetCfg" = true ]; then
adb -s "$adbDeviceId" shell rm -r /misc/boot_logo.bmp.gz.new || exit
adb -s "$adbDeviceId" shell mv /misc/boot_logo.bmp.gz /misc/boot_logo.bmp.gz.new || exit
adb -s "$adbDeviceId" shell mv /misc/current_boot_logo.bmp.gz /misc/boot_logo.bmp.gz || exit
fi

echo "# Updating cfw"
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg || exit
if [ ! "$resetCfg" = true ]; then
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg || exit
adb -s "$adbDeviceId" shell cp -rv /mnt/mmc/CFW/retroarch/.retroarch/assets /mnt/mmc/CFW/retroarch/.retroarch/current_assets || exit
adb -s "$adbDeviceId" shell cp -rv /mnt/mmc/CFW/skin /mnt/mmc/CFW/current_skin || exit
fi
adb -s "$adbDeviceId" push --sync roms/CFW /mnt/mmc/ || exit
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg || exit
if [ ! "$resetCfg" = true ]; then
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg || exit
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/retroarch/.retroarch/assets.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/assets /mnt/mmc/CFW/retroarch/.retroarch/assets.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_assets /mnt/mmc/CFW/retroarch/.retroarch/assets || exit
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/skin.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/skin /mnt/mmc/CFW/skin.new || exit
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/current_skin /mnt/mmc/CFW/skin || exit
fi

echo "# Updating roms"
adb -s "$adbDeviceId" push --sync roms/Roms/* /mnt/mmc/ || exit
Expand All @@ -47,5 +68,4 @@ fi

echo "# End"


adb reboot
adb -s "$adbDeviceId" reboot

0 comments on commit d7b1c92

Please sign in to comment.