Assemble OS information in flatpak

Hello,

how do I assemble debug information about the operating system inside the flatpak sandbox?

My application depends on ping_group_range being configured correctly, and apparently there are still systems which don’t set it for unprivileged ICMP sockets.

To help troubleshooting I wanted to collect the OS configuration for use in the debug info property of libadwaita’s about dialog but… the flatpak sandbox gets in my way.

The contents of /proc/sys/net/ipv4/ping_group_range appear to be entirely bogus inside the flatpak sandbox:

$ cat /proc/sys/net/ipv4/ping_group_range
0	2147483647
$ flatpak run --command=bash de.swsnr.turnon
[📦 de.swsnr.turnon ~]$ cat /proc/sys/net/ipv4/ping_group_range 
65534	65534

As a workaround I wanted to include information about the host OS (so as to be able to lookup the default values at least), but /etc/os-release isn’t helpful either:

[📦 de.swsnr.turnon ~]$ cat /etc/os-release 
NAME=GNOME
VERSION="47 (Flatpak runtime)"
VERSION_ID=47
ID=org.gnome.Platform
ID_LIKE=org.freedesktop.platform
PRETTY_NAME="GNOME 47 (Flatpak runtime)"
BUG_REPORT_URL="https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/new"
HOME_URL="https://www.gnome.org/"

How do I deal with this situation in order to provide helpful debug information? Is there some kind of portal I could use to get OS information with user consent? Or can I work around this in some way?

Does org.freedesktop.hostname1 over DBus provide you with the OS info you want? org.freedesktop.hostname1

Mh, the service is a nice replacement for os-release, thanks.

Still, it won’t give me the value of the sysctl I’m interested in…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.