systemd / mkosi

💽 Build Bespoke OS Images
https://mkosi.systemd.io/
1.19k stars 324 forks source link

Allow referencing profiles from the included config when using Include #3174

Open davide125 opened 1 week ago

davide125 commented 1 week ago

mkosi commit the issue has been seen with

main

Used host distribution

Fedora Linux 41

Used target distribution

Fedora Linux 41

Linux kernel version used

No response

CPU architectures issue was seen on

None

Unexpected behaviour you saw

When using Include against a mkosi repo that defines profiles, the profiles cannot be referenced in the config. My expectation would have been to be able to reference them, and that if a profile existed in the config with the same name that would take precedence over the included one.

Used mkosi config

Given an empty directory with https://github.com/systemd/particleos cloned into the particleos directory and the following mkosi.conf

[Include]
Include=particleos

[Config]
Profiles=desktop

mkosi output

`‣ Profile 'desktop' not found in mkosi.profiles/`
davide125 commented 1 week ago

Worth noting that it looks like this can be workaround with something like

$ ls -l mkosi.profiles/
total 4
lrwxrwxrwx. 1 davide davide 37 Nov 10 15:23 desktop -> ../particleos/mkosi.profiles/desktop/

but that feels a bit hacky to me.

DaanDeMeyer commented 1 week ago

Hmm, this feels like it'd a bit too flexible, I think your solution could actually be OK here. It makes it explicit that you're using a profile from somewhere else compared to explicitly picking that.