forked from pool/ignition
8d1e6666f1
- Update to version 2.5.0 * Dropped 0003-Disable-resetting-UUID.patch (upstream moved the functionality into the CoreOS configuration. * Added ignition-enable-network.sh / ignition-enable-network.service: Implemented ignition-fetch-offline feature to only start networking if required - Update to version 2.4.1 - Update to version 2.4.0 OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=49
33 lines
1.0 KiB
Bash
33 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
copy_file_if_exists() {
|
|
src="${1}"; dst="${2}"
|
|
if [ -f "${src}" ]; then
|
|
echo "Copying ${src} to ${dst}"
|
|
cp "${src}" "${dst}"
|
|
else
|
|
echo "File ${src} does not exist.. Skipping copy"
|
|
fi
|
|
}
|
|
|
|
destination=/usr/lib/ignition
|
|
mkdir -p $destination
|
|
|
|
if command -v is-live-image >/dev/null && is-live-image; then
|
|
# Live image. If the user has supplied a config.ign via an appended
|
|
# initrd, put it in the right place.
|
|
copy_file_if_exists "/config.ign" "${destination}/user.ign"
|
|
else
|
|
# We will support a user embedded config in the boot partition
|
|
# under $bootmnt/ignition/config.ign. Note that we mount /boot
|
|
# but we don't unmount boot because we are run in a systemd unit
|
|
# with MountFlags=slave so it is unmounted for us.
|
|
bootmnt=/mnt/boot_partition
|
|
mkdir -p $bootmnt
|
|
if [ -e /dev/disk/by-label/ignition ]; then
|
|
mount /dev/disk/by-label/ignition $bootmnt
|
|
fi
|
|
copy_file_if_exists "${bootmnt}/ignition/config.ign" "${destination}/user.ign"
|
|
fi
|