blob: ffaa6d1a39a9198d850fd9086348006eabbec683 [file] [log] [blame]
#!/bin/sh
set -e
mkdir -p /run/systemd/network
# custom names for OSC channels
if grep -q '\<czechlight=sdn-roadm-line.*\>' /proc/cmdline; then
ETH2_NAME=osc
elif grep -q '\<czechlight=sdn-inline.*\>' /proc/cmdline; then
ETH2_NAME=oscW
ETH3_NAME=oscE
ETH4_NAME=sfp3
fi
if [[ -n "${ETH2_NAME+set}" ]] ; then
cat > /run/systemd/network/30-eth2.link <<EOF
[Match]
Path=platform-f1034000.ethernet
[Link]
Name=${ETH2_NAME}
EOF
fi
if [[ -n "${ETH3_NAME+set}" ]]; then
cat > /run/systemd/network/30-eth3.link <<EOF
[Match]
Path=platform-soc:pcie-pci-0000:01:00.0
[Link]
Name=${ETH3_NAME}
EOF
fi
if [[ -n "${ETH4_NAME+set}" ]]; then
cat > /run/systemd/network/30-eth4.link <<EOF
[Match]
Path=platform-soc:pcie-pci-0000:01:00.1
[Link]
Name=${ETH4_NAME}
EOF
fi