AsahiLinux / asahi-scripts

Miscellaneous admin scripts for the Asahi Linux reference distro
MIT License
45 stars 32 forks source link

asahi-diagnose: Use hostnamectl to fetch hostname #25

Open emberdex opened 1 year ago

emberdex commented 1 year ago

A default installation of Asahi Linux doesn't appear to come included with the hostname binary. This causes the hostname lookup to fail when asahi-diagnose is used.

This technically ties the script to systemd, so a better solution if this becomes a concern (i.e. if different init systems are offered in the future) might be to check for the presence of the hostname binary, and if it's not present, go with a sensible alternative value instead of erroring out.

awilfox commented 9 months ago

Unfortunately, the script is already tied to systemd, as it calls journalctl to read the kernel boot log. I think those of us wanting to do the integration work on non-systemd distros (Gentoo, Adélie, etc) will need to make a few adjustments.

Would there be support for making this script a bit more modular in that regard?