obs: parse /usr/src/packages/SOURCES/mkosi.conf at high priority if it exists#3790
Open
bluca wants to merge 1 commit intosystemd:mainfrom
Open
obs: parse /usr/src/packages/SOURCES/mkosi.conf at high priority if it exists#3790bluca wants to merge 1 commit intosystemd:mainfrom
bluca wants to merge 1 commit intosystemd:mainfrom
Conversation
…t exists When building a mkosi repository called 'particleos', OBS calls mkosi with a top-level config file extracted to /usr/src/packages/SOURCES/mkosi.conf but it runs from the repo directory at /usr/src/packages/SOURCES/particleos/ with SOURCES/mkosi.conf being the source file extracted at source time, ie: defined by the user, among the many files available in the repository. So this can be used to select the entry point, that defines what to build, when a repository provides many build types, profiles, images, etc. If it exists, parse this entry point always, at a higher priority than the rest, so that it can set the defaults for the OBS build. Given this is always parsed, regardless of which stage we are at, we also need to skip non-existing includes. I.E. when trying to figure out the default config, mkosi will set the resources folder to / and then try to load the includes defined in this entry point, I.E.: Include=mkosi-obs will result in mkosi trying to load a non-existent /mkosi-obs and fail. Skip the include gracefully if it doesn't exist. With this I can add entry points to hidden directories in a repo, or even outside of it, and select them in the _service on OBS and build multiple different images from the same git repo and branch, for example the particleos gnome image: https://build.opensuse.org/projects/home:bluca:branches:home:bluca:systemd/packages/particleos/files/_service?expand=1
Member
Author
|
@daandemeyer @behrmann could you please check this one out? It applies verbatim the suggestion from #3768 (comment) |
daandemeyer
requested changes
Jul 17, 2025
Member
Author
|
Well ok, but this was your suggestion from the earlier linked PR... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building a mkosi repository called 'particleos', OBS calls mkosi with a top-level config file extracted to /usr/src/packages/SOURCES/mkosi.conf but it runs from the repo directory at /usr/src/packages/SOURCES/particleos/
with SOURCES/mkosi.conf being the source file extracted at source time, ie: defined by the user, among the many files available in the repository. So this can be used to select the entry point, that defines what to build, when a repository provides many build types, profiles, images, etc.
If it exists, parse this entry point always, at a higher priority than the rest, so that it can set the defaults for the OBS build.
Given this is always parsed, regardless of which stage we are at, we also need to skip non-existing includes. I.E. when trying to figure out the default config, mkosi will set the resources folder to / and then try to load the includes defined in this entry point, I.E.: Include=mkosi-obs will result in mkosi trying to load a non-existent /mkosi-obs and fail. Skip the include gracefully if it doesn't exist.
With this I can add entry points to hidden directories in a repo, or even outside of it, and select them in the _service on OBS and build multiple different images from the same git repo and branch, for example the particleos gnome image:
https://build.opensuse.org/projects/home:bluca:branches:home:bluca:systemd/packages/particleos/files/_service?expand=1