mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-22 15:01:00 +02:00
coreos-base/oem-rackspace-onmetal: fix race
Rather than doing this crazy rename during boot, just use the GRUB config to pass net.ifnames=0 to the kernel.
This commit is contained in:
parent
c890b81797
commit
c64a446ad6
@ -1,19 +1,5 @@
|
|||||||
#cloud-config
|
#cloud-config
|
||||||
|
|
||||||
write_files:
|
|
||||||
- path: /run/udev/rules.d/79-netname.rules
|
|
||||||
permissions: 444
|
|
||||||
content: |
|
|
||||||
SUBSYSTEM!="net", GOTO="netname_end"
|
|
||||||
ACTION!="add", GOTO="netname_end"
|
|
||||||
ENV{ID_BUS}!="pci", GOTO="netname_end"
|
|
||||||
|
|
||||||
IMPORT{program}="/usr/share/oem/bin/netname.sh $env{IFINDEX}"
|
|
||||||
|
|
||||||
NAME=="", ENV{ID_NET_NAME_SIMPLE}!="", NAME="$env{ID_NET_NAME_SIMPLE}"
|
|
||||||
|
|
||||||
LABEL="netname_end"
|
|
||||||
|
|
||||||
coreos:
|
coreos:
|
||||||
units:
|
units:
|
||||||
- name: user-configdrive.service.d/netconf.conf
|
- name: user-configdrive.service.d/netconf.conf
|
||||||
@ -36,19 +22,6 @@ coreos:
|
|||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=user-config.target
|
WantedBy=user-config.target
|
||||||
- name: rename-network-interfaces.service
|
|
||||||
command: start
|
|
||||||
runtime: yes
|
|
||||||
content: |
|
|
||||||
[Unit]
|
|
||||||
Before=user-config.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
RemainAfterExit=yes
|
|
||||||
ExecStart=/usr/bin/systemctl stop systemd-networkd
|
|
||||||
ExecStart=/usr/share/oem/bin/rename-interfaces.sh
|
|
||||||
ExecStart=/usr/bin/systemctl start systemd-networkd
|
|
||||||
- name: media-configdrive.mount
|
- name: media-configdrive.mount
|
||||||
command: start
|
command: start
|
||||||
runtime: yes
|
runtime: yes
|
||||||
@ -63,7 +36,7 @@ coreos:
|
|||||||
Options=ro
|
Options=ro
|
||||||
oem:
|
oem:
|
||||||
id: onmetal
|
id: onmetal
|
||||||
name: Rackspace Teeth
|
name: Rackspace OnMetal
|
||||||
version-id: @@OEM_VERSION_ID@@
|
version-id: @@OEM_VERSION_ID@@
|
||||||
home-url: http://www.rackspace.com/
|
home-url: http://www.rackspace.com/
|
||||||
bug-report-url: https://github.com/coreos/bugs/issues
|
bug-report-url: https://github.com/coreos/bugs/issues
|
||||||
|
@ -8,4 +8,4 @@ set timeout=15
|
|||||||
set linux_console="console=ttyS4,115200n8 8250.nr_uarts=5"
|
set linux_console="console=ttyS4,115200n8 8250.nr_uarts=5"
|
||||||
|
|
||||||
# Blacklist MEI, the firmware is just plain broken.
|
# Blacklist MEI, the firmware is just plain broken.
|
||||||
set linux_append="modprobe.blacklist=mei_me"
|
set linux_append="modprobe.blacklist=mei_me net.ifnames=0"
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
IFINDEX=$1
|
|
||||||
echo "ID_NET_NAME_SIMPLE=eth$((${IFINDEX} - 2))"
|
|
@ -1,7 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
INTERFACES=$(ip link show | gawk -F ':' '/^[0-9]+/ { print $2 }' | tr -d ' ' | sed 's/lo//')
|
|
||||||
for iface in ${INTERFACES}; do
|
|
||||||
ip link set ${iface} down
|
|
||||||
udevadm test /sys/class/net/${iface}
|
|
||||||
done
|
|
Loading…
x
Reference in New Issue
Block a user