Hi. I’d like to get the platform string like “lg-hammerhead” or “pine64-pinephone” which was used to build the OS image. I need to do that after the OS is already installed and running.

The software I’m working on has issues entering mem sleep state on Hammerhead. Appears to sleeps OK but the screen is still lit, albeit the brightness is decreased. The exact same binaries run well on the Pinephone.

I’d like to implement a workaround and fix, but to do that I need to detect the device first, to know whether to apply one. I’m using “console” for the shell.

Thanks in advance.

Regards, Kosta.

27 Monate

It should be defined as deviceinfo_codename in /etc/deviceinfo.

27 Monate

Thanks, it’s indeed there on both of my test devices.

37 Monate

Yep, /etc/deviceinfo exists for all devices in postmarketOS. So if you want to do a quick hack, you can simply source the file in a shell script and add logic based on the codename defined there.

If you want a distro-agnostic solution, use the device-tree string, e.g.:

$ cat /proc/device-tree/compatible

This is what we use in megapixels for example.

Please do not ask here if we could port your device. We won’t go and buy your device just to do the port. But you can try porting yourself, it is not that hard and we will help you wherever you get stuck in the chat. If that is not an option for you, consider sending a device to a community member who agrees to do the porting for you (check the milestones) or simply add it to the wish list.

  • 0 users online
  • 2 users / day
  • 2 users / week
  • 5 users / month
  • 14 users / 6 months
  • 284 subscribers
  • 56 Posts
  • Modlog