Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Use data from /etc/os-release to identify the operating system #627

Open
poncovka opened this issue Jun 27, 2023 · 0 comments
Open

Use data from /etc/os-release to identify the operating system #627

poncovka opened this issue Jun 27, 2023 · 0 comments

Comments

@poncovka
Copy link
Contributor

Names of cloud images are not a reliable source of information when it comes to identifying the operating system. These names are not standardized across cloud providers or operating systems themselves (see #615). However, every Linux distribution provides the standardized /etc/os-release file that contains operating system identification data. For example:

NAME="Fedora Linux"
VERSION="37 (Workstation Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
SUPPORT_END=2023-11-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

I think that Cloud Image Directory should use ID, VERSION_ID and VARIANT_ID in the API and extend the image data with NAME, VERSION, VARIANT and PRETTY_NAME. That would automatically take care of sorting cloud images by products and it would work by default for all cloud providers and Linux distributions provided by CID.

Drawbacks

  • Getting the content of the /etc/os-release file from a cloud image probably requires to run an instance of this image. That can be expensive. However, the content of this file should be predictable and constant, so there should be some space for assumptions and heuristics, that can be later verified with image tests. Another option is to somehow integrate the collection of image data directly into the image tests that are going to be run anyway.

Benefits

  • Cloud Image Directory uses standardized identifiers.
  • It improves the credibility of the provided image data.
  • It simplifies support for future cloud providers and products.
  • It opens a window for collecting more data about cloud images (for example, the available software).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant