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.

@nlfx
link
22M

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

@Const
creator
link
22M

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

@ollieparanoid
mod
link
32M

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
pine64,pinephone-1.2pine64,pinephoneallwinner,sun50i-a64

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
  • 1 user / day
  • 1 user / week
  • 3 users / month
  • 16 users / 6 months
  • 244 subscribers
  • 39 Posts
  • 43 Comments
  • Modlog