2019-01-18 10:21:06 +01:00
|
|
|
#
|
|
|
|
# spec file for package ignition
|
|
|
|
#
|
2022-03-04 16:13:47 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2019-01-18 10:21:06 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-07-25 14:02:53 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2019-01-18 10:21:06 +01:00
|
|
|
|
|
|
|
Name: ignition
|
2022-06-09 18:46:15 +02:00
|
|
|
Version: 2.14.0
|
2019-01-18 10:21:06 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: First boot installer and configuration tool
|
|
|
|
License: Apache-2.0
|
2019-07-25 14:02:53 +02:00
|
|
|
Group: System/Management
|
2019-01-18 10:21:06 +01:00
|
|
|
URL: https://github.com/coreos/ignition
|
|
|
|
Source: %{name}-%{version}.tar.xz
|
2020-08-10 11:28:19 +02:00
|
|
|
Source1: ignition-mount-initrd-fstab.service
|
2022-04-06 19:10:21 +02:00
|
|
|
Source2: ignition-umount-initrd-fstab.service
|
2020-08-10 11:28:19 +02:00
|
|
|
Source3: ignition-suse-generator
|
|
|
|
Source4: module-setup.sh
|
|
|
|
Source5: 02_ignition_firstboot
|
2021-08-09 17:33:18 +02:00
|
|
|
Source6: ignition-firstboot-complete.service
|
2020-08-10 11:28:19 +02:00
|
|
|
Source7: README.SUSE
|
2021-08-09 17:33:18 +02:00
|
|
|
Source8: ignition-setup-user.sh
|
|
|
|
Source9: ignition-setup-user.service
|
|
|
|
Source10: ignition-enable-network.service
|
|
|
|
Source11: ignition-enable-network.sh
|
|
|
|
Source12: ignition-kargs-helper
|
2022-03-16 17:27:02 +01:00
|
|
|
Source13: ignition-remove-reconfig_system.service
|
2022-03-25 16:23:52 +01:00
|
|
|
Source14: ignition-touch-selinux-autorelabel.conf
|
2022-06-09 18:46:15 +02:00
|
|
|
Source15: ignition-rmcfg-suse.conf
|
2020-08-10 11:28:19 +02:00
|
|
|
Source20: ignition-userconfig-timeout.conf
|
|
|
|
Source21: ignition-userconfig-timeout-arm.conf
|
2020-01-14 18:10:41 +01:00
|
|
|
Patch2: 0002-allow-multiple-mounts-of-same-device.patch
|
2020-08-19 09:03:21 +02:00
|
|
|
BuildRequires: dracut
|
|
|
|
BuildRequires: libblkid-devel
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
BuildRequires: update-bootloader-rpm-macros
|
2021-08-09 17:33:18 +02:00
|
|
|
BuildRequires: golang(API) >= 1.15
|
2020-08-10 11:28:19 +02:00
|
|
|
Requires: %{name}-dracut-grub2
|
2019-06-06 14:15:28 +02:00
|
|
|
Requires: dracut
|
2020-08-19 09:03:21 +02:00
|
|
|
Recommends: %{_sbindir}/groupadd
|
|
|
|
Recommends: %{_sbindir}/sgdisk
|
|
|
|
Recommends: %{_sbindir}/useradd
|
|
|
|
Recommends: %{_sbindir}/usermod
|
2020-03-24 09:38:15 +01:00
|
|
|
Recommends: /sbin/mkfs.btrfs
|
|
|
|
Recommends: /sbin/mkfs.ext4
|
|
|
|
Recommends: /sbin/mkfs.vfat
|
|
|
|
Recommends: /sbin/mkfs.xfs
|
|
|
|
Recommends: /sbin/mkswap
|
|
|
|
Recommends: /sbin/udevadm
|
|
|
|
Suggests: /sbin/mdadm
|
2020-08-19 09:03:21 +02:00
|
|
|
Provides: ignition-dracut = 0.0+git20200722.98ed51d
|
|
|
|
Obsoletes: ignition-dracut < 0.0+git20200722.98ed51d
|
2020-08-10 11:28:19 +02:00
|
|
|
%{update_bootloader_requires}
|
2019-01-18 10:21:06 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Ignition is an utility to manipulate disks and configuration files
|
|
|
|
during the initramfs. This includes partitioning disks, formatting
|
|
|
|
partitions, writing files (regular files, systemd units, etc.), and
|
|
|
|
creating users.
|
|
|
|
On first boot, Ignition reads its configuration from a source of truth
|
|
|
|
(remote URL, network metadata service, hypervisor bridge, etc.) and
|
|
|
|
applies the configuration.
|
|
|
|
|
2020-08-10 11:28:19 +02:00
|
|
|
%package dracut-grub2
|
|
|
|
Summary: Files to trigger ignition firstboot with grub2
|
|
|
|
Group: System/Management
|
|
|
|
Requires: grub2
|
|
|
|
Requires(post): grub2
|
|
|
|
Requires(post): sed
|
|
|
|
|
|
|
|
%description dracut-grub2
|
|
|
|
GRUB2 configuration which sets ignition.firstboot based on
|
|
|
|
/boot/writable/firstboot_happened and ignition.firstboot and a matching service
|
|
|
|
which creates firstboot_happened after the first boot.
|
|
|
|
|
2019-01-18 10:21:06 +01:00
|
|
|
%prep
|
2022-03-16 17:27:02 +01:00
|
|
|
%autosetup -p1
|
2019-01-18 10:21:06 +01:00
|
|
|
|
2022-06-09 18:46:15 +02:00
|
|
|
mkdir -p dracut/30ignition-microos grub systemd_suse/ignition-delete-config.service.d
|
2021-08-09 17:33:18 +02:00
|
|
|
chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE12}
|
2022-04-06 19:10:21 +02:00
|
|
|
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE13} %{SOURCE14} dracut/30ignition-microos/
|
2020-08-10 11:28:19 +02:00
|
|
|
%ifarch aarch64 %{arm}
|
|
|
|
cp %{SOURCE21} dracut/30ignition-microos/ignition-userconfig-timeout.conf
|
|
|
|
%else
|
|
|
|
cp %{SOURCE20} dracut/30ignition-microos/ignition-userconfig-timeout.conf
|
|
|
|
%endif
|
|
|
|
cp %{SOURCE5} grub/
|
|
|
|
cp %{SOURCE6} systemd_suse/
|
2022-06-09 18:46:15 +02:00
|
|
|
cp %{SOURCE15} systemd_suse/ignition-delete-config.service.d/
|
2020-08-10 11:28:19 +02:00
|
|
|
cp %{SOURCE7} .
|
2021-08-09 17:33:18 +02:00
|
|
|
cp %{SOURCE12} dracut/30ignition/ignition-kargs-helper.sh
|
2020-08-10 11:28:19 +02:00
|
|
|
|
2019-01-18 10:21:06 +01:00
|
|
|
%build
|
2019-06-06 15:38:00 +02:00
|
|
|
sed -i -e 's|go build -ldflags|go build -buildmode=pie -ldflags|g' build
|
2020-01-21 18:55:37 +01:00
|
|
|
env VERSION=%{version} GLDFLAGS='-X github.com/coreos/ignition/v2/internal/distro.selinuxRelabel=false -X github.com/coreos/ignition/v2/internal/distro.writeAuthorizedKeysFragment=false ' bash -x ./build
|
2019-01-18 10:21:06 +01:00
|
|
|
|
|
|
|
%install
|
2020-08-19 09:03:21 +02:00
|
|
|
make -o all install DESTDIR=%{buildroot}
|
2020-08-10 11:28:19 +02:00
|
|
|
|
|
|
|
install -d %{buildroot}%{_sysconfdir}/grub.d
|
2021-08-09 17:33:18 +02:00
|
|
|
install -d %{buildroot}%{_prefix}/lib/systemd/system
|
2022-06-09 18:46:15 +02:00
|
|
|
install -d %{buildroot}%{_prefix}/lib/systemd/system/ignition-delete-config.service.d
|
2020-08-10 11:28:19 +02:00
|
|
|
install -p -m 0755 grub/* %{buildroot}%{_sysconfdir}/grub.d/
|
2022-06-09 18:46:15 +02:00
|
|
|
install -p -m 0644 systemd_suse/*.service %{buildroot}%{_prefix}/lib/systemd/system/
|
|
|
|
install -p -m 0644 systemd_suse/ignition-delete-config.service.d/* %{buildroot}%{_prefix}/lib/systemd/system/ignition-delete-config.service.d
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre ignition-delete-config.service
|
2020-08-10 11:28:19 +02:00
|
|
|
|
|
|
|
%post
|
|
|
|
%{?regenerate_initrd_post}
|
|
|
|
# Trigger creating the firstboot_happened file (in posttrans) on upgrades.
|
|
|
|
# This is needed for systems where the first boot happened before
|
|
|
|
# firstboot_happened got introduced and can be removed in the future.
|
|
|
|
if [ "$1" -ne 1 ]; then
|
|
|
|
mkdir -p %{_rundir}/ignition-dracut/
|
|
|
|
touch %{_rundir}/ignition-dracut/isupgrade
|
|
|
|
fi
|
2022-06-09 18:46:15 +02:00
|
|
|
%service_add_post ignition-delete-config.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun ignition-delete-config.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun_without_restart ignition-delete-config.service
|
2020-08-10 11:28:19 +02:00
|
|
|
|
|
|
|
%posttrans
|
|
|
|
%{?regenerate_initrd_posttrans}
|
|
|
|
if [ -f %{_rundir}/ignition-dracut/isupgrade ]; then
|
|
|
|
# Done in posttrans so that read-only-root-fs could create the subvol
|
|
|
|
mkdir -p /boot/writable
|
|
|
|
[ -e /boot/writable/firstboot_happened ] || touch /boot/writable/firstboot_happened
|
|
|
|
fi
|
|
|
|
|
|
|
|
%pre dracut-grub2
|
|
|
|
%service_add_pre ignition-firstboot-complete.service
|
|
|
|
|
|
|
|
%post dracut-grub2
|
|
|
|
if [ "$1" = 1 ] ; then
|
|
|
|
sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT="\)\(.*\)/\1\\$ignition_firstboot \2/' %{_sysconfdir}/default/grub
|
|
|
|
%{?update_bootloader_refresh_post}
|
|
|
|
fi
|
|
|
|
%service_add_post ignition-firstboot-complete.service
|
|
|
|
|
|
|
|
%preun dracut-grub2
|
|
|
|
%service_del_preun ignition-firstboot-complete.service
|
|
|
|
|
|
|
|
%postun dracut-grub2
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
sed -i -E '/^GRUB_CMDLINE_LINUX_DEFAULT="/s/(\\\$)?ignition[._][^[:space:]"]+ ?//g' %{_sysconfdir}/default/grub
|
|
|
|
fi
|
2021-04-01 10:36:34 +02:00
|
|
|
%service_del_postun_without_restart ignition-firstboot-complete.service
|
2019-01-18 10:21:06 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
2022-04-04 19:25:05 +02:00
|
|
|
%doc README.md README.SUSE docs/*.md
|
2022-06-09 18:46:15 +02:00
|
|
|
# Paths are hardcoded in the Makefile
|
|
|
|
/usr/lib/dracut/modules.d/30ignition
|
|
|
|
/usr/lib/dracut/modules.d/30ignition-microos
|
|
|
|
/usr/bin/ignition-validate
|
|
|
|
/usr/libexec/ignition-rmcfg
|
|
|
|
/usr/lib/systemd/system/ignition-delete-config.service
|
|
|
|
%dir %{_unitdir}/ignition-delete-config.service.d
|
|
|
|
%{_unitdir}/ignition-delete-config.service.d/ignition-rmcfg-suse.conf
|
2019-01-18 10:21:06 +01:00
|
|
|
|
2020-08-10 11:28:19 +02:00
|
|
|
%files dracut-grub2
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.SUSE
|
|
|
|
%{_sysconfdir}/grub.d/02_ignition_firstboot
|
|
|
|
%{_prefix}/lib/systemd/system/ignition-firstboot-complete.service
|
|
|
|
|
2019-01-18 10:21:06 +01:00
|
|
|
%changelog
|