Skip to content

Commit

Permalink
coreos-copy-firstboot-network.sh: Place stamp file if copied
Browse files Browse the repository at this point in the history
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 #659
  • Loading branch information
kelvinfan001 committed Nov 23, 2020
1 parent 3ae8724 commit 277f841
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 277f841

Please sign in to comment.