Lakka in OrangePi Zero ( H3 )

Hello,

I have orange pi zero plus2 H3 version. I think, any H3 build might work but, dont support for wifi/bt… There are any plans to add pi zero h3 version to lakka?

Thank you.

1 Like

I managed to duct-tape and bubblegum my way into getting the onboard wifi working on the zero+2. It’s not pretty, but it works. I haven’t tried bluetooth because I don’t have any controllers that use it. Most of the other h3/orangepi images will boot and play just fine, but some don’t expose the on-board emmc, and the ones that do don’t seem to like usb, and none of them use the same wifi chip. They all look like they have the right drivers, just not the firmware or nvram settings, and the script.bin doesn’t expose it as a device either.

I can post instructions for linux, but I’m not sure how you’d go about this in windows. The armbian image uses ext4 partitions (windows doesn’t much care for those), and I had to re-pack the lakka ‘SYSTEM’ image (it’s squashfs. windows doesn’t like those either). This is completely unofficial, and all credit goes to the original developers and maintainers.

Since the armbian image works out of the box, I ended up taking a few pieces from it. https://www.armbian.com/orange-pi-plus-2/ extract that, and mount it as a loopback device

$ sudo losetup --find --show --partscan Armbian_5.30_Orangepizeroplus2-h3_Ubuntu_xenial_default_3.4.113.img /dev/loop0

Make note of which loop device it uses. It may not be the same as mine.

$ sudo mkdir /mnt/image $ sudo mount /dev/loop0p1 /mnt/image

I started with the OrangePiLite Lakka image (others will probably work too, I just happened to also have this board) and wrote it to a new SD card, then mounted it. My laptop has a built-in SD card reader, so I use mmcblk0. yours might be different, especially if you use a usb reader. Those typically show up as something like /dev/sdb. If you’re unsure, check 'dmesg | tail ’ after plugging it in.

$ gunzip Lakka-H3.opilite.arm-2.1-rc2.img.gz $ sudo dd if=Lakka-H3.opilite.arm-2.1-rc2.img of=/dev/mmcblk0 $ sudo mkdir /mnt/sdcard $ sudo mount /dev/mmcblk0p1 /mnt/sdcard

I replaced script.bin with the one from the armbian image

$ sudo cp /mnt/image/boot/bin/orangepizeroplus2-h3.bin /mnt/sdcard/script.bin

Then extracted the ‘SYSTEM’ image to a temporary directory

$ mkdir /tmp/lakka_system $ cd /tmp/lakka_system $ sudo unsquashfs /mnt/sdcard/SYSTEM

replaced the ‘brcm’ firmware directory with the ‘ap6212’ directory from armbian

$ cd squashfs-root/usr/lib/firmware/ $ sudo mv brcm brcm.old $ sudo cp -a /mnt/image/lib/firmware/ap2612 ./brcm $ sudo mv brcm/nvram.txt brcm/nvram_ap2612.txt

then repack and copy ‘SYSTEM’ back to the sd card.

$ cd /tmp/lakka_system/squashfs-root/ $ sudo mksquashfs ./ …/SYSTEM $ sudo cp /tmp/lakka_system/SYSTEM /mnt/sdcard/

That should be it. unmount the sdcard, and make sure it’s done writing before removing it from the computer

$ sudo umount /mnt/sdcard $ sync

It should be ready to boot on the zero+2 now. You’ll probably want to clean up the loopback and temp/mount directories too.

$ sudo umount /mnt/image $ sudo losetup -d /dev/loop0 $ sudo rm -Rf /mnt/sdcard /mnt/image /tmp/lakka_system

Of course, this will all break if you update, and there’s no guarantee these steps will work on newer versions. The “Correct” way to do this would probably be to build from source, but it takes ages to compile, ~10G of disk space, and I had some issues along the way I didn’t feel like fighting with right now (though I’ll probably revisit).

2 Likes

Was wondering if you can make a .IMG file with these changes all I can do is load from a external HD with my Lakka saves and stuff and ROMs on it. It won’t connect to wifi. I’m not very savvy with Linux code I always seem to botch something lol

Very useful instruction.

Just one question. After i can boot this modified sd on opi zero+2 h3, can i dump this sdcard to img file to share and mount it to another sdcard after?