mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-22 23:11:07 +02:00
Merge pull request #2478 from coreos/oem-packet
coreos-base/oem-packet: drop cloud-config
This commit is contained in:
commit
c17edecdc0
@ -1,31 +0,0 @@
|
|||||||
#cloud-config
|
|
||||||
|
|
||||||
coreos:
|
|
||||||
units:
|
|
||||||
- name: oem-cloudinit.service
|
|
||||||
command: restart
|
|
||||||
runtime: yes
|
|
||||||
content: |
|
|
||||||
[Unit]
|
|
||||||
Description=Cloudinit from Packet metadata
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/bin/coreos-cloudinit --oem=packet
|
|
||||||
- name: oem-phone-home.service
|
|
||||||
command: start
|
|
||||||
content: |
|
|
||||||
[Unit]
|
|
||||||
Description=Basic setup tasks to initialize the machine.
|
|
||||||
Wants=sys-devices-virtual-net-bond0.device
|
|
||||||
After=sys-devices-virtual-net-bond0.device
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/share/oem/bin/phone-home.sh
|
|
||||||
oem:
|
|
||||||
id: packet
|
|
||||||
name: Packet
|
|
||||||
version-id: @@OEM_VERSION_ID@@
|
|
||||||
home-url: https://packet.net
|
|
||||||
bug-report-url: https://issues.coreos.com
|
|
5
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-packet/files/oem-release
vendored
Normal file
5
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-packet/files/oem-release
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ID=packet
|
||||||
|
VERSION_ID=@@OEM_VERSION_ID@@
|
||||||
|
NAME="Packet"
|
||||||
|
HOME_URL="https://packet.net"
|
||||||
|
BUG_REPORT_URL="https://issues.coreos.com"
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
API_URL=$(curl -s https://metadata.packet.net/metadata | jq ".api_url" | sed -e 's/^"//' -e 's/"$//')
|
|
||||||
|
|
||||||
while ! wget --inet4-only --spider --quiet "${API_URL}/build_info.txt"; do
|
|
||||||
echo "$0: API unavailable: $API_URL" >&2
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
logger "Making a call to tell the packet API this machine is online."
|
|
||||||
curl -X POST $API_URL/phone-home
|
|
||||||
logger "This device has been announced to the packet API."
|
|
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Basic setup tasks to initialize the machine.
|
||||||
|
ConditionFirstBoot=true
|
||||||
|
Requires=coreos-metadata.service
|
||||||
|
After=coreos-metadata.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=/run/metadata/coreos
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/curl --request POST "${COREOS_PACKET_PHONE_HOME_URL}"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -1,30 +0,0 @@
|
|||||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
DESCRIPTION="OEM suite for Packet 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}/cloud-config.yml" > "${T}/cloud-config.yml" || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
into "/usr/share/oem"
|
|
||||||
dobin "${FILESDIR}/phone-home.sh"
|
|
||||||
dobin "${FILESDIR}/reset-interfaces.sh"
|
|
||||||
|
|
||||||
insinto "/usr/share/oem"
|
|
||||||
doins "${T}/cloud-config.yml"
|
|
||||||
doins "${FILESDIR}/grub.cfg"
|
|
||||||
}
|
|
@ -16,14 +16,12 @@ S="${WORKDIR}"
|
|||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
|
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
|
||||||
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
|
"${FILESDIR}/oem-release" > "${T}/oem-release" || die
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
into "/usr/share/oem"
|
|
||||||
dobin "${FILESDIR}/phone-home.sh"
|
|
||||||
|
|
||||||
insinto "/usr/share/oem"
|
insinto "/usr/share/oem"
|
||||||
doins "${T}/cloud-config.yml"
|
|
||||||
doins "${FILESDIR}/grub.cfg"
|
doins "${FILESDIR}/grub.cfg"
|
||||||
|
doins "${T}/oem-release"
|
||||||
|
doins -r "${FILESDIR}/units"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user