How to install Garlic 2.0 on Retroid Pocket 2 Plus?

After writing how to install Garlic 2.0 on RG35XX Plus, I think it is high time for a tutorial on how to install Garlic 2.0 on Retroid Pocket 2 Plus. It brings the Linux experience to the Android-based Retroid Pocket 2 Plus, and disable touchscreen that often cause ghost touching on the handheld (and sadly Retroid won’t warrant this issue).

Before you start, I must warn you that by installing Garlic 2.0, you will void the warranty of the Retroid Pocket 2 Plus. Even though I don’t have faith in the warranty policies, Garlic 2.0 is still a premature Linux system in alpha state, and it hasn’t unlocked full potential of the Retroid Pocket 2 Plus yet. Unless you don’t care about the warranty, or you face the ghost touching issue, I think it is safe to stay with Android on the Retroid Pocket 2 Plus.

Again, we should say thanks to Black-Seraph for his amazing Garlic works, together with Turtle for his countless efforts on the Retroid Pocket 2 Plus. Linux system is still the preference of many people, and what if the Retroid handheld can have dual boot in one day, it would be the best for both parties.

What you need

How to install Garlic OS 2.0 on Retroid Pocket 2 Plus?

I must ask you again to check whether your Retroid Pocket 2 Plus is running Android 11 or not, because it is the first requirement to install Garlic OS 2.0 on Retroid Pocket 2 Plus. Users who are using LineageOS 19.1 made by Turtle can also try installing Garlic 2.0 using my guide. For anyone who don’t know which Android their handheld is running, they can check in Settings > About device.

One thing you should remember, you must keep the microSD card in exFAT format. You will need a microSD card to install Garlic OS 2.0 on Retroid Pocket 2 Plus, so I recommend to read my handheld SD card guide, to know which SD card you should choose (quite a long guide).

Step 1: Preparing the bootloader

  • Use 7zip to extract the bootloader microsd_bootloader_install_pocket2plus_stock11.zip that you previously downloaded in prerequisites
  • Plug your RP2+ to a PC (the stock cable is fine), select File Transfer when prompting
  • Copy everything you extracted previously (boot.img, flash_microsd_bootloader.sh, restore_stock_bootloader.sh, and vbmeta.img) to the Internal shared storage. You must not copy them at the root of the Internal shared storage, not in any sub-folder
  • Back to the RP2+, open Settings > Handheld Settings > Advanced > Run script as Root. Choose Select a Script. Select flash_microsd_bootloader.sh, click Run
  • Wait for the process to finish. The process has finished when you see the message Run Script Completed on your Retroid Pocket 2 Plus.

Step 2: Preparing the bootable SD card

Again, make sure that your microSD card is in exFAT format. If not, you can easily insert the SD card into a PC, right click on the drive and quick format to exFAT.

  • Make a boot folder at the root of the SD card
  • Make a init.sh script file with Notepad, copy these lines into this file
#!/system/bin/sh

# Mount the rootfs loopback file
mount -t f2fs -o loop /boot/boot/rootfs.f2fs /root

# Bind mount the exfat partition
mount -o bind /boot /root/media

# Iterate the required folders
for f in dev dev/pts proc sys tmp firmware vendor/firmware lib/firmware lib/modules device-resources $DEVICE_CUSTOM_ROOTFS_MOUNTS
do
	# Create a mount point
	mkdir -p /root/$f

	# And bind mount the folder to it
	mount -o bind /$f /root/$f
done

# Setup the shell environment
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root
export SHELL=/bin/sh

# Set the CPU governors to performance
# This is needed for devices with buggy governors (most T310/T618/H700 devices)
# It's currently enabled for all devices to make debugging easier
for policy_dir in /sys/devices/system/cpu/cpufreq/policy*
do
	if [ -d "$policy_dir" ]
	then
		echo performance > "$policy_dir/scaling_governor"
	fi
done

# And hand off control to the rootfs
chroot /root /usr/bin/init
  • Save init.sh in boot folder
  • Extract the rootfs file that you previously downloaded in prerequisites in the boot folder

Step 3: Finalizing the setup

  • Turn off the Retroid Pocket 2 Plus, unplug any cable from the handheld. Put back the bootable SD card into your handheld
  • Hold down both VOLUME UP and POWER buttons of the handheld at the same time until you see the Retroid logo is visible on screen, you can release the button combination. The handheld should not vibrate if done correctly
  • Wait for the process to finish

You’ve finished installing Garlic OS 2.0 on your Retroid Pocket 2 Plus.