From 698df28ed6e6ab3f894d1495632c7cd04a9898ba Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 18 Jun 2013 11:52:01 +0200 Subject: [PATCH] meta-digi-dey: Fix ifup script for manual configuration. The system freezes if we try to set the MAC addresses before the interface is up, so check the state before doing it. https://jira.digi.com/browse/DEL-509 Signed-off-by: Alex Gonzalez --- meta-digi-dey/recipes-core/netbase/netbase-5.0/ifup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/netbase/netbase-5.0/ifup b/meta-digi-dey/recipes-core/netbase/netbase-5.0/ifup index 892e63f17..3d8eee09a 100644 --- a/meta-digi-dey/recipes-core/netbase/netbase-5.0/ifup +++ b/meta-digi-dey/recipes-core/netbase/netbase-5.0/ifup @@ -34,14 +34,18 @@ if [ -h /sys/class/net/eth0 ]; then ;; esac if [ "${macaddr}" ]; then - /sbin/ifconfig eth0 hw ether ${macaddr} + if /sbin/ifconfig eth0 | grep -qs UP; then + /sbin/ifconfig eth0 hw ether ${macaddr} + fi fi fi if [ -h /sys/class/net/eth1 ]; then macaddr=`cat /proc/cmdline | sed 's,\s,\n,g' | awk '/ethaddr3/ {print}' | sed 's,ethaddr3=,,g'` if [ "${macaddr}" ]; then - /sbin/ifconfig eth1 hw ether ${macaddr} + if /sbin/ifconfig eth1 | grep -qs UP; then + /sbin/ifconfig eth1 hw ether ${macaddr} + fi fi fi