Installing pmOS on the Samsung A52 4G

Unlocking the bootloader

Set up the Android phone. Connect to Wi-Fi and navigate to the phone it’s settings. All the way at the bottom press on About Phone. Click on Software Information and click 7 times on Build number until the phone states: Developer mode has been enabled.

Press back twice and scroll down to Developer Options. Enable OEM unlocking and USB debugging. If OEM unlokcing is not there, reboot the phone and try again.

Compile Heimdall

I needed a newer version of Heimdall which I couldn’t find without compiling it myself. To do this you can clone Heimdall from: https://git.sr.ht/~grimler/heimdall.

git clone https://git.sr.ht/~grimler/Heimdall
cd Heimdall
mkdir build && cd build
cmake -DDISABLE_FRONTEND=ON ..
make -j$(nproc)
sudo make install

You can copy heimdall to your PATH (e.g. cp bin/heimdall ~/.local/bin/). Running heimdall version should say v2.2.2 (or higher).

postmarketOS (pmbootstrap)

installing pmbootstrap

Follow the steps on the pmOS wiki

bootstrapping

Run pmbootstrap init for a random device (samsung a5) and set it up. after that I followed newbytes instructions:

cd $(pmbootstrap config aports)
git fetch origin
git switch newbyte/a52-v25.12

Run pmbootstrap init again. Now you are able to select a52q. Pick the following options:

Channel [v25.12]: v25.12
Vendor [samsung]: samsung
Device codename [a5]: a52q
Username [user]: user
Provider [default]: default
User interface [none]: none
Change them? (y/n) [n]: n
Extra packages [openssh]: openssh
Use this timezone instead of GMT? (y/n) [y]: y
Locale [en_US]: en_US

installing pmOS

After this boot your device into Download Mode. You can get in Download Mode by fully powering off the device. Then, while holding Volume Up & Volume Down plug in a USB-C cable that is connected to your computer until you see a ‘Download’ screen. Release the buttons and press Volume Up to get in Download Mode. You will need to do this a few times :)

When in Download Mode, run pmbootstrap install and follow the steps. Then, flash the kernel by running pmbootstrap flasher --no-reboot flash_kernel.

If you get an error that zstd is not found. Install it manually by running pmbootstrap chroot -- apk add zstd and try again to flash the kernel.

Turn the phone off again, enter Download Mode again and flash the rootfs pmbootstrap flasher --no-reboot flash_rootfs.

Turn the phone off again, enter Download Mode again and flash the DTBO which you can get from here https://github.com/map220v/postmarket_samsung_a72q/releases/tag/dtbo. You flash this with the compiled heimdall by running heimdall flash --DTBO emptyDTBO.img

When you reboot the phone now you should see the pmOS splash screen followed by tty

SSH to device

After you boot to a TTY you can ssh into the phone after you give the phone an ip address. Find the phone with the command

ip a

Usually the phone has a random string like this enx9ad89e8d8f22. This is a USB network interface. Give this interface a ip address

sudo dclient enx9ad89e8d8f22

Now you can SSH into the phone with the username and password set during pmbootstrap install.

ssh user@172.16.42.1

Share internet connection

To share your internet connection to the phone run the following commands on your machine:

sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o <your-internet-interface> -j MASQUERADE

You can find your internet interface with ip a. On the phone run the following commands:

sudo ip route add default via 172.16.42.2
echo "nameserver 9.9.9.9" | sudo tee /etc/resolv.conf

and you should share a connection now.

Testing functionality

evtest

Install evtest with apk add evtest

Run evtest /dev/input/event0 and press the power button to get a response.

Event: time 151283560.995643, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 151283560.995643, -------------- SYN_REPORT ------------
Event: time 151283561.130515, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 151283561.130515, -------------- SYN_REPORT ------------

All hardware buttons and the touchscreen are working.

  • KEY_POWER is mapped to /dev/input/event0
  • KEY_VOLUMEUP is mapped to /dev/input/event3
  • KEY_VOLUMEDOWN is mapped to /dev/input/event1
  • ABS_X, ABS_Y (touchscreen) etc. is mapped to /dev/input/event2

Install libpd

Make sure the date of the phone is set. Manually works for now by running date -s "2026-05-05 10:22:00". Change the date/time accordingly.

Add the testing repo to the bottom of the /etc/apk/repositories file

@edge https://dl-cdn.alpinelinux.org/alpine/edge/testing

Update apk and install libpd.

apk update
apk add libpd-dev@edge libpd@edge