diff options
author | Alexander Filippov <a.filippov@yadro.com> | 2020-06-08 12:51:56 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-06-26 22:45:42 +0300 |
commit | 3985d5fe0843ea3898dfbb57fa57cb6cb545e80d (patch) | |
tree | 9614267a3a4e262cee7eeaa0c7eadfbe10485104 /meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004 | |
parent | 70b38d67003e9c013f8769a7a2427697b28656d1 (diff) | |
download | openbmc-3985d5fe0843ea3898dfbb57fa57cb6cb545e80d.tar.xz |
nicole: Add default network configs for Tatlin
This adds VLAN4004 configuration to the nicole firmware image.
The IPv6 address will be chosen depending on the BMC position.
During the firmware upgrade the stored previous version of
`/etc/systemd/network/00-bmc-eth0.network` may prevent to start new
VLAN4004 interface.
This commit also adds a service which should fix this issue on the
first boot time after upgrade by adding necessary option to the
interface configuration file if it is not present yet.
Tested: BMC now has additional `eth0.4004` interface use static IPv6
address and this address depend on BMC position.
(From meta-yadro rev: 83aa32ac997e6dc66cc5e2041a0a3cb723e950d9)
Change-Id: I5fc6663ddee67aafcfa9f2004083d8a4a528950f
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004')
6 files changed, 53 insertions, 0 deletions
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.0.network b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.0.network new file mode 100644 index 0000000000..534cbe9b1b --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.0.network @@ -0,0 +1,8 @@ +[Match] +Name=eth0.4004 +KernelCommandLine=bmcposition=0 +[Network] +LinkLocalAddressing=yes +IPv6AcceptRA=true +DHCP=no +Address=fd59:4144:524f:5441:544c:494e:3:1/122 diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.1.network b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.1.network new file mode 100644 index 0000000000..83a48eee7e --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.4004.1.network @@ -0,0 +1,8 @@ +[Match] +Name=eth0.4004 +KernelCommandLine=bmcposition=1 +[Network] +LinkLocalAddressing=yes +IPv6AcceptRA=true +DHCP=no +Address=fd59:4144:524f:5441:544c:494e:3:2/122 diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.network b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.network new file mode 100644 index 0000000000..f7c6707430 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/00-bmc-eth0.network @@ -0,0 +1,9 @@ +[Match] +Name=eth0 +[Network] +VLAN=eth0.4004 +DHCP=true +LinkLocalAddressing=yes +IPv6AcceptRA=false +[DHCP] +ClientIdentifier=mac diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/eth0.4004.netdev b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/eth0.4004.netdev new file mode 100644 index 0000000000..e315f5e8a5 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/eth0.4004.netdev @@ -0,0 +1,5 @@ +[NetDev] +Name=eth0.4004 +Kind=vlan +[VLAN] +Id=4004 diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.service b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.service new file mode 100644 index 0000000000..8714624805 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.service @@ -0,0 +1,15 @@ +[Unit] +Description=Setup VLAN 4004 +DefaultDependencies=no +Conflicts=shutdown.target +After=systemd-remount-fs.service +Before=sysinit.target shutdown.target systemd-update-done.service +ConditionNeedsUpdate=/etc + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/setup-vlan4004.sh + +[Install] +WantedBy=sysinit.target diff --git a/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.sh b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.sh new file mode 100755 index 0000000000..1278769d1f --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/network/vlan-4004/setup-vlan4004.sh @@ -0,0 +1,8 @@ +#!/bin/sh -eu + +VLAN='VLAN=eth0.4004' +ETH0_CFG='/etc/systemd/network/00-bmc-eth0.network' + +if ( ! grep -q "${VLAN}" ${ETH0_CFG} ); then + sed -i "/^\[Network\]$/a ${VLAN}" ${ETH0_CFG} +fi |