bootc-image-builder icon indicating copy to clipboard operation
bootc-image-builder copied to clipboard

fix: allow distro definitition override

Open hanthor opened this issue 8 months ago • 6 comments

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 avatar Apr 25 '25 05:04 hanthor

	// 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

hanthor avatar Apr 25 '25 06:04 hanthor

	// 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?

supakeen avatar Apr 25 '25 07:04 supakeen

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)"

Venefilyn avatar May 10 '25 00:05 Venefilyn

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

hanthor avatar May 10 '25 06:05 hanthor

Fwiw, we inverted the https://github.com/osbuild/bootc-image-builder/pull/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 https://github.com/osbuild/bootc-image-builder/pull/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"

mvo5 avatar May 15 '25 14:05 mvo5

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.

hanthor avatar May 23 '25 19:05 hanthor