From 00ac7586a40bc553592e34dae1c08dcdb8c372d0 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 5 Jul 2023 14:26:43 +0200 Subject: [PATCH] *: Remove support for niftycloud OEM --- build_library/niftycloud_ovf.sh | 116 ------------------ build_library/vm_image_util.sh | 28 ----- .../oem-niftycloud/files/cloud-config.yml | 57 --------- .../files/flatcar-setup-environment | 35 ------ .../coreos-base/oem-niftycloud/files/grub.cfg | 3 - .../files/niftycloud-coreos-cloudinit | 30 ----- .../oem-niftycloud/files/niftycloud-ssh-key | 25 ---- .../coreos-base/oem-niftycloud/metadata.xml | 4 - .../oem-niftycloud-0.0.3-r2.ebuild | 38 ------ ...8-revert-internal-oem-drop-noop-OEMs.patch | 21 +--- ...dded-platforms-to-docs-to-pass-tests.patch | 14 +-- .../files/0020-usr-share-oem-oem.patch | 4 +- ...internal-exec-stages-mount-Mount-oem.patch | 2 +- 13 files changed, 14 insertions(+), 363 deletions(-) delete mode 100755 build_library/niftycloud_ovf.sh delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/cloud-config.yml delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/flatcar-setup-environment delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/grub.cfg delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-coreos-cloudinit delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-ssh-key delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/metadata.xml delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/oem-niftycloud-0.0.3-r2.ebuild diff --git a/build_library/niftycloud_ovf.sh b/build_library/niftycloud_ovf.sh deleted file mode 100755 index 3da1eec9bfe..00000000000 --- a/build_library/niftycloud_ovf.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..) -. "${SCRIPT_ROOT}/common.sh" || exit 1 - -DEFINE_string vm_name "CoreOS" "Name for this VM" -DEFINE_string disk_vmdk "" "Disk image to reference, only basename is used." -DEFINE_integer memory_size 1024 "Memory size in MB" -DEFINE_string output_ovf "" "Path to write ofv file to, required." - -# Parse command line -FLAGS "$@" || exit 1 -eval set -- "${FLAGS_ARGV}" - -# Die on any errors. -switch_to_strict_mode - -if [[ ! -e "${FLAGS_disk_vmdk}" ]]; then - echo "No such disk image '${FLAGS_disk_vmdk}'" >&2 - exit 1 -fi - -DISK_NAME=$(basename "${FLAGS_disk_vmdk}") -DISK_UUID=$(uuidgen) -DISK_SIZE_BYTES=$(qemu-img info -f vmdk "${FLAGS_disk_vmdk}" \ - | gawk 'match($0, /^virtual size:.*\(([0-9]+) bytes\)/, a) {print a[1]}') -DISK_FILE_SIZE_BYTES=$(ls -l ${FLAGS_disk_vmdk} | awk '{print $5}') - -if [[ -z "${DISK_SIZE_BYTES}" ]]; then - echo "Unable to determine virtual size of ${FLAGS_disk_vmdk}" >&2 - exit 1 -fi - -# Date format as used in ovf -datez() { - date -u "+%Y-%m-%dT%H:%M:%SZ" -} - -if [[ -n "${FLAGS_output_ovf}" ]]; then - cat >"${FLAGS_output_ovf}" < - - - - - - List of the virtual disks used in the package - - - - Logical networks used in the package - - Logical network used by this appliance. - - - - A virtual machine - ${FLAGS_vm_name} - - The kind of installed guest operating system - - - Virtual hardware requirements for a virtual machine - - Virtual Hardware Family - 0 - ${FLAGS_vm_name} - vmx-08 - - - hertz * 10^6 - Number of virtual CPUs - 1 virtual CPU(s) - 1 - 3 - 1 - - - byte * 2^20 - Memory Size - ${FLAGS_memory_size} MB of memory - 2 - 4 - ${FLAGS_memory_size} - - - 0 - SCSI Controller - scsiController0 - 3 - VirtualSCSI - 6 - - - 0 - disk0 - ovf:/disk/vmdisk1 - 4 - 3 - 17 - - - 2 - true - bridged - VmxNet3 ethernet adapter on "bridged" - ethernet0 - 5 - VmxNet3 - 10 - - - - -EOF -fi diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 9fe4a0cd157..4f3e3fcbe6f 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -18,7 +18,6 @@ VALID_IMG_TYPES=( gce hyperv iso - niftycloud openstack openstack_mini packet @@ -52,7 +51,6 @@ VALID_OEM_PACKAGES=( exoscale gce hyperv - niftycloud packet qemu rackspace @@ -291,12 +289,6 @@ IMG_azure_OEM_SYSEXT=oem-azure IMG_hyperv_DISK_FORMAT=vhd IMG_hyperv_OEM_PACKAGE=oem-hyperv -## niftycloud -IMG_niftycloud_DISK_FORMAT=vmdk_stream -IMG_niftycloud_DISK_LAYOUT=vm -IMG_niftycloud_CONF_FORMAT=niftycloud -IMG_niftycloud_OEM_PACKAGE=oem-niftycloud - ## cloudsigma IMG_cloudsigma_DISK_FORMAT=qcow2 IMG_cloudsigma_OEM_PACKAGE=oem-cloudsigma @@ -1114,26 +1106,6 @@ _write_gce_conf() { VM_GENERATED_FILES=( "${tar_path}" ) } -_write_niftycloud_conf() { - local vm_mem="${1:-$(_get_vm_opt MEM)}" - local src_name=$(basename "$VM_SRC_IMG") - local dst_name=$(basename "$VM_DST_IMG") - local ovf="$(_dst_dir)/$(_src_to_dst_name "${src_name}" ".ovf")" - - "${BUILD_LIBRARY_DIR}/niftycloud_ovf.sh" \ - --vm_name "$VM_NAME" \ - --disk_vmdk "$VM_DST_IMG" \ - --memory_size "$vm_mem" \ - --output_ovf "$ovf" - - local ovf_name=$(basename "${ovf}") - cat > "${VM_README}" <> $ENV -echo COREOS_PRIVATE_IPV4=$(get_ip ens224) >> $ENV diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/grub.cfg b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/grub.cfg deleted file mode 100644 index b4f808396d5..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/grub.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Flatcar GRUB settings - -set oem_id="niftycloud" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-coreos-cloudinit b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-coreos-cloudinit deleted file mode 100644 index 657edf023bf..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-coreos-cloudinit +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -VMTOOLSD="" -if [ -x /oem/bin/vmtoolsd ]; then - VMTOOLSD="/oem/bin/vmtoolsd" -else - exit 1 -fi - -USER_DATA_DIR=/var/lib/flatcar-niftycloud -USER_DATA_PATH=${USER_DATA_DIR}/user-data -USER_DATA_FLAG=$(${VMTOOLSD} --cmd 'info-get guestinfo.set_user_data') - -if [ "$USER_DATA_FLAG" == "1" ]; then - TMPFILE=$(mktemp /tmp/XXXXXX-cloud-init) - ${VMTOOLSD} --cmd 'info-get guestinfo.user_data' | openssl enc -d -base64 > "${TMPFILE}" - if [ -s "${TMPFILE}" ]; then - coreos-cloudinit --from-file="${TMPFILE}" || exit $? - if [ "$(head -n 1 ${TMPFILE} | tr -d '\r' | tr -d '\n')" = "#cloud-config" ]; then - mkdir -p ${USER_DATA_DIR} - cp -p ${TMPFILE} ${USER_DATA_PATH} - fi - else - echo "guestinfo.user_data undefined." >&2 - exit 1 - fi - ${VMTOOLSD} --cmd 'info-set guestinfo.set_user_data 0' -elif [ -f ${USER_DATA_PATH} ]; then - coreos-cloudinit --from-file="${USER_DATA_PATH}" || exit $? -fi diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-ssh-key b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-ssh-key deleted file mode 100644 index 20f45ed01ca..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/files/niftycloud-ssh-key +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e - -set -e - -VMTOOLSD="" -if [ -x /oem/bin/vmtoolsd ]; then - VMTOOLSD="/oem/bin/vmtoolsd" -else - exit 1 -fi - -INIT=$(${VMTOOLSD} --cmd 'info-get guestinfo.init' 2>&1) -if [ $? -ne 0 ]; then - echo "guestinfo.init undefined." - ${VMTOOLSD} --cmd 'info-set guestinfo.init_result 9999' - exit 0 -fi -echo "guestinfo.init: $INIT" - -if [ $INIT == "1" ]; then - ${VMTOOLSD} --cmd 'info-get guestinfo.ssh_authorized_key' | update-ssh-keys -a "niftycloud" - - ${VMTOOLSD} --cmd 'info-set guestinfo.init 0' -fi - -${VMTOOLSD} --cmd 'info-set guestinfo.init_result 1' diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/metadata.xml b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/metadata.xml deleted file mode 100644 index 097975e3adc..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/metadata.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/oem-niftycloud-0.0.3-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/oem-niftycloud-0.0.3-r2.ebuild deleted file mode 100644 index e9097598f6b..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-niftycloud/oem-niftycloud-0.0.3-r2.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2014 NIFTY Corp.. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="OEM suite for NIFTY Cloud images" -HOMEPAGE="" -SRC_URI="" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64" -IUSE="" - -# no source directory -S="${WORKDIR}" - -DEPEND=" - app-emulation/open-vm-tools - " -RDEPEND="${DEPEND}" - -src_prepare() { - default - sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ - "${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die -} - -src_install() { - into "/oem" - dobin "${FILESDIR}/niftycloud-ssh-key" - dobin "${FILESDIR}/niftycloud-coreos-cloudinit" - dobin "${FILESDIR}/flatcar-setup-environment" - - insinto "/oem" - doins "${T}/cloud-config.yml" - doins "${FILESDIR}/grub.cfg" -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0018-revert-internal-oem-drop-noop-OEMs.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0018-revert-internal-oem-drop-noop-OEMs.patch index c90a6194ec9..d8392d031d7 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0018-revert-internal-oem-drop-noop-OEMs.patch +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0018-revert-internal-oem-drop-noop-OEMs.patch @@ -1,4 +1,4 @@ -From 31b8b62de7c0b617d03fc85b7190fb99048d941f Mon Sep 17 00:00:00 2001 +From 8e7ad5ef7ea79d541d8f960f2647a5cd17e72751 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Wed, 21 Dec 2022 17:25:02 +0100 Subject: [PATCH 18/21] revert: internal/oem: drop noop OEMs @@ -7,11 +7,11 @@ This reverts: https://github.com/coreos/ignition/commit/26828f92e00060aa8ebf2197 Signed-off-by: Mathieu Tortuyaux --- - internal/platform/platform.go | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) + internal/platform/platform.go | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) diff --git a/internal/platform/platform.go b/internal/platform/platform.go -index 51bf5174..64f6d364 100644 +index 51bf5174..5ed36663 100644 --- a/internal/platform/platform.go +++ b/internal/platform/platform.go @@ -132,6 +132,10 @@ func init() { @@ -36,18 +36,7 @@ index 51bf5174..64f6d364 100644 configs.Register(Config{ name: "ibmcloud", fetch: ibmcloud.FetchConfig, -@@ -164,6 +172,10 @@ func init() { - name: "metal", - fetch: noop.FetchConfig, - }) -+ configs.Register(Config{ -+ name: "niftycloud", -+ fetch: noop.FetchConfig, -+ }) - configs.Register(Config{ - name: "nutanix", - fetch: nutanix.FetchConfig, -@@ -185,6 +197,18 @@ func init() { +@@ -185,6 +193,18 @@ func init() { name: "qemu", fetch: qemu.FetchConfig, }) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0019-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0019-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch index 68131226b26..8448a8dd532 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0019-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0019-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch @@ -1,17 +1,17 @@ -From 2325c44516e3a1e7ecadc0f0a04ad438d69319af Mon Sep 17 00:00:00 2001 +From 8848eb28f78750b16cd503f64279847a5e2681ae Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 14 Apr 2023 11:37:20 +0200 Subject: [PATCH 19/21] docs: Add re-added platforms to docs to pass tests --- - docs/supported-platforms.md | 6 ++++++ - 1 file changed, 6 insertions(+) + docs/supported-platforms.md | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/docs/supported-platforms.md b/docs/supported-platforms.md -index f7bb4b40..242296d0 100644 +index f7bb4b40..eb5db00f 100644 --- a/docs/supported-platforms.md +++ b/docs/supported-platforms.md -@@ -12,18 +12,24 @@ Ignition is currently only supported for the following platforms: +@@ -12,10 +12,12 @@ Ignition is currently only supported for the following platforms: * [Microsoft Azure Stack] (`azurestack`) - Ignition will read its configuration from the custom data provided to the instance. Cloud SSH keys are handled separately. * Bare Metal - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, or `gs://` schemes to specify a remote config or the `oem://` scheme to specify a local config, rooted in `/usr/share/oem`. * [Brightbox] (`brightbox`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately. @@ -24,9 +24,7 @@ index f7bb4b40..242296d0 100644 * [IBM Cloud] (`ibmcloud`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately. * [KubeVirt] (`kubevirt`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately. * Bare Metal (`metal`) - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, `arn:`, or `gs://` schemes to specify a remote config. -+* `niftycloud` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately. - * [Nutanix] (`nutanix`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately. - * [OpenStack] (`openstack`) - Ignition will read its configuration from the instance userdata via either metadata service or config drive. Cloud SSH keys are handled separately. +@@ -24,6 +26,9 @@ Ignition is currently only supported for the following platforms: * [Equinix Metal] (`packet`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately. * [IBM Power Systems Virtual Server] (`powervs`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately. * [QEMU] (`qemu`) - Ignition will read its configuration from the 'opt/com.coreos/config' key on the QEMU Firmware Configuration Device (available in QEMU 2.4.0 and higher). diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0020-usr-share-oem-oem.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0020-usr-share-oem-oem.patch index 09e73c1d1bc..b594f78ab8d 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0020-usr-share-oem-oem.patch +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0020-usr-share-oem-oem.patch @@ -1,4 +1,4 @@ -From b366b5c0e1e30e0743d387d6f5f100214149293e Mon Sep 17 00:00:00 2001 +From 6f80f077330d91ee9bab5ece26dceb5b4a12939a Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 4 Apr 2023 12:12:42 +0200 Subject: [PATCH 20/21] /usr/share/oem -> /oem @@ -23,7 +23,7 @@ index 347d148c..d4c057b2 100644 // generate a new path fsMap[name] = "/tmp/" + name + "-ign" + strconv.FormatUint(addedSuffixCounter, 10) diff --git a/docs/supported-platforms.md b/docs/supported-platforms.md -index 242296d0..4ba98af5 100644 +index eb5db00f..d79c3bf2 100644 --- a/docs/supported-platforms.md +++ b/docs/supported-platforms.md @@ -10,7 +10,7 @@ Ignition is currently only supported for the following platforms: diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0021-internal-exec-stages-mount-Mount-oem.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0021-internal-exec-stages-mount-Mount-oem.patch index 464b63ff209..8d8a4cc81a0 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0021-internal-exec-stages-mount-Mount-oem.patch +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files/0021-internal-exec-stages-mount-Mount-oem.patch @@ -1,4 +1,4 @@ -From 0fe25f0aae40f2fe273dd48bdc9fe9c051471af8 Mon Sep 17 00:00:00 2001 +From 3adef6a01c987ed2156636fab1791e534f770621 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 16 May 2023 17:43:43 +0200 Subject: [PATCH 21/21] internal/exec/stages/mount: Mount /oem