From c4894461947bcf5b820a31c915a7d56fd9f2301666dcf21344dd93e0caa9d5fc Mon Sep 17 00:00:00 2001 From: Ignaz Forster Date: Wed, 16 Mar 2022 16:27:02 +0000 Subject: [PATCH] Accepting request 962210 from home:favogt:combustion - Remove /var/lib/YaST2/reconfig_system if a config was provided: * ignition-remove-reconfig_system.service OBS-URL: https://build.opensuse.org/request/show/962210 OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=86 --- ignition-remove-reconfig_system.service | 21 +++++++++++++++++++++ ignition.changes | 6 ++++++ ignition.spec | 6 +++--- module-setup.sh | 1 + 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 ignition-remove-reconfig_system.service diff --git a/ignition-remove-reconfig_system.service b/ignition-remove-reconfig_system.service new file mode 100644 index 0000000..a33c48c --- /dev/null +++ b/ignition-remove-reconfig_system.service @@ -0,0 +1,21 @@ +[Unit] +Description=Disable firstboot wizard if ignition ran + +# Make sure ignition completed +After=ignition-complete.target +# Don't race with combustion +After=combustion.service + +# Make sure /sysroot/etc and var are available +After=initrd-parse-etc.service +RequiresMountsFor=/sysroot/etc +RequiresMountsFor=/sysroot/var + +ConditionPathExists=/sysroot/etc/.ignition-result.json +ConditionPathExists=/sysroot/var/lib/YaST2/reconfig_system + +[Service] +Type=oneshot +RemainAfterExit=yes +# Use grep to avoid pulling in jq +ExecStart=/bin/sh -ec 'if grep -q "\\"userConfigProvided\\":.*true" /sysroot/etc/.ignition-result.json; then rm /sysroot/var/lib/YaST2/reconfig_system; fi' diff --git a/ignition.changes b/ignition.changes index a3721ab..6b5f072 100644 --- a/ignition.changes +++ b/ignition.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 4 10:46:21 UTC 2022 - Fabian Vogt + +- Remove /var/lib/YaST2/reconfig_system if a config was provided: + * ignition-remove-reconfig_system.service + ------------------------------------------------------------------- Fri Mar 4 10:23:10 UTC 2022 - Fabian Vogt diff --git a/ignition.spec b/ignition.spec index 48aa93b..6b79ca7 100644 --- a/ignition.spec +++ b/ignition.spec @@ -35,6 +35,7 @@ Source9: ignition-setup-user.service Source10: ignition-enable-network.service Source11: ignition-enable-network.sh Source12: ignition-kargs-helper +Source13: ignition-remove-reconfig_system.service Source20: ignition-userconfig-timeout.conf Source21: ignition-userconfig-timeout-arm.conf Patch2: 0002-allow-multiple-mounts-of-same-device.patch @@ -82,12 +83,11 @@ GRUB2 configuration which sets ignition.firstboot based on which creates firstboot_happened after the first boot. %prep -%setup -q -%patch2 -p1 +%autosetup -p1 mkdir dracut/30ignition-microos grub systemd_suse chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE12} -cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} dracut/30ignition-microos/ +cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE13} dracut/30ignition-microos/ %ifarch aarch64 %{arm} cp %{SOURCE21} dracut/30ignition-microos/ignition-userconfig-timeout.conf %else diff --git a/module-setup.sh b/module-setup.sh index 50680b6..48a44c9 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -30,6 +30,7 @@ install() { inst_script "$moddir/ignition-setup-user.sh" \ "/usr/sbin/ignition-setup-user" inst_multiple awk systemd-detect-virt + install_ignition_unit ignition-remove-reconfig_system.service initrd.target install_ignition_unit ignition-setup-user.service }