systemd / mkosi

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

Can't create bootable images of debian (-r stretch or -r unstable) on mkosi 4.3 (shipped by Fedora 29) #280

Closed q2dg closed 5 years ago

q2dg commented 6 years ago

The error I get is:

captura de pantalla de 2018-11-04 12-19-40

nosada commented 5 years ago

Same issue here. I got almost same error when running mkosi build.

I use Arch Linux and mkosi-relate files are like below:

$ ls -l
total 8
-rw-r--r-- 1 nosada nosada 106 Nov 11 01:03 mkosi.default
-rwxr-xr-x 1 nosada nosada  30 Nov 11 00:52 mkosi.postinst

$ cat mkosi.default
[Distribution]
Distribution=arch

[Output]
Format=raw_btrfs
Output=test

[Partitions]
RootSize=3221225472

$ cat mkosi.postinst
#!/bin/bash
echo "Testing..."

I've tested several systemd versions (note below versions are in Arch Linux):

systemd version mkosi version mkosi.postinst exists affected (mkosi build failed) ?
239.300-1 4-1 yes yes
239.300-1 4-1 no no
239.6-1 4-1 yes no
239.6-1 4-1 no NOT TESTED (but maybe no)

So I think this issue happens when below conditions are satisfied:

Error log is too long so I paste it to Gist: https://gist.github.com/nosada/c2b0bec2365a879530702c129a8578f1

q2dg commented 5 years ago

I have not any mkosi.postinst file...

nosada commented 5 years ago

Really? Then it seems I got different issue... Sorry for my interruption...

LukeShu commented 5 years ago

So, I believe that this is a subtle bug in upstream systemd(-stable). I'll report it upstream when I figure out what to report.

LukeShu commented 5 years ago

I'm pretty sure this is the issue fixed by https://github.com/systemd/systemd-stable/commit/6b4878d667737b523ea251f2d8abde9748bb295e (also note that this is the only commit on 239-stable that is not included in Arch's 239.300)

lucasdemarchi commented 5 years ago

Yep, it looks like the problem I was having... A commit was not backported properly on systemd.

q2dg commented 5 years ago

So...what's the plan, then? Will it be possible to solve this issue in last systemd version? I ask from my ignorance. Thanks a lot @LukeShu

LukeShu commented 5 years ago

That commit was made to v239-stable yesterday morning by @keszybz.

keszybz is also one of Fedora's systemd packagers, so I'm hopeful that it will make it in to Fedora's systemd quickly. Looking at 239-6.git9f3aed1.fc29, that came within a day of the relevant commits to v239-stable; but there was also a security fix in there, so it was more urgent. I'm not sure what the usual lead-time is from systemd-stable to Fedora.

Arch numbers their systemd releases like "TAG.NUMBER_OF_COMMITS_FROM_STABLE_BRANCH", so 239.300 is the v239 tag, plus 300 commits from the v239-stable branch. The fix is the 301st commit on that branch, so I'd expect this to be fixed in Arch's systemd >= 239.301. However, Arch doesn't track systemd-stable terribly closely, they seem to only pull from it when it fixes an issue that Arch users are actually reporting, and searching bugs.archlinux.org, I don't see anyone reporting it yet.

nosada commented 5 years ago

Successed to build image via mkosi after backporting https://github.com/systemd/systemd-stable/commit/6b4878d667737b523ea251f2d8abde9748bb295e to systemd 239.300-2 (latest in Arch). Thank you so much @LukeShu !

Here's a patch for PKGBUILD of systemd 239.300-2

diff --git a/systemd/trunk/PKGBUILD b/systemd/trunk/PKGBUILD
index fc17f68b0a4..b95570e0624 100644
--- a/systemd/trunk/PKGBUILD
+++ b/systemd/trunk/PKGBUILD
@@ -64,6 +64,8 @@ sha512sums=('SKIP'
 _backports=(
   # journal: adapt for new improved LZ4_decompress_safe_partial()
   'e41ef6fd0027d3619dc1cf062100b2d224d0ee7e'
+  # tree-wide: use structured initialization for sockaddr_un
+  '6b4878d667737b523ea251f2d8abde9748bb295e'
 )

 _reverts=(
poettering commented 5 years ago

OK, I figure this can be closed here then, as this was fixed in systemd-stable?

q2dg commented 5 years ago

That's fine. I was waiting to get the upgrade in official Fedora repositories to close this issue (this hasn't happened yet) to mark the solution is already "mainstream" but it's true it's not a systemd problem. Thanks!

fedelibre commented 5 years ago

I've built a new rpm from the latest git from systemd-stable, as I could not wait for the Fedora update (not available on Fedora 29 yet). Now mkosi builds the image without errors.

Installed Packages
Name         : systemd
Version      : 239
Release      : 7.git6b4878d.fc29

Here's the diff of the .spec file:

diff --git a/systemd.spec b/systemd.spec
index 6403b20..646965a 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -1,4 +1,4 @@
-%global gitcommit 9f3aed1c7d20c12cc932b81e127d48edf855f36c
+%global gitcommit 6b4878d667737b523ea251f2d8abde9748bb295e
 %{?gitcommit:%global gitcommitshort %(c=%{gitcommit}; echo ${c:0:7})}

 %global stable 1
@@ -15,7 +15,7 @@
 Name:           systemd
 Url:            http://www.freedesktop.org/wiki/Software/systemd
 Version:        239
-Release:        6%{?gitcommit:.git%{gitcommitshort}}%{?dist}
+Release:        7%{?gitcommit:.git%{gitcommitshort}}%{?dist}
 # For a breakdown of the licensing, see README
 License:        LGPLv2+ and MIT and GPLv2+
 Summary:        System and Service Manager