|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
Name: mkosi
|
|
Zbigniew Jędrzejewski-Szmek |
9f3936 |
Version: 20.1
|
|
Zbigniew Jędrzejewski-Szmek |
7285cc |
Release: %autorelease
|
|
Zbigniew Jędrzejewski-Szmek |
e83052 |
Summary: Create bespoke OS images
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
License: LGPL-2.1-or-later
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
URL: https://github.com/systemd/mkosi
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
Source: https://github.com/systemd/mkosi/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
BuildArch: noarch
|
|
Zbigniew Jędrzejewski-Szmek |
9faa87 |
BuildRequires: python3-devel
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
BuildRequires: pyproject-rpm-macros
|
|
Zbigniew Jędrzejewski-Szmek |
e83052 |
BuildRequires: python3-pytest
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
BuildRequires: pandoc
|
|
Zbigniew Jędrzejewski-Szmek |
1285a6 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%bcond tests 1
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
# mkosi wants the uncompressed man page to show via 'mkosi documentation'
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%global __brp_compress true
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
|
31c3fa |
Requires: python3
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
Requires: bubblewrap
|
|
|
31c3fa |
Requires: coreutils
|
|
|
31c3fa |
|
|
|
31c3fa |
# for completion
|
|
|
31c3fa |
Recommends: python3dist(argcomplete)
|
|
|
31c3fa |
|
|
|
31c3fa |
# for various image building tools (systemd-hwdb, systemd-sysusers, ...)
|
|
|
31c3fa |
Recommends: systemd
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
# for systemd-nspawn
|
|
|
31c3fa |
Recommends: systemd-container >= 254
|
|
|
31c3fa |
|
|
|
31c3fa |
# for bootable images (systemd-udev ships bootctl)
|
|
|
31c3fa |
Recommends: systemd-udev >= 254
|
|
|
31c3fa |
Recommends: systemd-ukify >= 254
|
|
|
31c3fa |
|
|
|
31c3fa |
# for disk images
|
|
|
31c3fa |
Recommends: systemd-repart >= 254
|
|
|
31c3fa |
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
# for the --acl option to allow removing directories generated by mkosi
|
|
|
31c3fa |
Recommends: acl
|
|
|
31c3fa |
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
# for when kernels are installed and we need to run depmod
|
|
|
31c3fa |
Recommends: kmod
|
|
|
31c3fa |
|
|
|
31c3fa |
# for signing
|
|
|
31c3fa |
Recommends: openssl
|
|
|
31c3fa |
Recommends: sbsigntools
|
|
|
31c3fa |
Recommends: gnupg
|
|
|
31c3fa |
|
|
|
31c3fa |
# for building specific distributions
|
|
|
31c3fa |
Recommends: (dnf5 or dnf)
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
Recommends: apt
|
|
|
31c3fa |
Recommends: debian-keyring
|
|
|
31c3fa |
Recommends: pacman
|
|
|
31c3fa |
Recommends: archlinux-keyring
|
|
|
31c3fa |
Recommends: zypper
|
|
|
31c3fa |
|
|
|
31c3fa |
# for various filesystems
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
Recommends: btrfs-progs
|
|
|
31c3fa |
Recommends: e2fsprogs
|
|
|
31c3fa |
Recommends: dosfstools
|
|
|
31c3fa |
Recommends: mtools
|
|
|
31c3fa |
Recommends: erofs-utils
|
|
|
31c3fa |
Recommends: xfsprogs
|
|
|
31c3fa |
Recommends: squashfs-tools
|
|
|
31c3fa |
|
|
|
31c3fa |
# for various output formats
|
|
Zbigniew Jędrzejewski-Szmek |
1ea278 |
Recommends: cpio
|
|
|
31c3fa |
Recommends: tar
|
|
|
31c3fa |
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
# for mkosi qemu
|
|
|
31c3fa |
Recommends: qemu-kvm-core
|
|
Leif Liddy |
a98095 |
Recommends: edk2-ovmf
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
Recommends: swtpm
|
|
|
31c3fa |
|
|
|
31c3fa |
# for mkosi ssh
|
|
|
31c3fa |
Recommends: openssh-clients
|
|
|
31c3fa |
Recommends: socat
|
|
|
31c3fa |
|
|
Zbigniew Jędrzejewski-Szmek |
a50f94 |
# for output compression
|
|
Leif Liddy |
a98095 |
Recommends: zstd
|
|
|
31c3fa |
Recommends: xz
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%description
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
A fancy wrapper around "dnf --installroot", "apt", "pacman", and "zypper" that
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
generates disk images with a number of bells and whistles.
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
Generated images are tailored to the purpose: GPT partitions,
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
systemd-boot or grub2, images for containers, VMs, initrd, and extensions.
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
Mkosi can boot an image via QEMU or systemd-nspawn, or simply start a shell in
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
chroot, burn the image to a device, connect to a running VM via ssh, extract
|
|
Zbigniew Jędrzejewski-Szmek |
c7169f |
logs and coredumps, and also serve an image over HTTP.
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
a87f24 |
See https://mkosi.systemd.io/ for documentation.
|
|
Zbigniew Jędrzejewski-Szmek |
a87f24 |
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%package initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
Summary: Build initrds locally using mkosi
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
Requires: %{name} = %{version}-%{release}
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
Requires: (dnf5 or dnf)
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%description initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
This package provides the plugin for kernel-install to build initrds with
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
mkosi locally.
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
After the package is installed, the plugin can be enabled by writing
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
'initrd_generator=mkosi-initrd' to '/etc/kernel/install.conf'.
|
|
|
7e0b12 |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%prep
|
|
Zbigniew Jędrzejewski-Szmek |
10a7ce |
%autosetup -p1
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%generate_buildrequires
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%pyproject_buildrequires
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%build
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
tools/make-man-page.sh
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%pyproject_wheel
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%install
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%pyproject_install
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%pyproject_save_files mkosi
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
mkdir -p %{buildroot}%{_mandir}/man1
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
ln -s -t %{buildroot}%{_mandir}/man1/ \
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
../../../..%{python3_sitelib}/mkosi/resources/mkosi.1
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
# Install the kernel-install plugin
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ \
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
kernel-install/50-mkosi.install
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
mkdir -p %{buildroot}%{_prefix}/lib/mkosi-initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
mkdir -p %{buildroot}%{_sysconfdir}/mkosi-initrd
|
|
|
7e0b12 |
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%files -f %pyproject_files
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%license LICENSE
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%doc README.md
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%_bindir/mkosi
|
|
Zbigniew Jędrzejewski-Szmek |
9faa87 |
%_mandir/man1/mkosi.1*
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%files initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%_prefix/lib/kernel/install.d/50-mkosi.install
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%ghost %dir %{_prefix}/lib/mkosi-initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
%ghost %dir %{_sysconfdir}/mkosi-initrd
|
|
Zbigniew Jędrzejewski-Szmek |
1e952a |
|
|
Zbigniew Jędrzejewski-Szmek |
6ded5c |
%check
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%if %{with tests}
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%pytest tests/ -v
|
|
Zbigniew Jędrzejewski-Szmek |
e83052 |
|
|
Zbigniew Jędrzejewski-Szmek |
6ded5c |
# just a smoke test for syntax or import errors
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%py3_test_envvars %{buildroot}%{_bindir}/mkosi --help >/dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
47c1d4 |
%endif
|
|
Zbigniew Jędrzejewski-Szmek |
6ded5c |
|
|
Zbigniew Jędrzejewski-Szmek |
4cdaf1 |
%changelog
|
|
Zbigniew Jędrzejewski-Szmek |
7285cc |
%autochangelog
|