Skip to content

Instantly share code, notes, and snippets.

@GusAntoniassi
Last active July 3, 2024 09:52
Show Gist options
  • Save GusAntoniassi/6d2c3fbc3f9169832025847d6951af2d to your computer and use it in GitHub Desktop.
Save GusAntoniassi/6d2c3fbc3f9169832025847d6951af2d to your computer and use it in GitHub Desktop.
Moto G6 PostmarketOS initial configuration

How to configure Moto G6 with PostmarketOS

Flashing instructions

Install pmbootstrap

Follow the official docs to install pmbootstrap in the host machine.

Run pmbootstrap init, and use the following configuration:

  • Channel: edge
  • Vendor: motorola
  • Device codename: ali
  • Username:
  • Provider: default
  • User interface: none (as of now the display driver for Moto G6 is glitched so there is no visual interface available)
  • Additional options (default values): extra free space: 0 MB, boot partition size: 256 MB, parallel jobs: 9, ccache per arch: 5G, sudo timer: False, mirror: http://mirror.postmarketos.org/postmarketos/
  • Extra packages: vim,wget,wpa_supplicant
  • Use this timezone: y
  • Locale: en_US
  • Device hostname:
  • Build outdated packages: y
  • Zap chroots: y

Flash lk2nd

lk2nd is a bootloader for Qualcomm MSM devices, necessary to run PostmarketOS in this device. Clone the lk2nd fork for Moto G6 and compile it with these instructions:

cd lk2nd
make TOOLCHAIN_PREFIX=arm-none-eabi- msm8953-secondary

Reboot your device into Fastboot mode (press Volume Down while booting), and then test the lk2nd with the command:

fastboot boot ./build-msm8953-secondary/lk2nd.img

If everything works well, you can now flash lk2nd. Reboot the device into Fastboot again and then run:

fastboot flash boot ./build-msm8953-secondary/lk2nd.img

Flash PostmarketOS

Reboot the device into Fastboot if it is not already, then run:

pmbootstrap flasher flash_rootfs
pmbootstrap flasher boot

Reboot the device, and you should have PostmarketOS installed!

First time install

Connect the phone to the host machine via USB to SSH into it. It should be available automatically at 172.16.42.1.

ssh user@172.16.42.1

Routing internet

The device likely won't have Wi-Fi configured for the first time. You can follow these instructions to route internet from the host machine to the phone through USB. This will be necessary to download the necessary packages to configure Wi-Fi.

Wi-Fi configuration

Follow these instructionsh to configure networking.

If you'd like to configure a static IP address, you can modify your /etc/network/interfaces file as below:

auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
    address 192.168.0.2/24
    gateway 192.168.0.1
    hostname foobar

After making sure everything is working, you can disconnect the USB and use the local network IP address to connect to the phone.

Installing HashiCorp Nomad

See How to install HashiCorp Nomad on aarch64 Alpine Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment