From d359596da123d8ec39ccb3e51f60c23d9b977d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Fri, 17 Apr 2020 09:10:57 +0200 Subject: [PATCH] Set fixed MAC for Nanopi R2S (#1893) Needed to avoid changing IP on reboot Signed-off-by: Igor Pecovnik --- packages/bsp/common/usr/lib/armbian/armbian-firstrun | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/bsp/common/usr/lib/armbian/armbian-firstrun b/packages/bsp/common/usr/lib/armbian/armbian-firstrun index 93b537a2d7..95495059d9 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-firstrun +++ b/packages/bsp/common/usr/lib/armbian/armbian-firstrun @@ -131,6 +131,13 @@ case "$1" in esac # varios temporary hardware workarounds + if [[ $BOARD_NAME == "Nanopi R2S" ]]; then + get_random_mac + sed -i "s/^auto eth0/auto eth0\n\thwaddress $MACADDR/" /etc/network/interfaces + get_random_mac + sed -i "s/^auto lan0/auto lan0\n\thwaddress $MACADDR/" /etc/network/interfaces + fi + [[ $LINUXFAMILY == rk3399 || $LINUXFAMILY == rockchip64 ]] && set_fixed_mac [[ $BRANCH == dev && $LINUXFAMILY == rockchip ]] && set_fixed_mac [[ $BRANCH == current && $LINUXFAMILY == odroidc1 ]] && set_fixed_mac