]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use mkosi dependencies in default image 2839/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 5 Jul 2024 18:52:22 +0000 (20:52 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 6 Jul 2024 14:54:15 +0000 (16:54 +0200)
Let's reduce duplication by using mkosi dependencies to install
all required dependencies to build the default image. To make this
work we add support for tools trees on jammy/bookworm. We also drop
support for a focal default image as it's too much of a burden to
maintain.

We also remove the EPEL only packages from the CentOS tools tree so
that mkosi dependencies works on a CentOS Stream system without EPEL
enabled.

Finally, curl-minimal is replaced by curl because trying to install
curl-minimal on a system with curl leads to a dnf failure so we opt
for the larger curl in order to make mkosi dependencies useful in
more situations.

25 files changed:
mkosi.conf
mkosi.conf.d/20-arch.conf
mkosi.conf.d/20-centos.conf
mkosi.conf.d/20-fedora/mkosi.conf
mkosi.conf.d/20-fedora/mkosi.conf.d/20-uefi.conf [deleted file]
mkosi.conf.d/20-opensuse.conf
mkosi.conf.d/20-rhel-ubi.conf
mkosi.conf.d/30-centos-fedora/mkosi.conf
mkosi.conf.d/30-centos-fedora/mkosi.conf.d/20-uefi.conf
mkosi.conf.d/30-debian-ubuntu/mkosi.conf
mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-ext4-orphan-file.conf
mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-not-focal.conf [deleted file]
mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-systemd-extra.conf
mkosi.prepare [new file with mode: 0755]
mkosi.prepare.chroot
mkosi/resources/mkosi-tools/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-arch.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos-fedora/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos.conf [deleted file]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu.conf with 91% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/systemd-boot.conf [moved from mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-focal.conf with 55% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/ubuntu-keyring.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/virtiofsd.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/10-fedora/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf

index 29c8b1ab977b53745764e0d064e3f5f0c459f00b..000536b17dd09ab9a1242dcc9089bb3fb5691f43 100644 (file)
@@ -15,13 +15,12 @@ BuildSources=.
 BuildSourcesEphemeral=yes
 
 Packages=
-        attr
-        ca-certificates
         gdb
-        jq
         less
         nano
         strace
+        systemd
+        udev
         tmux
 
 InitrdPackages=
index c5d1b413c1e18ab8fe1360622e99e5b7027baca4..8be11b199b102f9bd678e655467e3a124da73964 100644 (file)
@@ -5,51 +5,17 @@ Distribution=arch
 
 [Content]
 Packages=
-        apt
-        archlinux-keyring
         base
         bash
-        btrfs-progs
-        bubblewrap
-        ca-certificates
-        coreutils
-        cpio
-        curl
         dbus-broker
         dbus-broker-units
-        debian-archive-keyring
-        dnf
-        dosfstools
-        e2fsprogs
-        edk2-ovmf
-        erofs-utils
-        git
         grub
         iproute
         iputils
         linux
-        mtools
         openssh
-        openssl
-        pacman
         perf
-        pesign
-        python-cryptography
-        qemu-base
+        python
         qemu-user-static
-        sbsigntools
-        shadow
         shim
-        socat
-        squashfs-tools
         strace
-        swtpm
-        systemd
-        systemd-ukify
-        tar
-        ukify
-        util-linux
-        virtiofsd
-        xfsprogs
-        xz
-        zstd
index 48bb3c51c1e7380d4218ad966a2a4a19a2dccaae..eccb74ff8b184c5d67c43451c1227dae9e15c12e 100644 (file)
@@ -13,5 +13,3 @@ Distribution=|rocky
 @ShimBootloader=none
 Packages=
         linux-firmware
-        dnf
-        dnf-plugins-core
index 49a31aee7bb58c41b0881ce77368eab52a9ea4cc..1a05c7cb3ac88c3898b61a3d259ace3d35e9da3c 100644 (file)
@@ -8,15 +8,5 @@ Distribution=fedora
 
 [Content]
 Packages=
-        apt
-        archlinux-keyring
-        btrfs-progs
-        debian-keyring
-        distribution-gpg-keys
-        dnf5
-        dnf5-plugins
-        erofs-utils
-        pacman
         qemu-user-static
         systemd-networkd
-        zypper
diff --git a/mkosi.conf.d/20-fedora/mkosi.conf.d/20-uefi.conf b/mkosi.conf.d/20-fedora/mkosi.conf.d/20-uefi.conf
deleted file mode 100644 (file)
index 7766486..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Architecture=|x86-64
-Architecture=|arm64
-
-[Content]
-Packages=
-        sbsigntools
-        systemd-ukify
index 07316fa218e120de0eabedeced41ae9dd02898df..d6a25070d430e1c2800c7ea761eb8f4525ae524f 100644 (file)
@@ -11,19 +11,7 @@ Distribution=opensuse
 @ShimBootloader=none
 Packages=
         bash
-        btrfs-progs
-        bubblewrap
-        ca-certificates
-        coreutils
-        cpio
-        curl
-        distribution-gpg-keys
-        dnf
-        dosfstools
-        e2fsprogs
-        erofs-utils
-        git-core
-        grep
+        diffutils
         grub2-efi
         grub2-i386-pc
         grub2-x86_64-efi
@@ -34,36 +22,15 @@ Packages=
         libtss2-mu0
         libtss2-rc0
         libtss2-tcti-device0
-        mtools
         openssh-clients
         openssh-server
-        openssl
-        ovmf
         patterns-base-minimal_base
         perf
-        pesign
-        python3-pefile
-        qemu-headless
+        python3
         qemu-linux-user
-        sbsigntools
-        shadow
         shim
-        socat
-        squashfs
         strace
-        swtpm
-        systemd
         systemd-boot
-        systemd-container
         systemd-coredump
-        systemd-experimental
-        tar
         ucode-amd
         ucode-intel
-        udev
-        util-linux
-        virtiofsd
-        xfsprogs
-        xz
-        zstd
-        zypper
index 34128ec638857562c83ca9c3acd0f245b22eb23e..088eda43ac188725aa3cb86d15c3cd7fe2f6bade 100644 (file)
@@ -8,6 +8,3 @@ Distribution=rhel-ubi
 
 [Content]
 Bootable=no
-Packages=
-        systemd
-        systemd-udev
index 4c8e3e674ebc9b680c9287626818e75a03eaba5d..431ab2c460492ab8a68de1b3c4e64491baee8aa0 100644 (file)
@@ -9,36 +9,12 @@ Distribution=|fedora
 [Content]
 Packages=
         bash
-        bubblewrap
-        ca-certificates
-        coreutils
-        cpio
-        curl-minimal
-        dosfstools
-        e2fsprogs
-        git-core
         iproute
         iputils
         kernel-core
-        mtools
         openssh-clients
         openssh-server
-        openssl
         perf
-        python3-cryptography
-        qemu-kvm-core
-        shadow-utils
-        socat
-        squashfs-tools
+        python3
         strace
-        swtpm
-        systemd
-        systemd-container
         systemd-resolved
-        systemd-udev
-        tar
-        util-linux
-        virtiofsd
-        xfsprogs
-        xz
-        zstd
index e6b919c487dd32bb3c650e53ef6d0fa4bba3108b..6ade55055b30babc69e26b54e68c5a86a63a1390 100644 (file)
@@ -6,8 +6,6 @@ Architecture=|arm64
 
 [Content]
 Packages=
-        edk2-ovmf
         grub2-efi
-        pesign
         shim
         systemd-boot
index 4b5d18ec296c857229378628a9baf4ea0d1581b9..6b008ca5c987654c520e2a8366aca2b0053aec15 100644 (file)
@@ -6,51 +6,22 @@ Distribution=|ubuntu
 
 [Content]
 Packages=
-        ?exact-name(systemd-ukify)
         ^libtss2-esys-[0-9.]+-0$
         ^libtss2-mu[0-9.-]+$
-        apt
         bash
-        btrfs-progs
-        bubblewrap
-        ca-certificates
-        coreutils
-        cpio
-        curl
-        debian-archive-keyring
-        dosfstools
-        e2fsprogs
-        erofs-utils
-        git-core
+        dbus-broker
         iproute2
         iputils-ping
         libtss2-rc0
         libtss2-tcti-device0
-        mtools
         openssh-client
         openssh-server
-        openssl
-        ovmf
-        pesign
-        python3-cryptography
-        python3-pefile
-        qemu-system
+        python3
         qemu-user-static
-        sbsigntool
         shim-signed
-        socat
-        squashfs-tools
         strace
-        systemd
-        systemd-container
         systemd-coredump
         systemd-sysv
-        tar
+        systemd-boot
+        systemd-resolved
         tzdata
-        udev
-        uidmap
-        util-linux
-        xfsprogs
-        xz-utils
-        zstd
-        zypper
index c4f6859d689f0168bf50f64683121f925daaf738..2109fb9ab4606ed8ce5f238edf063668c51f9088 100644 (file)
@@ -2,10 +2,9 @@
 
 [Match]
 Distribution=ubuntu
-Release=|focal
-Release=|jammy
+Release=jammy
 
 [Content]
-# "orphan_file" is enabled by default in recent versions of mkfs.ext4 but not supported by the Jammy/Focal kernels
-# so we explicitly disable it.
+# "orphan_file" is enabled by default in recent versions of mkfs.ext4 but not supported by the Jammy kernel so we
+# explicitly disable it.
 Environment=SYSTEMD_REPART_MKFS_OPTIONS_EXT4="-O ^orphan_file"
diff --git a/mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-not-focal.conf b/mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-not-focal.conf
deleted file mode 100644 (file)
index a65670a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=|!ubuntu
-Release=|!focal
-
-[Content]
-Packages=
-        archlinux-keyring
-        dbus-broker
-        dnf
-        makepkg
-        pacman-package-manager
-        swtpm
index ab5a925247ae042ce50a76cc8807a51a7761c943..4fa99163521a57928c0138c8f6b7d91a90554a08 100644 (file)
@@ -2,7 +2,6 @@
 
 [Match]
 Release=!jammy
-Release=!focal
 
 [Content]
 Packages=
diff --git a/mkosi.prepare b/mkosi.prepare
new file mode 100755 (executable)
index 0000000..3c47fc7
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -e
+
+if [ "$1" = "build" ]; then
+    exit 0
+fi
+
+mkosi-chroot "$SRCDIR"/bin/mkosi dependencies | xargs -d '\n' mkosi-install
index 754015efb5467223933a109b6a83d966738e0d17..ded1f5e2d47832844a2c5d53b7e9403cd8a88759 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/sh
 # SPDX-License-Identifier: LGPL-2.1-or-later
+set -e
 
 if [ "$1" = "final" ] && command -v pacman-key; then
     pacman-key --init
index 04ece81a227b42f9458fb8e95e9b957284cf1fa7..8a5edd8449ce1b33a8e1605bdcb5f98e17d96fc8 100644 (file)
@@ -16,6 +16,7 @@ Packages=
         ca-certificates
         coreutils
         cpio
+        curl
         diffutils
         dnf
         dosfstools
@@ -35,7 +36,6 @@ Packages=
         systemd
         tar
         util-linux
-        virtiofsd
         xfsprogs
         zstd
 SELinuxRelabel=no
index 73d0a3304ef37643a00725ab8a0d67f078fa2432..329ccb589d8b69ecf967f77f0bdf4eacdef1be5d 100644 (file)
@@ -9,7 +9,6 @@ Packages=
         archlinux-keyring
         base
         btrfs-progs
-        curl
         dbus-broker
         dbus-broker-units
         debian-archive-keyring
@@ -31,4 +30,5 @@ Packages=
         systemd-ukify
         ubuntu-keyring
         virt-firmware
+        virtiofsd
         xz
index b17676772cddbe34481a46b9410588c5d8af8ac4..d78c794852c800e188d73f5d66d412bc82834ab3 100644 (file)
@@ -9,11 +9,7 @@ Distribution=|fedora
 
 [Content]
 Packages=
-        apt
         createrepo_c
-        curl-minimal
-        debian-keyring
-        distribution-gpg-keys
         dnf-plugins-core
         git-core
         openssh-clients
@@ -27,6 +23,6 @@ Packages=
         systemd-container
         systemd-journal-remote
         systemd-udev
-        ubu-keyring
         virt-firmware
+        virtiofsd
         xz
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos.conf
deleted file mode 100644 (file)
index 8aa105a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=|centos
-Distribution=|alma
-Distribution=|rocky
-Distribution=|rhel
-
-[Distribution]
-Repositories=
-        epel
-        epel-next
similarity index 91%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
index 1e5c1c8ad9d055f683ad61c39e16041560774e8b..1b0a8f9c37552d726405ee4a0f523586f809f37c 100644 (file)
@@ -12,7 +12,6 @@ Packages=
         archlinux-keyring
         btrfs-progs
         createrepo-c
-        curl
         debian-archive-keyring
         erofs-utils
         git-core
@@ -33,12 +32,9 @@ Packages=
         sbsigntool
         squashfs-tools
         swtpm-tools
-        systemd-boot
         systemd-container
         systemd-coredump
         systemd-journal-remote
-        ubuntu-keyring
         uidmap
-        virtiofsd
         xz-utils
         zypper
similarity index 55%
rename from mkosi.conf.d/30-debian-ubuntu/mkosi.conf.d/20-focal.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/systemd-boot.conf
index e46e118748f791006c0e0f1b7d3e55a283bd46d6..a31acd147bf54d4e10fbdc9a1d3876dc14246618 100644 (file)
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 [Match]
-Distribution=ubuntu
-Release=focal
+Distribution=|!ubuntu
+Release=|!jammy
 
 [Content]
 Packages=
-        dbus
+        systemd-boot
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/ubuntu-keyring.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/ubuntu-keyring.conf
new file mode 100644 (file)
index 0000000..a94ac4a
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|!debian
+Release=|!bookworm
+
+[Content]
+Packages=
+        ubuntu-keyring
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/virtiofsd.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/virtiofsd.conf
new file mode 100644 (file)
index 0000000..8c2b285
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# Install virtiofsd except on Ubuntu Jammy and Debian Bookworm.
+
+[Match]
+Distribution=|!ubuntu
+Release=|!jammy
+
+[Match]
+Distribution=|!debian
+Release=|!bookworm
+
+[Content]
+Packages=
+        virtiofsd
index fa2b1165ecf4cf5923f9594808f65839e9e254b0..089766069c58efc5b6475b35415a4e53fea24b1a 100644 (file)
@@ -5,8 +5,11 @@ Distribution=fedora
 
 [Content]
 Packages=
+        apt
         archlinux-keyring
         btrfs-progs
+        debian-keyring
+        distribution-gpg-keys
         dnf5
         dnf5-plugins
         erofs-utils
@@ -16,4 +19,5 @@ Packages=
         qemu-system-s390x-core
         reprepro
         systemd-ukify
+        ubu-keyring
         zypper
index b496f72dcc5195231a73af50d2a666009320f3e3..c48f4424866658fcae92491fbac4050119d5212e 100644 (file)
@@ -8,7 +8,6 @@ Packages=
         btrfs-progs
         ca-certificates-mozilla
         createrepo_c
-        curl
         distribution-gpg-keys
         dnf-plugins-core
         dnf5
@@ -34,5 +33,6 @@ Packages=
         systemd-coredump
         systemd-experimental
         systemd-journal-remote
+        virtiofsd
         xz
         zypper