Merge pull request #2412 from packethost/oem-packet-remove-bond-workaround

coreos-overlay/oem-packet: Remove bond workaround
This commit is contained in:
Alex Crawford 2017-03-10 11:32:57 -08:00 committed by GitHub
commit 51e22be86d
3 changed files with 29 additions and 18 deletions

View File

@ -2,22 +2,12 @@
coreos: coreos:
units: units:
- name: oem-reset-interfaces.service
command: start
content: |
[Unit]
Description=Reset the bond.
[Service]
Type=oneshot
ExecStart=/usr/share/oem/bin/reset-interfaces.sh
- name: oem-cloudinit.service - name: oem-cloudinit.service
command: restart command: restart
runtime: yes runtime: yes
content: | content: |
[Unit] [Unit]
Description=Cloudinit from Packet metadata Description=Cloudinit from Packet metadata
After=oem-reset-interfaces.service
Requires=oem-reset-interfaces.service
[Service] [Service]
Type=oneshot Type=oneshot

View File

@ -1,8 +0,0 @@
#!/bin/bash
set -e
logger "Hard reset of all network interfaces due to upstream systemd-networkd issue: https://github.com/coreos/bugs/issues/36 ."
for iface in `ls -1 /sys/class/net | egrep -v "(^lo$|^bond)"`; do
ip link set $iface down
done
ip link del bond0
systemctl restart systemd-networkd

View File

@ -0,0 +1,29 @@
# 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"
insinto "/usr/share/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}