Skip to content

Latest commit

 

History

History
398 lines (263 loc) · 13.3 KB

installing-garlicos-single-card.en_us.md

File metadata and controls

398 lines (263 loc) · 13.3 KB

Installing Garlic OS on your Anbernic RG35XX using macOS (single-card setup)

Instructions for installing Garlic OS on your Anbernic RG35XX using macOS. Adapted and expanded from https://pastebin.com/YV1Va5JL, originally written by A GUEST on 2022-12-30. (I wish there were a better way to cite your work — I’m sorry!)

Each step is explained in English with the corresponding terminal command below it. These instructions should work without problem on any modern macOS — with either Intel or Apple Silicon CPUs. Tested on macOS Ventura 13.5 on both an Intel i9 chip, and an Apple M1 Max chip.

IMPORTANT: You will end up formatting the ROMS partition completely, so it is best to do this before you waste time copying any rom files over.

Prerequisites

  • A relatively recent version of macOS.

    Finder icon
  • Download balenaEtcher. The free version is totally fine.

    balenaEtcher icon
  • Comfortable-enough using Terminal.app (or alternatives).

    Terminal icon
  • An application which can open .7z archives. I can recommend:

  • You have Homebrew installed. (Installation is outside the scope of this tutorial, but it’s pretty fundamental if you do technical things on your Mac.)

    • This includes installing the Xcode CLI tools (a much smaller download than the entire Xcode).

Downloading Garlic OS

  1. Visit https://www.patreon.com/posts/76561333

  2. Read through the release notes so that you understand what you’re installing.

  3. Just above the comment section are the download links. Download both parts.

    • RG35XX-MicroSDCardImage.7z.001
    • RG35XX-MicroSDCardImage.7z.002
  4. Decompress the .7z files.

    1. macOS can open .7z files natively.

    2. Select both files.

    3. Right-click with a mouse; two-finger tap on a trackpad; or control-click with the keyboard — and then choose Open from the menu.

      (Or if you prefer the keyboard, type command-down (⌘ ↓) to open files.)

      Screenshot of opening the file with the context menu

  5. This will result in a new directory called RG35XX-MicroSDCardImage.7z/ with garlic.img inside.

Flashing the microSD card

IMPORTANT: If you have data you care about on the microSD card, back it up before flashing it with Garlic OS.

  1. Launch balenaEtcher.

    Screenshot of default screen

  2. Choose Flash from file, then find and select the garlic.img disk image we downloaded previously.

  3. Under Select target, choose the device which contains your microSD card. (Take note of the device ID under the Location header.)

    Screenshot of microSD selection

  4. Choose the Flash! button.

    Screenshot of the Flash! button

  5. Let the flashing process run until it completes.

    Screenshot of the flashing process

  6. Your microSD card volumes will be unmounted after the flashing. Pop your card out, then put it back in so that Finder mounts your new volumes on the desktop.

    If you don’t see the drives on the desktop, check your Finder settings (or Finder preferences in older macOS releases).

    1. Go to Finder (click on the background, click inside a Finder window, etc.).

    2. In the upper-left, find the Finder menu, and choose Settings… (or Preferences… in older macOS releases).

    3. Check to see that CDs, DVDs, and iPods is checked.

      Screenshot of Finder settings
  7. If the flashing process named both partitions No Name, then rename the larger partition (≈3.38 GB) as ROMS and the smaller partition (≈10.4 MB) as MISC. This can be done in Finder the same way as renaming any other file.

    Screenshot of renamed partitions
  8. Back up the BIOS/ and CFW/ folders from the ROMS partition. You will need to restore them after the partition resizing.

