Skip to content

Commit

Permalink
delete eth1
Browse files Browse the repository at this point in the history
  • Loading branch information
gluhow committed Apr 6, 2022
1 parent 17338d5 commit 71916c4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 25 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

INTERFACES="eth0 eth1"
INTERFACES="eth0"
CONFIGFILES="/etc/ip-fallback/fallback"

N=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SYSTEMD_SERVICE_${PN} = "ip-fallback.service"
SRC_URI = "file://ip-fallback \
file://ip-fallback.service \
file://fallback-eth0.conf \
file://fallback-eth1.conf \
file://LICENSE \
"

Expand All @@ -29,7 +28,6 @@ do_install() {
install -m 755 ip-fallback ${D}/libexec
install -m 644 ip-fallback.service ${D}${systemd_system_unitdir}
install -m 644 fallback-eth0.conf ${D}/etc/ip-fallback/
install -m 644 fallback-eth1.conf ${D}/etc/ip-fallback/
}

FILES_${PN} = "/etc/ip-fallback /libexec ${systemd_system_unitdir}"

This file was deleted.

13 changes: 3 additions & 10 deletions meta-mcst/meta-common/recipes-mcst/net-initial/files/set_mac
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash

default_eth0addr=98:A7:B0:00:00:01
default_eth1addr=98:A7:B0:00:00:02

bmc_addr_base=0x6

# Note: U-Boot uses ethaddr instead of eth0addr variable!
env_eth0addr=`fw_printenv ethaddr 2>/dev/null | sed 's/^ethaddr=//' | tr '[:lower:]' '[:upper:]'`
env_eth1addr=`fw_printenv eth1addr 2>/dev/null | sed 's/^eth1addr=//' | tr '[:lower:]' '[:upper:]'`

[ -f /etc/reimu_fruid.conf ] && . /etc/reimu_fruid.conf

set_eth0addr=$default_eth0addr
set_eth1addr=$default_eth1addr

split_mac() { echo ${1:0:2}:${1:2:2}:${1:4:2}:${1:6:2}:${1:8:2}:${1:10:2}; }

Expand All @@ -22,7 +19,7 @@ convert_mac()
then
fru_ethaddr_base=`xml sel -t -v '/fruinfo/internal_use_area/mac_addr' /var/volatile/motherboard_info.xml 2>/dev/null | sed 's/ //g;s/,//g;s/0x//g'`
else
if [ -z "$env_eth0addr" -o -z "$env_eth1addr" ]
if [ -z "$env_eth0addr" ]
then
echo "Note: $3 has no valid FRU ID in EEPROM, and no MAC address in environment; using default MAC address." 1>&2
fru_ethaddr_base=""
Expand All @@ -35,9 +32,7 @@ convert_mac()
if echo $fru_ethaddr_base
then
set_eth0addr=`printf %X $((0x$fru_ethaddr_base + $2))`
set_eth1addr=`printf %X $((0x$fru_ethaddr_base + $2 + 1))`
set_eth0addr=`split_mac $set_eth0addr`
set_eth1addr=`split_mac $set_eth1addr`
else
echo "Warning: $3 has no valid MAC address in FRU ID, using default MAC address." 1>&2
fi
Expand Down Expand Up @@ -65,19 +60,17 @@ case "$FRUID_SOURCE" in
read_from_platform;;
esac

if [ "$env_eth0addr" == "$set_eth0addr" -a "$env_eth1addr" == "$set_eth1addr" ]
if [ "$env_eth0addr" == "$set_eth0addr" ]
then
echo "Note: MAC addresses in environment and FRU ID are the same, everything is OK."
exit 0
fi

# Done twice to alter both parts of environment
echo "Note: Setting MAC addresses as follows: eth0 = $set_eth0addr, eth1 = $set_eth1addr." 1>&2
echo "Note: Setting MAC addresses as follows: eth0 = $set_eth0addr." 1>&2

fw_setenv ethaddr $set_eth0addr
fw_setenv ethaddr $set_eth0addr
fw_setenv eth1addr $set_eth1addr
fw_setenv eth1addr $set_eth1addr

echo -e "\e[1;33m *** Note: MAC addresses are changed, rebooting. *** \e[0m" 1>&2
reboot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ REQUIRED_DISTRO_FEATURES = "systemd"
SYSTEMD_SERVICE_${PN} = "set_mac.service"

SRC_URI = "file://00-bmc-eth0.network \
file://00-bmc-eth1.network \
file://set_mac \
file://set_mac.service \
file://LICENSE \
Expand All @@ -31,7 +30,6 @@ do_install() {
install -d ${D}${systemd_system_unitdir}
install -m 755 set_mac ${D}/libexec
install -m 644 00-bmc-eth0.network ${D}${CONFDIR}/00-bmc-eth0.network
install -m 644 00-bmc-eth1.network ${D}${CONFDIR}/00-bmc-eth1.network
install -m 644 set_mac.service ${D}${systemd_system_unitdir}
echo "FRUID_SOURCE=${FRUID_SOURCE}" > ${D}/etc/reimu_fruid.conf
}
Expand Down

0 comments on commit 71916c4

Please sign in to comment.