Skip to content

fix: allow distro definitition override #905

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hanthor
Copy link

@hanthor hanthor commented Apr 25, 2025

Fixes #904

This accepts --override-distro-def=fedora-40.yaml to set the manifest. I'm not sure if this is ideal or if it would better to have it do into the the distrodef function like normal and allow for fuzzy match

@hanthor
Copy link
Author

hanthor commented Apr 25, 2025

	// use lorax-templates-rhel if the source distro is not Fedora with the exception of Fedora ELN
	img.UseRHELLoraxTemplates =
		c.SourceInfo.OSRelease.ID != "fedora" || c.SourceInfo.OSRelease.VersionID == "eln"

This is problematic for me https://github.com/hanthor/bootc-image-builder/blob/725b710052510c35e15ff09ff571b5a8e3be83af/bib/cmd/bootc-image-builder/image.go#L505-L508

@supakeen supakeen requested review from mvo5 and supakeen April 25, 2025 06:44
@supakeen
Copy link
Member

	// use lorax-templates-rhel if the source distro is not Fedora with the exception of Fedora ELN
	img.UseRHELLoraxTemplates =
		c.SourceInfo.OSRelease.ID != "fedora" || c.SourceInfo.OSRelease.VersionID == "eln"

This is problematic for me https://github.com/hanthor/bootc-image-builder/blob/725b710052510c35e15ff09ff571b5a8e3be83af/bib/cmd/bootc-image-builder/image.go#L505-L508

This logic can likely be inverted to always use -generic unless it's RHEL, Alma Linux, or ELN. Thoughts? cc @mvo5 / @ondrejbudai?

@Venefilyn
Copy link

So with distros that are based on a specific system there is always ID_LIKE. Could that be the primary thing to look for with ID as a backup, or are there edge-cases here that I do not know of?

Example:

NAME="Bazzite"
VERSION="42.20250501.0 (Silverblue)"
RELEASE_TYPE=stable
ID=bazzite
ID_LIKE="fedora"
VERSION_ID=42
VERSION_CODENAME="Holographic"
PLATFORM_ID="platform:f42"
PRETTY_NAME="Bazzite 42 (FROM Fedora Silverblue)"

@hanthor
Copy link
Author

hanthor commented May 10, 2025

ID_LIKE can have multiple entries in it I think. Like Centos has rhel and fedora

@mvo5
Copy link
Collaborator

mvo5 commented May 15, 2025

Fwiw, we inverted the #907

	// use lorax-templates-rhel if the source distro is not Fedora with the exception of Fedora ELN
	img.UseRHELLoraxTemplates =
		c.SourceInfo.OSRelease.ID != "fedora" || c.SourceInfo.OSRelease.VersionID == "eln"

This is problematic for me https://github.com/hanthor/bootc-image-builder/blob/725b710052510c35e15ff09ff571b5a8e3be83af/bib/cmd/bootc-image-builder/image.go#L505-L508

This part got (hopefully) fixed with #907 - is there more that is causing issues for you? FTR I'm fine with a way to override the detection, mostly wondering if there are more things we should/could fix "automatically"

@hanthor
Copy link
Author

hanthor commented May 23, 2025

We either need to ignore edits to os-relase and find a more hardcoded way to detect the distro or allow for overrides/have helpful text for the user when the manifest isn't found guiding them to just override to fedora or centos etc.

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

Successfully merging this pull request may close these issues.

Allow users to override OS matching to a specific OS version for manifest purposes
4 participants