Blob Blame History Raw
# Generated by rust2rpm 13
%define dracutlibdir %{_prefix}/lib/dracut
%bcond_without check
%global __cargo_skip_build 0
# The library is for internal code reuse and is not a public API
%global __cargo_is_lib 0

%global crate coreos-installer

Name:           %{crate}
Version:        0.9.1
Release:        17%{?dist}
Summary:        Installer for Fedora CoreOS and RHEL CoreOS

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            https://github.com/fedora-iot/coreos-installer
Source:         https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
Source1:        https://github.com/coreos/coreos-installer/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz

# The RHEL 8 rust-toolset macros don't let us enable features from the
# %%cargo_* macros.  Enable rdcore directly in Cargo.toml.
Patch0:         enable-rdcore.patch
# LTO causes runtime crashes on s390x
# https://github.com/coreos/coreos-installer/pull/360
# https://github.com/coreos/coreos-installer/issues/372
# https://bugzilla.redhat.com/show_bug.cgi?id=1863466
Patch1:         disable-lto-0.6.0.patch
# Add coreos.force_persist_ip karg forwarding
# https://github.com/coreos/coreos-installer/pull/554
Patch2:         force_persist_ip-0.9.1.patch
# Support s390x DASDs in VMs via virtio
# https://github.com/coreos/coreos-installer/pull/552
Patch3:         s390x-support-virtio-dasd-0.9.1.patch
Patch4:         coidracut.patch
Patch5:         coidracut2.patch
Patch6:         coidracut3.patch
Patch7:         coidracut4.patch
Patch8:         coidracut5.patch

ExclusiveArch:  %{rust_arches}
BuildRequires:  openssl-devel
BuildRequires:  rust-toolset
BuildRequires:  systemd

Requires:       gnupg
Requires:       kpartx
Requires:       systemd-udev
Requires:       util-linux
%ifarch s390x
# This should eventually be spelled "s390utils-core" but the binaries
# haven't been broken out of s390utils-base yet
Requires:       /usr/sbin/chreipl
Requires:       /usr/sbin/dasdfmt
Requires:       /usr/sbin/fdasd
Requires:       /usr/sbin/lszdev
Requires:       /usr/sbin/zipl
%endif

# Since `rust-coreos-installer` creates a `coreos-installer`
# subpackage with a newer version number, which supersedes the
# deprecated `coreos-installer` package (https://src.fedoraproject.org/rpms/coreos-installer),
# an explicit `Obsoletes:` for `coreos-installer` is not necessary.

# Obsolete dracut modules as they are not provided in this package.
Obsoletes:      coreos-installer-dracut < 0.0.1

%global _description %{expand:
coreos-installer installs Fedora CoreOS or RHEL CoreOS to bare-metal
machines (or, occasionally, to virtual machines).
}
%description %{_description}

%files
%license LICENSE
%doc README.md
%{_bindir}/coreos-installer

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep -V 1
# https://github.com/rust-lang-nursery/error-chain/pull/289
find -name '*.rs' -executable -exec chmod a-x {} \;

%build
%cargo_build

%install
%cargo_install
# Install binaries, dracut modules, units, targets, generators for running via systemd
install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore dracut/50rdcore/module-setup.sh
install -D -m 0755 -t %{buildroot}%{_libexecdir} scripts/coreos-installer-service
install -D -m 0755 -t %{buildroot}%{_libexecdir} scripts/coreos-installer-disable-device-auto-activation
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-disable-device-auto-activation.service
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer.service
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-reboot.service
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-noreboot.service
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-pre.target
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer.target
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-post.target
install -D -m 0755 -t %{buildroot}%{_systemdgeneratordir} systemd/coreos-installer-generator
mv %{buildroot}%{_bindir}/rdcore %{buildroot}%{dracutlibdir}/modules.d/50rdcore/
cp -a %{buildroot}%{_bindir}/coreos-installer %{buildroot}%{dracutlibdir}/modules.d/50rdcore/
install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/coreos-installer-service
install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/growfs
install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/coreos-installer-disable-device-auto-activation
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-disable-device-auto-activation.service
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer.service
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/growfs.service
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-reboot.service
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-noreboot.service
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-pre.target
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer.target
install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-post.target
install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-generator