Running gdisk

  1. Install gdisk using Homebrew.

    brew install --cask gdisk
  2. Use diskutil (installed by default on macOS) to view the list of mounted drives and look for the microSD card path. I have several external hard drives, and mine was /dev/disk11 with 4 partitions.

    NOTE: If you paid attention to the Location column in balenaEtcher when you were selecting a disk target, this will be the same location.

    diskutil list
    /dev/disk11 (internal, physical):
    #:                       TYPE NAME                    SIZE       IDENTIFIER
    0:      GUID_partition_scheme                        *31.9 GB    disk11
    1:       Microsoft Basic Data MISC                    10.5 MB    disk11s1
    2:       Microsoft Basic Data                         536.9 MB   disk11s2
    3:       Microsoft Basic Data                         53.5 MB    disk11s3
    4:       Microsoft Basic Data ROMS                    3.4 GB     disk11s4
    
  3. Launch gdisk using sudo. You will likely need to enter your password to authenticate.

    NOTE: sudo grants administrative permissions to your user, as if to say "super user, do this." If you don’t use sudo it will launch, but it will fail on some of the later steps.

    sudo gdisk
  4. gdisk will ask for your device ID. We’ve already found this twice. 😉

    GPT fdisk (gdisk) version 1.0.9
    
    Type device filename, or press <Enter> to exit:
    

    My value was /dev/disk11. Yours may be different.

    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Partition table scan:
    MBR: protective
    BSD: not present
    APM: not present
    GPT: present
    
    Found valid GPT with protective MBR; using GPT.
    
    Command (? for help):
    
  5. Enter the print command to verify we have loaded the right disk.

    p
    
    Disk /dev/disk11: 62333952 sectors, 29.7 GiB
    Sector size (logical): 512 bytes
    Disk identifier (GUID): 8F10075C-0512-4DBA-944E-1ADF2C17F4C0
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 7812466
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 16350 sectors (8.0 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
    1           16384           36863   10.0 MiB    0700  MISC
    2           36864         1085439   512.0 MiB   0700  SYSTEM
    3         1085440         1189887   51.0 MiB    0700  CONFIG
    4         1189888         7812466   3.2 GiB     0700  ROMS
    
    Command (? for help):
    

    Your values may be different. The important bits are these 4 partitions, with these approximate sizes.

  6. We need a command that is only available in expert mode.

    x
    
    Expert command (? for help):
    
  7. Move backup data structures to end of disk.

    e
    
    Relocating backup data structures to the end of the disk
    
    Expert command (? for help):
    
  8. Exit expert mode and return to main menu.

    m
    
    Command (? for help):
    
  9. Delete the ROMS partition from the GPT table by entering delete mode.

    d
    
    Partition number (1-4):
    
  10. For me the ROMS partition was 4. Verify yours from the initial print command, but it should also be 4.

    4
    
    Command (? for help):
    
  11. Enter print command again to verify that we have deleted the correct partition.

    NOTE: Remember nothing takes affect until we save and quit, so if there is a mistake, just quit without saving (q) and start again.

    p
    
    Disk /dev/disk11: 62333952 sectors, 29.7 GiB
    Sector size (logical): 512 bytes
    Disk identifier (GUID): 8F10075C-0512-4DBA-944E-1ADF2C17F4C0
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 62333918
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 61160381 sectors (29.2 GiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
    1           16384           36863   10.0 MiB    0700  MISC
    2           36864         1085439   512.0 MiB   0700  SYSTEM
    3         1085440         1189887   51.0 MiB    0700  CONFIG
    
    Command (? for help):
    
  12. Enter create new partition mode.

    n
    
    Partition number (4-128, default 4):
    
  13. Choose 4.

    4
    
    First sector (34-62333918, default = 1189888) or {+-}size{KMGTP}:
    
  14. When it asks you the for first and last sector, press enter on both of these to use the default values.

    enter
    
    Last sector (1189888-62333918, default = 62332927) or {+-}size{KMGTP}:
    
    enter
    
    Current type is AF00 (Apple HFS/HFS+)
    Hex code or GUID (L to show codes, Enter = AF00):
    
  15. For the hex code, choose 0700 for Microsoft Basic Data (as the partition is FAT32).

    0700
    
    Changed type of partition to 'Microsoft basic data'
    
    Command (? for help):
    
  16. Enter print command again to verify that we have deleted the correct partition.

    NOTE: Remember nothing takes affect until we save and quit, so if there is a mistake, just quit without saving (q) and start again.

    p
    
    Disk /dev/disk11: 62333952 sectors, 29.7 GiB
    Sector size (logical): 512 bytes
    Disk identifier (GUID): 8F10075C-0512-4DBA-944E-1ADF2C17F4C0
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 62333918
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 17341 sectors (8.5 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
    1           16384           36863   10.0 MiB    0700  MISC
    2           36864         1085439   512.0 MiB   0700  SYSTEM
    3         1085440         1189887   51.0 MiB    0700  CONFIG
    4         1189888        62332927   29.2 GiB    0700  Microsoft basic data
    
  17. Enter write mode. This will perform the changes to your disk.

    IMPORTANT: This is your last chance to quit without breaking anything. Choose q if you have noticed a mistake during the print step.

    w
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N):
    

    …and confirm!

    Y
    
    OK; writing new GUID partition table (GPT) to /dev/disk11.
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Warning: The kernel may continue to use old or deleted partitions.
    You should reboot or remove the drive.
    The operation has completed successfully.
    
  18. Eject the mounted volumes. You can either:

    1. Select them and drag them to the trash can, or…

    2. Right-click with a mouse; two-finger tap on a trackpad; or control-click with the keyboard — and then choose Eject from the menu.

  19. Pop your card out, then put it back in so that Finder mounts your new volumes on the desktop.

    NOTE: The size of the ROMS volume will still be incorrect until the next step.

Cleaning up and restoring backups

  1. Open Disk Utility (installed by default on macOS), and find the ROMS partition.

    Screenshot of Disk Utility

  2. Erase the partition. For the name, keep ROMS. For the format, choose MS-DOS (FAT).

    Screenshot of Disk Utility’s erase dialog

  3. Wait for it to complete.

    Screenshot of Disk Utility’s completion dialog

  4. Finally re-copy the BIOS/ and CFW/ folders we backed-up earlier, and any ROM files and/or save files that you want to make available to your device.

    Screenshot of copy dialog

Congratulations!

You have installed Garlic OS to your Anbernic RG35XX!

Put the microSD card back into the top slot, and power-on the device.

For more fun, check out custom themes/skins, as well as creating a custom boot screen!