tree: import changes from testing-devel at 985f630fd7

This commit is contained in:
CoreOS Bot 2026-10-30 23:43:41 +00:00
parent b40355298b
commit ac2640307a
2 changed files with 22 additions and 10 deletions

View file

@ -11,6 +11,7 @@ set -euo pipefail
bootmnt=/mnt/boot_partition
bootdev=/dev/disk/by-label/boot
boot_firstboot_network_dir="${bootmnt}/coreos-firstboot-network"
deliberate_sentinel="${boot_firstboot_network_dir}.deliberate"
initramfs_network_dir="/run/NetworkManager/system-connections/"
if [ ! -b "${bootdev}" ]; then
@ -31,20 +32,31 @@ warn() {
if [ -n "$(ls -A "${boot_firstboot_network_dir}" 2>/dev/null)" ]; then
warn "warning: found legacy firstboot network config in ${boot_firstboot_network_dir}"
warn "warning: an older coreos-installer placed network config in /boot instead of the initramfs"
# Check for the deliberate sentinel file. When present, the /boot
# placement was intentional (e.g. assisted-installer iSCSI flow) and
# we should not flag it as a misplaced config. This is a temporary
# workaround until a final solution for image replacement is in place.
# See https://github.com/openshift/assisted-installer/pull/2501
if [ -f "${deliberate_sentinel}" ]; then
warn "info: sentinel coreos-firstboot-network.deliberate found; /boot placement was intentional"
else
warn "warning: an older coreos-installer placed network config in /boot instead of the initramfs"
warn "warning: use an updated coreos-installer for furture installs"
fi
warn "warning: rescuing config — copying to ${initramfs_network_dir}"
warn "warning: re-install using an updated coreos-installer to avoid this in the future"
# Clear any configs auto-generated by nm-initrd-generator from
# kernel command line args so the --copy-network config takes priority.
rm -vf ${initramfs_network_dir}/*
mkdir -p ${initramfs_network_dir}
cp -v "${boot_firstboot_network_dir}"/* ${initramfs_network_dir}/
# Drop a flag so coreos-warn-misplaced-network.service on the
# real system can detect that legacy config was rescued and show
# a persistent MOTD warning. /run survives pivot_root into the
# real rootfs but /etc from the initramfs does not.
mkdir -p /run/coreos
touch /run/coreos/legacy-network-rescued
if [ ! -f "${deliberate_sentinel}" ]; then
# Drop a flag so coreos-warn-misplaced-network.service on the
# real system can detect that legacy config was rescued and show
# a persistent MOTD warning. /run survives pivot_root into the
# real rootfs but /etc from the initramfs does not.
mkdir -p /run/coreos
touch /run/coreos/legacy-network-rescued
fi
else
echo "info: no legacy network config in ${boot_firstboot_network_dir}; skipping"
fi

View file

@ -16,8 +16,8 @@ version of coreos-installer. The configuration was automatically
rescued and applied, but this compatibility workaround will be
removed in a future release.
ACTION REQUIRED: Re-install using an updated coreos-installer that
embeds network config in the initramfs instead of /boot.
Future deployments should use an updated coreos-installer to embed network
configurations into the initramfs rather than /boot.
See https://docs.fedoraproject.org/en-US/fedora-coreos/faq/#_why_am_i_getting_a_warning_about_misplaced_firstboot_network_configuration