From 658916bb6829cb4e0cf6fb5b487874a6369ef98b Mon Sep 17 00:00:00 2001 From: dedene Date: Tue, 27 Nov 2018 10:54:24 +0100 Subject: [PATCH 1/2] coreos-base/oem-hcloud: add hetzner cloud support --- coreos-base/oem-hcloud/files/base/README | 4 +++ coreos-base/oem-hcloud/files/base/base.ign | 22 +++++++++++++++ coreos-base/oem-hcloud/files/base/default.ign | 14 ++++++++++ coreos-base/oem-hcloud/files/grub.cfg | 3 +++ coreos-base/oem-hcloud/files/oem-release | 5 ++++ coreos-base/oem-hcloud/metadata.xml | 4 +++ coreos-base/oem-hcloud/oem-hcloud-0.1.ebuild | 27 +++++++++++++++++++ 7 files changed, 79 insertions(+) create mode 100644 coreos-base/oem-hcloud/files/base/README create mode 100644 coreos-base/oem-hcloud/files/base/base.ign create mode 100644 coreos-base/oem-hcloud/files/base/default.ign create mode 100644 coreos-base/oem-hcloud/files/grub.cfg create mode 100644 coreos-base/oem-hcloud/files/oem-release create mode 100644 coreos-base/oem-hcloud/metadata.xml create mode 100644 coreos-base/oem-hcloud/oem-hcloud-0.1.ebuild diff --git a/coreos-base/oem-hcloud/files/base/README b/coreos-base/oem-hcloud/files/base/README new file mode 100644 index 0000000000..d128309fef --- /dev/null +++ b/coreos-base/oem-hcloud/files/base/README @@ -0,0 +1,4 @@ +These Ignition configs are part of the OEM configuration. Do not modify +them. If you want to write an Ignition config directly to disk, put it in +../config.ign and it will be applied at first boot instead of a config +in userdata. diff --git a/coreos-base/oem-hcloud/files/base/base.ign b/coreos-base/oem-hcloud/files/base/base.ign new file mode 100644 index 0000000000..4ad09cb410 --- /dev/null +++ b/coreos-base/oem-hcloud/files/base/base.ign @@ -0,0 +1,22 @@ +{ + "ignition": { + "version": "2.1.0" + }, + "systemd": { + "units": [ + { + "name": "coreos-metadata-sshkeys@.service", + "enabled": true + }, + { + "name": "coreos-metadata.service", + "enabled": true + }, + { + "contents": "[Unit]\nDescription=Setting the hostname from the metadata\n\n[Service]\nType=oneshot\nEnvironment=COREOS_METADATA_OPT_PROVIDER=--cmdline\nExecStart=/usr/bin/coreos-metadata ${COREOS_METADATA_OPT_PROVIDER} --hostname=/etc/hostname\n\n[Install]\nRequiredBy=multi-user.target", + "enable": true, + "name": "coreos-metadata-hostname.service" + } + ] + } +} diff --git a/coreos-base/oem-hcloud/files/base/default.ign b/coreos-base/oem-hcloud/files/base/default.ign new file mode 100644 index 0000000000..fbdc7b5a42 --- /dev/null +++ b/coreos-base/oem-hcloud/files/base/default.ign @@ -0,0 +1,14 @@ +{ + "ignition": { + "config": {}, + "security": { + "tls": {} + }, + "timeouts": {}, + "version": "2.2.0" + }, + "networkd": {}, + "passwd": {}, + "storage": {}, + "systemd": {} +} \ No newline at end of file diff --git a/coreos-base/oem-hcloud/files/grub.cfg b/coreos-base/oem-hcloud/files/grub.cfg new file mode 100644 index 0000000000..a2f0f861b2 --- /dev/null +++ b/coreos-base/oem-hcloud/files/grub.cfg @@ -0,0 +1,3 @@ +# CoreOS GRUB settings + +set oem_id="hcloud" diff --git a/coreos-base/oem-hcloud/files/oem-release b/coreos-base/oem-hcloud/files/oem-release new file mode 100644 index 0000000000..5635c5dc93 --- /dev/null +++ b/coreos-base/oem-hcloud/files/oem-release @@ -0,0 +1,5 @@ +ID=hcloud +VERSION_ID=@@OEM_VERSION_ID@@ +NAME="Hetzner Cloud" +HOME_URL="https://www.hetzner.com/cloud" +BUG_REPORT_URL="https://issues.coreos.com" diff --git a/coreos-base/oem-hcloud/metadata.xml b/coreos-base/oem-hcloud/metadata.xml new file mode 100644 index 0000000000..097975e3ad --- /dev/null +++ b/coreos-base/oem-hcloud/metadata.xml @@ -0,0 +1,4 @@ + + + + diff --git a/coreos-base/oem-hcloud/oem-hcloud-0.1.ebuild b/coreos-base/oem-hcloud/oem-hcloud-0.1.ebuild new file mode 100644 index 0000000000..1417716993 --- /dev/null +++ b/coreos-base/oem-hcloud/oem-hcloud-0.1.ebuild @@ -0,0 +1,27 @@ +# Copyright (c) 2018 CoreOS, Inc.. All rights reserved. +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DESCRIPTION="OEM suite for Hetzner Cloud images" +HOMEPAGE="" +SRC_URI="" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 x86" + +# no source directory +S="${WORKDIR}" + +src_prepare() { + sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ + "${FILESDIR}/oem-release" > "${T}/oem-release" || die +} + +src_install() { + insinto "/usr/share/oem" + doins "${FILESDIR}/grub.cfg" + doins "${T}/oem-release" + doins -r "${FILESDIR}/base" +} From ffa54a8d29585755a330853dd11d0f141b3cb576 Mon Sep 17 00:00:00 2001 From: Peter Dedene Date: Thu, 29 Nov 2018 19:08:29 +0100 Subject: [PATCH 2/2] coreos-base/oem-hcloud: remove empty default and move hostname init --- coreos-base/oem-hcloud/files/base/base.ign | 5 ----- coreos-base/oem-hcloud/files/base/default.ign | 14 -------------- 2 files changed, 19 deletions(-) delete mode 100644 coreos-base/oem-hcloud/files/base/default.ign diff --git a/coreos-base/oem-hcloud/files/base/base.ign b/coreos-base/oem-hcloud/files/base/base.ign index 4ad09cb410..3c3e2aafac 100644 --- a/coreos-base/oem-hcloud/files/base/base.ign +++ b/coreos-base/oem-hcloud/files/base/base.ign @@ -11,11 +11,6 @@ { "name": "coreos-metadata.service", "enabled": true - }, - { - "contents": "[Unit]\nDescription=Setting the hostname from the metadata\n\n[Service]\nType=oneshot\nEnvironment=COREOS_METADATA_OPT_PROVIDER=--cmdline\nExecStart=/usr/bin/coreos-metadata ${COREOS_METADATA_OPT_PROVIDER} --hostname=/etc/hostname\n\n[Install]\nRequiredBy=multi-user.target", - "enable": true, - "name": "coreos-metadata-hostname.service" } ] } diff --git a/coreos-base/oem-hcloud/files/base/default.ign b/coreos-base/oem-hcloud/files/base/default.ign deleted file mode 100644 index fbdc7b5a42..0000000000 --- a/coreos-base/oem-hcloud/files/base/default.ign +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ignition": { - "config": {}, - "security": { - "tls": {} - }, - "timeouts": {}, - "version": "2.2.0" - }, - "networkd": {}, - "passwd": {}, - "storage": {}, - "systemd": {} -} \ No newline at end of file