Hello community,

here is the log from the commit of package ignition-dracut for openSUSE:Factory 
checked in at 2020-06-29 21:18:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ignition-dracut (Old)
 and      /work/SRC/openSUSE:Factory/.ignition-dracut.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ignition-dracut"

Mon Jun 29 21:18:34 2020 rev:13 rq:817733 version:0.0+git20200504.7ff38d9

Changes:
--------
--- /work/SRC/openSUSE:Factory/ignition-dracut/ignition-dracut.changes  
2020-05-11 13:45:22.025630461 +0200
+++ 
/work/SRC/openSUSE:Factory/.ignition-dracut.new.3060/ignition-dracut.changes    
    2020-06-29 21:19:02.333909046 +0200
@@ -1,0 +2,10 @@
+Fri Jun 19 11:54:02 UTC 2020 - Fabian Vogt <[email protected]>
+
+- Split ignition.firstboot handling into a subpackage which does
+  not depend on ignition
+- Change mechanism to create /boot/writable/firstboot_happened to
+  signal that the first boot happened. This avoids having to track
+  package upgrades (for compatibility)
+- Clean up spec file a bit, add ignition-dracut-rpmlintrc
+
+-------------------------------------------------------------------

New:
----
  ignition-dracut-rpmlintrc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ignition-dracut.spec ++++++
--- /var/tmp/diff_new_pack.44bYL2/_old  2020-06-29 21:19:02.985911063 +0200
+++ /var/tmp/diff_new_pack.44bYL2/_new  2020-06-29 21:19:02.985911063 +0200
@@ -25,6 +25,7 @@
 URL:            https://github.com/dustymabe/ignition-dracut
 Source:         %{name}-%{version}.tar.xz
 Source1:        ignition-mount-initrd-fstab.service
+Source2:        ignition-dracut-rpmlintrc
 Source3:        ignition-suse-generator
 Source4:        module-setup.sh
 Source5:        02_ignition_firstboot
@@ -35,11 +36,9 @@
 Source20:       ignition-userconfig-timeout.conf
 Source21:       ignition-userconfig-timeout-arm.conf
 Patch3:         0003-Disable-resetting-UUID.patch
-BuildRequires:  suse-module-tools
+BuildRequires:  systemd-rpm-macros
 BuildRequires:  update-bootloader-rpm-macros
-PreReq:         sed
-PreReq:         grub2
-PreReq:         virt-what
+Requires:       %{name}-grub2
 Requires:       gptfdisk
 Requires:       ignition
 %{update_bootloader_requires}
@@ -53,9 +52,22 @@
 the configuration.
 This package contains the dracut scripts for this.
 
+%package grub2
+Summary:        Files to trigger ignition firstboot with grub2
+Group:          System/Management
+Requires:       grub2
+Requires(post): grub2
+Requires(post): sed
+Requires(post): virt-what
+
+%description 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.
+
 %prep
-%setup -q
-%patch3 -p1
+%autosetup -p1
+
 mkdir dracut/30ignition-microos grub
 chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8}
 cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} 
