Skip to content

Commit

Permalink
boot: rewrite mac related
Browse files Browse the repository at this point in the history
Signed-off-by: AuxXxilium <[email protected]>
  • Loading branch information
AuxXxilium committed Jun 27, 2024
1 parent 7f5ca9a commit 2c1bab8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions files/initrd/opt/arc/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ for ETH in ${ETHX}; do
MAC="$(readConfigKey "arc.${ETH}" "${USER_CONFIG_FILE}")"
[ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
ETHN=$((${ETHN} + 1))
if [ ${ETHN} -le ${NICPORTS} ]; then
CMDLINE['mac${ETHN}']="${MAC}"
fi
[ ${ETHN} -le ${NICPORTS} ] && CMDLINE['mac${ETHN}']="${MAC}"
done
CMDLINE['netif_num']="${NICPORTS}"
[ ${ETHN} -le ${NICPORTS} ] && CMDLINE['netif_num']="${ETHN}" || CMDLINE['netif_num']="${NICPORTS}"

# Read user network settings
while IFS=': ' read -r KEY VALUE; do
Expand Down

0 comments on commit 2c1bab8

Please sign in to comment.