%package     -n %{crate}-bootinfra
Summary:     %{crate} boot-time infrastructure for use on Fedora/RHEL CoreOS
Requires:   %{crate} = %{version}-%{release}

# Package was renamed from coreos-installer-systemd when rdcore was added
Provides:    %{crate}-systemd = %{version}-%{release}
Obsoletes:   %{crate}-systemd <= 0.3.0-2

%description -n %{crate}-bootinfra
This subpackage contains boot-time infrastructure for Fedora CoreOS and
RHEL CoreOS.  It is not needed on other platforms.

%files       -n %{crate}-bootinfra
%{dracutlibdir}/modules.d/*
%{_libexecdir}/*
%{_unitdir}/*
%{_systemdgeneratordir}/*

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Thu Jun 10 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.9.1-3
- Support s390x DASDs in VMs via virtio

* Tue Jun 08 2021 Dusty Mabe <dustymabe@redhat.com> - 0.9.1-2
- Add coreos.force_persist_ip karg forwarding

* Wed Apr 21 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.9.0-3
- Improve error message for busy disk referenced via symlink
- Fix failure on corrupt GPT

* Fri Apr 9 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.9.0-2
- Use macro for dracut library path

* Thu Apr 8 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.9.0-1
- New release

* Fri Jan 15 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.8.0-3
- Fix rdcore rootmap on RAID devices

* Tue Jan 12 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.8.0-2
- Disable LTO again to avoid crashes on s390x

* Tue Jan 12 2021 Sohan Kunkerkar <skunkerk@redhat.com> - 0.8.0-1
- New release

* Mon Jan 04 2021 Benjamin Gilbert <bgilbert@redhat.com> - 0.7.2-2
- Add Requires for programs invoked by coreos-installer
- Require Rust >= 1.45, re-enable LTO

* Thu Oct 22 2020 Sohan Kunkerkar <skunkerk@redhat.com> - 0.7.2-1
- New release

* Mon Sep 21 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.6.0-3
- Fix MBR handling when partition saving is enabled
- Fix base package Obsoletes being interpreted as part of package description

* Wed Sep 02 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.6.0-2
- Disable LTO on s390x to avoid runtime crashes
- Drop legacy installer

* Tue Aug 25 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.6.0-1
- New release

* Fri Jul 31 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.5.0-1
- New release

* Sat Jul 25 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.4.0-1
- New release
- Rename -systemd subpackage to -bootinfra
- Add rdcore Dracut module to -bootinfra

* Wed Jul 22 2020 Benjamin Gilbert <bgilbert@redhat.com> - 0.3.0-1
- New release
- Make coreos-installer-{service,generator} world-readable

* Wed Jun 17 2020 Dusty Mabe <dusty@dustymabe.com> - 0.2.0-4.rhaos4.6
- Include rhaos4.6 in the rpm release field

* Thu May 28 2020 Colin Walters <walters@verbum.org> - 0.2.0-3
- Backport osmet RHCOS+LUKS patches

* Thu May 07 2020 Dusty Mabe <dusty@dustymabe.com> - 0.2.0-2
- Fix bug in dracut hook in legacy installer; see
  https://github.com/coreos/coreos-installer/pull/234

* Mon Apr 27 2020 Colin Walters <walters@verbum.org> - 0.1.3-4
- Merge in legacy installer; see
  https://github.com/coreos/coreos-installer/pull/220

* Mon Mar 23 2020 Colin Walters <walters@verbum.org> - 0.1.3-2
- https://github.com/coreos/coreos-installer/releases/tag/v0.1.3

* Wed Mar 04 2020 Colin Walters <walters@verbum.org> - 0.1.2-11
- Backport no-signatures-available patch

* Wed Feb 26 2020 Colin Walters <walters@verbum.org> - 0.1.2-10
- Forked from Fedora
- I forgot about the weird `rust-` package name prefixing when
  asking RCM to make the dist-git repo, and rather than redo
  that I decided to just go with it.
- Stop depending on systemd-rpm-macros since it's not in RHEL8 apparently
- Drop other things only applicable to Fedora Rust packaging like
  dynamic buildrequires