dracut/30ignition-microos/
@@ -80,19 +92,28 @@
 install -p -m 0644 systemd/*.service %{buildroot}%{_prefix}/lib/systemd/system/
 install -p -m 0644 systemd/*.conf 
%{buildroot}%{_prefix}/lib/systemd/system/ignition-firstboot-complete.service.d/
 
-%files
-%license LICENSE
-%doc README.SUSE
-%{_sysconfdir}/grub.d
-%{_prefix}/lib/dracut
-%{_prefix}/lib/systemd/system/*
-%config %{_sysconfdir}/grub.d/02_ignition_firstboot
+%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
+
+%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
+%pre grub2
 %service_add_pre ignition-firstboot-complete.service
 
-%post
-%{?regenerate_initrd_post}
+%post grub2
 if [ "$1" = 1 ] ; then
     platform="$(virt-what)"
     case "${platform}" in
@@ -103,28 +124,37 @@
     esac
     sed -i 
's/^\(GRUB_CMDLINE_LINUX_DEFAULT="\)\(.*\)/\1ignition.platform.id='${platform}' 
\\$ignition_firstboot \2/' %{_sysconfdir}/default/grub
     %{?update_bootloader_refresh_post}
-    # Trigger setting firstboot flag (in posttrans) only on new installations
-    mkdir -p %{_rundir}/ignition-dracut/
-    touch %{_rundir}/ignition-dracut/newinstall
 fi
 %service_add_post ignition-firstboot-complete.service
 
-%preun
+%preun grub2
 %service_del_preun ignition-firstboot-complete.service
 
-%postun
+%postun grub2
 if [ "$1" = 0 ] ; then
     sed -i -E 
'/^GRUB_CMDLINE_LINUX_DEFAULT="/s/(\\\$)?ignition[._][^[:space:]"]+ ?//g' 
%{_sysconfdir}/default/grub
-    rm -f /boot/writable/ignition.firstboot
 fi
 %service_del_postun -n ignition-firstboot-complete.service
 
-%posttrans
-%{?regenerate_initrd_posttrans}
-if test -f %{_rundir}/ignition-dracut/newinstall; then
-    %{?update_bootloader_posttrans}
-    mkdir -p /boot/writable
-    touch /boot/writable/ignition.firstboot
-fi
+%posttrans grub2
+%{?update_bootloader_posttrans}
+
+%files
+%license LICENSE
+%doc README.SUSE
+%dir %{_prefix}/lib/dracut/
+%dir %{_prefix}/lib/dracut/modules.d/
+%{_prefix}/lib/dracut/modules.d/99journald-conf/
+%{_prefix}/lib/dracut/modules.d/99emergency-timeout/
+%{_prefix}/lib/dracut/modules.d/30ignition/
+%{_prefix}/lib/dracut/modules.d/30ignition-microos/
+
+%files grub2
+%license LICENSE
+%doc README.SUSE
+%dir %{_sysconfdir}/grub.d/
+%{_sysconfdir}/grub.d/02_ignition_firstboot
+/usr/lib/systemd/system/ignition-firstboot-complete.service
+/usr/lib/systemd/system/ignition-firstboot-complete.service.d/
 
 %changelog

++++++ 02_ignition_firstboot ++++++
--- /var/tmp/diff_new_pack.44bYL2/_old  2020-06-29 21:19:03.017911162 +0200
+++ /var/tmp/diff_new_pack.44bYL2/_new  2020-06-29 21:19:03.017911162 +0200
@@ -7,7 +7,7 @@
 # Determine if this is a first boot and set the variable
 # to be used later on the kernel command line.
 set ignition_firstboot=""
-if [ -f "${flagpath}/ignition.firstboot" ]; then
+if ! [ -f "${flagpath}/firstboot_happened" ]; then
     # default to dhcp networking parameters to be used with ignition 
     set ignition_network_kcmdline='rd.neednet=1 ip=dhcp'
 
@@ -16,7 +16,9 @@
     # This override feature is primarily used by coreos-installer to
     # persist static networking config provided during install to the    
     # first boot of the machine.
-    source "${flagpath}/ignition.firstboot"
+    if [ -e "${flagpath}/ignition.firstboot" ]; then
+        source "${flagpath}/ignition.firstboot"
+    fi
     
     set ignition_firstboot="ignition.firstboot $ignition_network_kcmdline"
 fi

++++++ README.SUSE ++++++
--- /var/tmp/diff_new_pack.44bYL2/_old  2020-06-29 21:19:03.037911224 +0200
+++ /var/tmp/diff_new_pack.44bYL2/_new  2020-06-29 21:19:03.041911236 +0200
@@ -20,9 +20,9 @@
   (https://github.com/coreos/coreos-assembler/pull/616); it is now used in a
   modified version adapted to SUSE's needs.
   This script will automatically set the kernel parameters to trigger an
-  Ignition run if a flag file is set (e.g. on first boot). To trigger an
-  Ignition run manually just create the file
-  "/boot/writable/ignition.firstboot".
+  Ignition run if a flag file does not exist (e.g. on first boot). To trigger
+  an Ignition run manually just delete the file
+  "/boot/writable/firstboot_happened".
 * 0003-Disable-resetting-UUID.patch / change-ignition-firstboot-path.conf:
   Remove / overwrite CoreOS specific script / path.
 * prevent-boot-cycle.conf:

++++++ change-ignition-firstboot-path.conf ++++++
--- /var/tmp/diff_new_pack.44bYL2/_old  2020-06-29 21:19:03.081911360 +0200
+++ /var/tmp/diff_new_pack.44bYL2/_new  2020-06-29 21:19:03.081911360 +0200
@@ -1,3 +1,3 @@
 [Service]
 ExecStart=
-ExecStart=/usr/bin/rm /boot/writable/ignition.firstboot
+ExecStart=/usr/bin/touch /boot/writable/firstboot_happened

++++++ ignition-dracut-rpmlintrc ++++++
# Not meant to be run manually
addFilter("suse-missing-rclink")
# Content differs based on arch
addFilter("no-binary")

Reply via email to