]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
apt: avoid ?exact-name for systemd packages
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 11 Jan 2025 01:48:47 +0000 (01:48 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 13 Jan 2025 15:11:56 +0000 (16:11 +0100)
There is a strange interaction between ?exact-name, apt repositories
generated by OBS and multiple architectures, that breaks installing
packages:

$ apt install --dry-run '?exact-name(systemd-cryptsetup)'
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!

systemd-cryptsetup is already the newest version (257.999+731+g8c5b35957-0).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Unsatisfied dependencies:
 systemd-cryptsetup : Conflicts: systemd-cryptsetup:i386 but 257.999+731+g8c5b35957-0 is to be installed
                      Conflicts: systemd-cryptsetup:arm64 but 257.999+731+g8c5b35957-0 is to be installed
 systemd-cryptsetup:i386 : Conflicts: systemd-cryptsetup but 257.999+731+g8c5b35957-0 is to be installed
                           Conflicts: systemd-cryptsetup:arm64 but 257.999+731+g8c5b35957-0 is to be installed
 systemd-cryptsetup:arm64 : Depends: libc6:arm64 (>= 2.38) but it is not installable
                            Depends: libcryptsetup12:arm64 (>= 2:2.7) but it is not installable
                            Depends: libssl3t64:arm64 (>= 3.0.0) but it is not installable
                            Depends: libsystemd-shared:arm64 (= 257.999+731+g8c5b35957-0) but it is not going to be installed
                            Conflicts: systemd-cryptsetup but 257.999+731+g8c5b35957-0 is to be installed
                            Conflicts: systemd-cryptsetup:i386 but 257.999+731+g8c5b35957-0 is to be installed
Error: Unable to correct problems, you have held broken packages.

It seems ?exact-name selects _all_ available packages, unless an architecture
is specified:

$ apt install --dry-run '?exact-name(systemd-cryptsetup:amd64)'
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

But this only happens with the repository metadata format generated
on OBS. There are multiple formats, apparently.

https://download.opensuse.org/repositories/home:/bluca:/systemd/Debian_Testing/

So either we set the specific architecture in the common mkosi.conf,
or we need a separate mkosi.conf with a trigger to filter out releases
where the packages are not available.
I chose the latter as it the filters are fixed, while adding by architecture
means every time a new arch is added, it needs to be duplicated.

This is only necessary for packages that are hosted on OBS, ie: the
systemd ones.

mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf
mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-cryptsetup.conf [new file with mode: 0644]
mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-repart.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-repart.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-ukify.conf [new file with mode: 0644]
mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf [moved from mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu.conf with 82% similarity]
mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf [new file with mode: 0644]
mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-resolved.conf [new file with mode: 0644]

index c75f5a8e994d3627ecdf8d39399f73455e2ce03a..ec8542508c488254071df40a347fc8cd527d0771 100644 (file)
@@ -10,8 +10,6 @@ Packages=
         kmod     # Not pulled in as a dependency on Debian/Ubuntu
         dmsetup  # Not pulled in as a dependency on Debian/Ubuntu
 
-        ?exact-name(systemd-cryptsetup)
-        ?exact-name(systemd-repart)
         libcryptsetup12
 
         # xfsprogs pulls in python on Debian (???) and XFS generally
diff --git a/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-cryptsetup.conf b/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-cryptsetup.conf
new file mode 100644 (file)
index 0000000..7ec70d2
--- /dev/null
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+Release=!bookworm
+
+[TriggerMatch]
+Distribution=ubuntu
+Release=!jammy
+Release=!noble
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-cryptsetup
diff --git a/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-repart.conf b/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/10-systemd-repart.conf
new file mode 100644 (file)
index 0000000..67ffb47
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+Release=!bookworm
+
+[TriggerMatch]
+Distribution=ubuntu
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-repart
index 20428588ecea5ae4b2b2669d351882ea2719de6d..101d3aa503f4b4c3266c19d12a5d85a597644250 100644 (file)
@@ -10,9 +10,6 @@ Packages=
         ?exact-name(distribution-gpg-keys)
         ?exact-name(grub-pc-bin)
         ?exact-name(kali-archive-keyring)
-        ?exact-name(systemd-boot)
-        ?exact-name(systemd-repart)
-        ?exact-name(systemd-ukify)
         ?exact-name(virtiofsd)
         apt
         archlinux-keyring
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf
new file mode 100644 (file)
index 0000000..3e734c3
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+
+[TriggerMatch]
+Distribution=ubuntu
+Release=!jammy
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-boot
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-repart.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-repart.conf
new file mode 100644 (file)
index 0000000..67ffb47
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+Release=!bookworm
+
+[TriggerMatch]
+Distribution=ubuntu
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-repart
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-ukify.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-ukify.conf
new file mode 100644 (file)
index 0000000..6fb6d20
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+Release=!bookworm
+
+[TriggerMatch]
+Distribution=ubuntu
+Release=!jammy
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-ukify
similarity index 82%
rename from mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu.conf
rename to mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
index 1bcda58955bb9260701284b86fa8c7d02b11c3fa..f4fe0fd128580bc0d219f0b7242f318aaae2bdad 100644 (file)
@@ -7,8 +7,6 @@ Distribution=|ubuntu
 
 [Content]
 Packages=
-        ?exact-name(systemd-boot)
-        ?exact-name(systemd-resolved)
         bash
         dbus-broker
         iproute2
diff --git a/mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf b/mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf
new file mode 100644 (file)
index 0000000..3e734c3
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+
+[TriggerMatch]
+Distribution=ubuntu
+Release=!jammy
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-boot
diff --git a/mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-resolved.conf b/mkosi/resources/mkosi-vm/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-resolved.conf
new file mode 100644 (file)
index 0000000..d028b04
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[TriggerMatch]
+Distribution=debian
+Release=!bullseye
+
+[TriggerMatch]
+Distribution=ubuntu
+Release=!jammy
+
+[TriggerMatch]
+Distribution=kali
+
+[Content]
+Packages=systemd-resolved