Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /etc/os-release for recent distros #108

Closed
stormi opened this issue May 12, 2021 · 1 comment
Closed

Use /etc/os-release for recent distros #108

stormi opened this issue May 12, 2021 · 1 comment

Comments

@stormi
Copy link
Contributor

stormi commented May 12, 2021

/etc/os-release is a de-facto standard that describes a linux distribution, and has been around for years. See its announcement in 2012: http://0pointer.de/blog/projects/os-release and its manpage: https://www.freedesktop.org/software/systemd/man/os-release.html

See also some examples at https://gist.github.com/natefoo/814c5bf936922dad97ff

Using it, we could avoid parsing distro-specific release files, at least for distributions that are not extremely old.

It also comes with an interesting feature: the ID_LIKE key. Let's take Rocky Linux as an example, as we recently added support for it. If we had been using /etc/os-release:

  1. Rocky Linux would automatically have been detected without any code addition.
  2. In install.sh, we could have automatically inferred from ID_LIKE="rhel fedora" that we should install the xe-guest-utilities and xe-guest-utilities-xenstore RPMs.
@stormi
Copy link
Contributor Author

stormi commented Sep 1, 2021

This can be closed as #116 was merged.

My point 2. described above would be a different improvement, let's not keep the issue open for that.

@stormi stormi closed this as completed Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant