From 0b95e4b2061e862b0dfe17de018f0e6e76e0bb50 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Jan 17 2025 14:51:21 +0000 Subject: Move mkosi stuff into a subdirectory Let's clean up the top level repo a little by moving the mkosi stuff into a subdirectory. --- diff --git a/mkosi.conf b/mkosi.conf deleted file mode 100644 index d8b44d1..0000000 --- a/mkosi.conf +++ /dev/null @@ -1,117 +0,0 @@ -[Config] -MinimumVersion=25~devel - -[Distribution] -Distribution=centos - -[Output] -OutputDirectory=mkosi.output - -[Content] -Bootable=no -Autologin=yes - -Packages= - acl - attr - bash-completion - binutils - bpftrace - coreutils - curl - diffutils - dnf - findutils - gdb - git-core - grep - gzip - iproute - iproute-tc - iputils - jq - kbd - kmod - less - man - man-db - nano - nftables - nmap-ncat - openssh-clients - openssh-server - openssl - p11-kit - pam - passwd - pciutils - perf - policycoreutils - polkit - procps-ng - python3 - rpm - rpm-build - rsync - sed - setools-console - socat - strace - stress-ng - tar - tmux - tree - util-linux - valgrind - vim-common - which - zsh - zstd - NetworkManager - -VolatilePackages= - kernel-core - selinux-policy - selinux-policy-targeted - systemd - systemd-boot - systemd-container - systemd-devel - systemd-journal-remote - systemd-libs - systemd-pam - systemd-resolved - systemd-udev - -InitrdVolatilePackages= - systemd - systemd-libs - systemd-udev - -SELinuxRelabel=yes - -[Build] -ToolsTree=default -BuildDirectory=mkosi.builddir -CacheDirectory=mkosi.cache -Incremental=yes -BuildSources=. -BuildSourcesEphemeral=yes - -[Runtime] -RuntimeBuildSources=yes -RuntimeScratch=no -CPUs=2 -RAM=4G -TPM=no -VSock=yes -KVM=yes -KernelCommandLineExtra= - systemd.log_level=debug,console:info - systemd.log_ratelimit_kmsg=0 - # Disable the kernel's ratelimiting on userspace logging to kmsg. - printk.devkmsg=on - systemd.early_core_pattern=/core - systemd.firstboot=no - raid=noautodetect - psi=1 diff --git a/mkosi.conf.d/10-centos.conf b/mkosi.conf.d/10-centos.conf deleted file mode 100644 index af5f579..0000000 --- a/mkosi.conf.d/10-centos.conf +++ /dev/null @@ -1,15 +0,0 @@ -[Match] -Distribution=centos - -[Distribution] -Mirror=https://mirror.stream.centos.org/ -Release=10 - -[Build] -ToolsTreeDistribution=centos -ToolsTreeRelease=%r -ToolsTreeRepositories=hyperscale-packages-main -Environment=EPEL_MIRROR=https://dl.fedoraproject.org/pub - -[Content] -Packages=centos-release-hyperscale diff --git a/mkosi.conf.d/10-fedora.conf b/mkosi.conf.d/10-fedora.conf deleted file mode 100644 index d6b2c8e..0000000 --- a/mkosi.conf.d/10-fedora.conf +++ /dev/null @@ -1,6 +0,0 @@ -[Match] -Distribution=fedora - -[Distribution] -Release=rawhide -Mirror=https://dl.fedoraproject.org/pub/fedora diff --git a/mkosi.conf.d/20-extra-packages.conf b/mkosi.conf.d/20-extra-packages.conf deleted file mode 100644 index c2b9002..0000000 --- a/mkosi.conf.d/20-extra-packages.conf +++ /dev/null @@ -1,10 +0,0 @@ -[Match] -Distribution=|fedora -Profiles=|hyperscale - -[Content] -VolatilePackages= - systemd-networkd - systemd-networkd-defaults - systemd-oomd-defaults - systemd-ukify diff --git a/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot b/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot deleted file mode 100755 index 867841e..0000000 --- a/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -env --chdir=selinux-policy \ - rpmbuild \ - -bb \ - --build-in-place \ - $( ((WITH_TESTS)) || echo "--nocheck") \ - $( ((WITH_DOCS)) || echo "--without=docs") \ - --define "_topdir /var/tmp" \ - --define "_sourcedir $PWD/selinux-policy/rpm" \ - --define "_rpmdir $PACKAGEDIR" \ - --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ - --define "_binary_payload w.ufdio" \ - --define "debug_package %{nil}" \ - --noclean \ - rpm/selinux-policy.spec diff --git a/mkosi.conf.d/30-selinux-policy/mkosi.conf b/mkosi.conf.d/30-selinux-policy/mkosi.conf deleted file mode 100644 index ff14b27..0000000 --- a/mkosi.conf.d/30-selinux-policy/mkosi.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Match] -BuildSources=selinux-policy -BuildSources=selinux-policy/rpm diff --git a/mkosi.conf.d/30-selinux-policy/mkosi.prepare b/mkosi.conf.d/30-selinux-policy/mkosi.prepare deleted file mode 100755 index 53c972a..0000000 --- a/mkosi.conf.d/30-selinux-policy/mkosi.prepare +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -if [[ "$1" == "build" ]]; then - exit 0 -fi - -mkosi-chroot \ - env --chdir=selinux-policy \ - rpmspec \ - --query \ - --buildrequires \ - --define "_topdir /var/tmp" \ - --define "_sourcedir $PWD/selinux-policy/rpm" \ - rpm/selinux-policy.spec | - grep --invert-match --regexp /bin/sh --regexp "rpmlib(" | - sort --unique | - tee /tmp/buildrequires | - xargs --delimiter '\n' mkosi-install diff --git a/mkosi.postinst b/mkosi.postinst deleted file mode 100755 index d23a6a1..0000000 --- a/mkosi.postinst +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -SYSTEMD_ESP_PATH=/efi SYSTEMD_XBOOTLDR_PATH=/boot bootctl --root="$BUILDROOT" install diff --git a/mkosi.profiles/hyperscale.conf b/mkosi.profiles/hyperscale.conf deleted file mode 100644 index eb4742f..0000000 --- a/mkosi.profiles/hyperscale.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Distribution] -Repositories= - hyperscale-packages-main diff --git a/mkosi.repart/00-esp.conf b/mkosi.repart/00-esp.conf deleted file mode 100644 index 99322ec..0000000 --- a/mkosi.repart/00-esp.conf +++ /dev/null @@ -1,7 +0,0 @@ -[Partition] -Type=esp -Format=vfat -CopyFiles=/boot:/ -CopyFiles=/efi:/ -SizeMinBytes=1G -SizeMaxBytes=1G diff --git a/mkosi.repart/10-root.conf b/mkosi.repart/10-root.conf deleted file mode 100644 index 041b5d2..0000000 --- a/mkosi.repart/10-root.conf +++ /dev/null @@ -1,6 +0,0 @@ -[Partition] -Type=root -Format=ext4 -CopyFiles=/ -SizeMinBytes=8G -SizeMaxBytes=8G diff --git a/mkosi/mkosi.conf b/mkosi/mkosi.conf new file mode 100644 index 0000000..d8b44d1 --- /dev/null +++ b/mkosi/mkosi.conf @@ -0,0 +1,117 @@ +[Config] +MinimumVersion=25~devel + +[Distribution] +Distribution=centos + +[Output] +OutputDirectory=mkosi.output + +[Content] +Bootable=no +Autologin=yes + +Packages= + acl + attr + bash-completion + binutils + bpftrace + coreutils + curl + diffutils + dnf + findutils + gdb + git-core + grep + gzip + iproute + iproute-tc + iputils + jq + kbd + kmod + less + man + man-db + nano + nftables + nmap-ncat + openssh-clients + openssh-server + openssl + p11-kit + pam + passwd + pciutils + perf + policycoreutils + polkit + procps-ng + python3 + rpm + rpm-build + rsync + sed + setools-console + socat + strace + stress-ng + tar + tmux + tree + util-linux + valgrind + vim-common + which + zsh + zstd + NetworkManager + +VolatilePackages= + kernel-core + selinux-policy + selinux-policy-targeted + systemd + systemd-boot + systemd-container + systemd-devel + systemd-journal-remote + systemd-libs + systemd-pam + systemd-resolved + systemd-udev + +InitrdVolatilePackages= + systemd + systemd-libs + systemd-udev + +SELinuxRelabel=yes + +[Build] +ToolsTree=default +BuildDirectory=mkosi.builddir +CacheDirectory=mkosi.cache +Incremental=yes +BuildSources=. +BuildSourcesEphemeral=yes + +[Runtime] +RuntimeBuildSources=yes +RuntimeScratch=no +CPUs=2 +RAM=4G +TPM=no +VSock=yes +KVM=yes +KernelCommandLineExtra= + systemd.log_level=debug,console:info + systemd.log_ratelimit_kmsg=0 + # Disable the kernel's ratelimiting on userspace logging to kmsg. + printk.devkmsg=on + systemd.early_core_pattern=/core + systemd.firstboot=no + raid=noautodetect + psi=1 diff --git a/mkosi/mkosi.conf.d/10-centos.conf b/mkosi/mkosi.conf.d/10-centos.conf new file mode 100644 index 0000000..af5f579 --- /dev/null +++ b/mkosi/mkosi.conf.d/10-centos.conf @@ -0,0 +1,15 @@ +[Match] +Distribution=centos + +[Distribution] +Mirror=https://mirror.stream.centos.org/ +Release=10 + +[Build] +ToolsTreeDistribution=centos +ToolsTreeRelease=%r +ToolsTreeRepositories=hyperscale-packages-main +Environment=EPEL_MIRROR=https://dl.fedoraproject.org/pub + +[Content] +Packages=centos-release-hyperscale diff --git a/mkosi/mkosi.conf.d/10-fedora.conf b/mkosi/mkosi.conf.d/10-fedora.conf new file mode 100644 index 0000000..d6b2c8e --- /dev/null +++ b/mkosi/mkosi.conf.d/10-fedora.conf @@ -0,0 +1,6 @@ +[Match] +Distribution=fedora + +[Distribution] +Release=rawhide +Mirror=https://dl.fedoraproject.org/pub/fedora diff --git a/mkosi/mkosi.conf.d/20-extra-packages.conf b/mkosi/mkosi.conf.d/20-extra-packages.conf new file mode 100644 index 0000000..c2b9002 --- /dev/null +++ b/mkosi/mkosi.conf.d/20-extra-packages.conf @@ -0,0 +1,10 @@ +[Match] +Distribution=|fedora +Profiles=|hyperscale + +[Content] +VolatilePackages= + systemd-networkd + systemd-networkd-defaults + systemd-oomd-defaults + systemd-ukify diff --git a/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot new file mode 100755 index 0000000..867841e --- /dev/null +++ b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.build.chroot @@ -0,0 +1,18 @@ +#!/bin/bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -e + +env --chdir=selinux-policy \ + rpmbuild \ + -bb \ + --build-in-place \ + $( ((WITH_TESTS)) || echo "--nocheck") \ + $( ((WITH_DOCS)) || echo "--without=docs") \ + --define "_topdir /var/tmp" \ + --define "_sourcedir $PWD/selinux-policy/rpm" \ + --define "_rpmdir $PACKAGEDIR" \ + --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ + --define "_binary_payload w.ufdio" \ + --define "debug_package %{nil}" \ + --noclean \ + rpm/selinux-policy.spec diff --git a/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.conf b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.conf new file mode 100644 index 0000000..ff14b27 --- /dev/null +++ b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.conf @@ -0,0 +1,3 @@ +[Match] +BuildSources=selinux-policy +BuildSources=selinux-policy/rpm diff --git a/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.prepare b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.prepare new file mode 100755 index 0000000..53c972a --- /dev/null +++ b/mkosi/mkosi.conf.d/30-selinux-policy/mkosi.prepare @@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -e + +if [[ "$1" == "build" ]]; then + exit 0 +fi + +mkosi-chroot \ + env --chdir=selinux-policy \ + rpmspec \ + --query \ + --buildrequires \ + --define "_topdir /var/tmp" \ + --define "_sourcedir $PWD/selinux-policy/rpm" \ + rpm/selinux-policy.spec | + grep --invert-match --regexp /bin/sh --regexp "rpmlib(" | + sort --unique | + tee /tmp/buildrequires | + xargs --delimiter '\n' mkosi-install diff --git a/mkosi/mkosi.postinst b/mkosi/mkosi.postinst new file mode 100755 index 0000000..d23a6a1 --- /dev/null +++ b/mkosi/mkosi.postinst @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +SYSTEMD_ESP_PATH=/efi SYSTEMD_XBOOTLDR_PATH=/boot bootctl --root="$BUILDROOT" install diff --git a/mkosi/mkosi.profiles/hyperscale.conf b/mkosi/mkosi.profiles/hyperscale.conf new file mode 100644 index 0000000..eb4742f --- /dev/null +++ b/mkosi/mkosi.profiles/hyperscale.conf @@ -0,0 +1,3 @@ +[Distribution] +Repositories= + hyperscale-packages-main diff --git a/mkosi/mkosi.repart/00-esp.conf b/mkosi/mkosi.repart/00-esp.conf new file mode 100644 index 0000000..99322ec --- /dev/null +++ b/mkosi/mkosi.repart/00-esp.conf @@ -0,0 +1,7 @@ +[Partition] +Type=esp +Format=vfat +CopyFiles=/boot:/ +CopyFiles=/efi:/ +SizeMinBytes=1G +SizeMaxBytes=1G diff --git a/mkosi/mkosi.repart/10-root.conf b/mkosi/mkosi.repart/10-root.conf new file mode 100644 index 0000000..041b5d2 --- /dev/null +++ b/mkosi/mkosi.repart/10-root.conf @@ -0,0 +1,6 @@ +[Partition] +Type=root +Format=ext4 +CopyFiles=/ +SizeMinBytes=8G +SizeMaxBytes=8G