From 9df08be38ee2f38bab2b5f928c12465a5501cc85 Mon Sep 17 00:00:00 2001 From: Kelvin Fan Date: Thu, 19 Nov 2020 17:50:14 -0500 Subject: [PATCH] coreos-copy-firstboot-network.sh: Place stamp file if copied We would like to mount `/boot` read-only in the real root, so remove the current 15-coreos-firstboot-network.conf since it would not work once `/boot` is mounted ro. Drop a stamp file instead so that `coreos-boot-edit.service` would notice and perform the clean up later in the initramfs. xref https://github.com/coreos/fedora-coreos-config/pull/659 --- .../15coreos-network/coreos-copy-firstboot-network.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-copy-firstboot-network.sh b/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-copy-firstboot-network.sh index 072dc7b487..ad24af2caf 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-copy-firstboot-network.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-copy-firstboot-network.sh @@ -26,10 +26,9 @@ if [ -n "$(ls -A ${initramfs_firstboot_network_dir} 2>/dev/null)" ]; then echo "info: copying files from ${initramfs_firstboot_network_dir} to ${initramfs_network_dir}" mkdir -p ${initramfs_network_dir} cp -v ${initramfs_firstboot_network_dir}/* ${initramfs_network_dir}/ - # If we make it to the realroot (successfully ran ignition) then - # clean up the files in the firstboot network dir - echo "R ${realroot_firstboot_network_dir} - - - - -" > \ - /run/tmpfiles.d/15-coreos-firstboot-network.conf + # Drop stamp file in /run to indicate that there are firstboot networking + # configuration files in /boot that should be cleaned up after Ignition. + touch /run/coreos-copy-firstboot-network.stamp else echo "info: no files to copy from ${initramfs_firstboot_network_dir}. skipping" fi