Skip to content
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

mkosi: implement obsbinlnk #872

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

mkosi: implement obsbinlnk #872

wants to merge 3 commits into from

Conversation

bluca
Copy link
Contributor

@bluca bluca commented Sep 7, 2022

Allow to build mkosi images using other mkosi images (systemd-sysext)

@bluca
Copy link
Contributor Author

bluca commented Sep 7, 2022

@mlschroe @adrianschroeter need some help as this is not yet working, and I can't figure out what the problem is - I followed the same pattern as 50b1a58 but still I can't get an .obsbinlnk file. I also tried to implement query() but that also doesn't help.

What am I missing?

@adrianschroeter
Copy link
Member

Can you give us a setup (either via git or somewhere in build.o.o) where we could have a look? basically a two mkosi image build setup.

Allow to build mkosi images using other mkosi images (systemd-sysext)
@bluca
Copy link
Contributor Author

bluca commented Oct 5, 2022

@adrianschroeter sure, this is the base:

https://build.opensuse.org/package/show/home:bluca:mkosi/suse-image

and this is the extension that should pull the base in (BaseImage=base):

https://build.opensuse.org/package/show/home:bluca:mkosi/suse-sysext

With the patches from this PR applied, the build stays unresolvable in my local VM.

I've also pushed a patch to add queryiso() as the doc suggests, but still no luck.

Thank you!

@bluca
Copy link
Contributor Author

bluca commented Nov 24, 2022

@adrianschroeter did you have a chance to have a look at this?

@bluca
Copy link
Contributor Author

bluca commented Apr 27, 2023

@adrianschroeter @mlschroe gentle ping on this issue

@lnussel
Copy link
Member

lnussel commented Mar 12, 2024

looks like this is almost working in pbuild. The code produces a .obsbinlnk file with content like this:

{
  arch     => "x86-64",
  hdrmd5   => "57c85225a2ed7904531814a64fe99c4a",
  lnk      => "base",
  name     => "base",
  provides => ["opensuse:tumbleweed", "base = ", "suse-image = "],
  release  => 0,
  source   => "suse-image",
  version  => undef,
}

I think the name needs to be prefixed with something like mkosi:, ie mkosi:base to indicate a namespace. Otherwise the dependency resolver cannot know that base is not a package.

@@ -67,11 +67,75 @@ sub parse {
if (length $cfg->val('Content', 'BuildPackages')) {
push(@packages, split /\s+/, $cfg->val('Content', 'BuildPackages'));
}
if (length $cfg->val('Partitions', 'BaseImage')) {
push(@packages, $cfg->val('Partitions', 'BaseImage'));
Copy link
Member

@lnussel lnussel Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it should add the prefix mkosi: I think

@bluca
Copy link
Contributor Author

bluca commented Mar 12, 2024

looks like this is almost working in pbuild. The code produces a .obsbinlnk file with content like this:

{
  arch     => "x86-64",
  hdrmd5   => "57c85225a2ed7904531814a64fe99c4a",
  lnk      => "base",
  name     => "base",
  provides => ["opensuse:tumbleweed", "base = ", "suse-image = "],
  release  => 0,
  source   => "suse-image",
  version  => undef,
}

I think the name needs to be prefixed with something like mkosi:, ie mkosi:base to indicate a namespace. Otherwise the dependency resolver cannot know that base is not a package.

I've added that - do you know where the side that consumes it lives, to make it parse that?

@lnussel
Copy link
Member

lnussel commented Mar 13, 2024

Got it working with something that looks like this:

{
  arch     => "x86-64",
  hdrmd5   => "f1fa8d13dfbbc294855ee8bbf7b01261",
  lnk      => "base.raw",
  name     => "mkosi:base",
  provides => [
                "opensuse:tumbleweed",
                "mkosi:base = 0",
                "mkosi:suse-image = 0",
              ],
  release  => 0,
  source   => "suse-image",
  version  => 0,
}

Consumer would be PBuild::RepoMgr::copyimagebinaries after adding a code path for mkosi :) See pr#985
However, this is only for pbuild. Very similar code is in OBS. PBuild is a stripped down clone basically.

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.

3 participants