Skip to content

Commit d7b1c92

Browse files
committed
feat: #11
1 parent bd1fbd0 commit d7b1c92

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# garlicos-updater
22

3-
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.
3+
this project is used for updating Anbernic [RG35XX](https://anbernic.com/fr/products/rg35xx) powered
4+
by [GarlicOS](https://www.patreon.com/posts/76561333) with the latest version.
45
It also copies the `saves` dir on your computer.
56
Int and Ext SD card are considered.
67

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

910
## Prerequisite
11+
1012
1. Enable adb on your device by creating a file named `enableADB` on the misc mount point
11-
2. edit `garlicos-updater.cfg`
13+
2. edit `garlicos-updater.cfg`
1214

1315
| Variable | Optional | Description |
1416
|--------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1517
| garlicOsDownloadPath_001 | | latest download link ([here](https://www.patreon.com/posts/76561333), named `RG35XX-CopyPasteOnTopOfStock.7z.001`) |
1618
| garlicOsDownloadPath_002 | | latest download link ([here](https://www.patreon.com/posts/76561333), named `RG35XX-CopyPasteOnTopOfStock.7z.002`) |
1719
| adbDeviceId | | adb device id (`adb devices`) |
18-
| 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) |
20+
| 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). |
21+
| resetCfg | x | `true` or `false` (default = false). Replace `retroarch.cfg` and the current theme by those in the update archive. |
1922

2023
## How to
24+
2125
1. power on your device
2226
2. Set the latest download links (001 & 002) in `garlicos-updater.cfg`
2327
3. connect your device on the computer via USB

garlicos-updater.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,34 @@ wget -O garlicOS.7z.002 "$garlicOsDownloadPath_002" || exit
1616

1717
echo "# Updating misc"
1818
adb shell mount -o rw,remount /misc
19+
if [ ! "$resetCfg" = true ]; then
20+
adb -s "$adbDeviceId" shell cp -v /misc/boot_logo.bmp.gz /misc/current_boot_logo.bmp.gz || exit
21+
fi
1922
adb -s "$adbDeviceId" push --sync misc/* /misc/ || exit
23+
if [ ! "$resetCfg" = true ]; then
24+
adb -s "$adbDeviceId" shell rm -r /misc/boot_logo.bmp.gz.new || exit
25+
adb -s "$adbDeviceId" shell mv /misc/boot_logo.bmp.gz /misc/boot_logo.bmp.gz.new || exit
26+
adb -s "$adbDeviceId" shell mv /misc/current_boot_logo.bmp.gz /misc/boot_logo.bmp.gz || exit
27+
fi
2028

2129
echo "# Updating cfw"
22-
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg || exit
30+
if [ ! "$resetCfg" = true ]; then
31+
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg || exit
32+
adb -s "$adbDeviceId" shell cp -rv /mnt/mmc/CFW/retroarch/.retroarch/assets /mnt/mmc/CFW/retroarch/.retroarch/current_assets || exit
33+
adb -s "$adbDeviceId" shell cp -rv /mnt/mmc/CFW/skin /mnt/mmc/CFW/current_skin || exit
34+
fi
2335
adb -s "$adbDeviceId" push --sync roms/CFW /mnt/mmc/ || exit
24-
adb -s "$adbDeviceId" shell cp -v /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
25-
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg || exit
36+
if [ ! "$resetCfg" = true ]; then
37+
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
38+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg.new || exit
39+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_retroarch.cfg /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg || exit
40+
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/retroarch/.retroarch/assets.new || exit
41+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/assets /mnt/mmc/CFW/retroarch/.retroarch/assets.new || exit
42+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/retroarch/.retroarch/current_assets /mnt/mmc/CFW/retroarch/.retroarch/assets || exit
43+
adb -s "$adbDeviceId" shell rm -r /mnt/mmc/CFW/skin.new || exit
44+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/skin /mnt/mmc/CFW/skin.new || exit
45+
adb -s "$adbDeviceId" shell mv /mnt/mmc/CFW/current_skin /mnt/mmc/CFW/skin || exit
46+
fi
2647

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

4869
echo "# End"
4970

50-
51-
adb reboot
71+
adb -s "$adbDeviceId" reboot

0 commit comments

Comments
 (0)