summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2013-05-15 12:30:06 +0300
committerSamuli Piippo <samuli.piippo@digia.com>2013-05-21 16:05:28 +0300
commit5b594414cbb1aba3513d8ff5d0f0d3b3bd4c2818 (patch)
treea46a11e470a06e9db6fe81831b4bc4a850157b49
parentc572bf044336852637b3ac3d0a2e1ad666b3a905 (diff)
downloadmeta-boot2qt-5b594414cbb1aba3513d8ff5d0f0d3b3bd4c2818.tar.gz
init-ifupdown: use fixed MAC address
Since beagleboard does not have fixed MAC address, use interfaces config to set it. This will use the MAC address from the first boot (which is random) in subsequent restarts. Change-Id: I2ea5e92b2b29f7aad7b40a7fb14ba8ca8d4fbe7a Reviewed-by: Kalle Viironen <kalle.viironen@digia.com>
-rwxr-xr-xrecipes/init-ifupdown/init-ifupdown/fixed_mac_address7
-rw-r--r--recipes/init-ifupdown/init-ifupdown/interfaces3
-rw-r--r--recipes/init-ifupdown/init-ifupdown_1.0.bbappend6
3 files changed, 15 insertions, 1 deletions
diff --git a/recipes/init-ifupdown/init-ifupdown/fixed_mac_address b/recipes/init-ifupdown/init-ifupdown/fixed_mac_address
new file mode 100755
index 0000000..020257e
--- /dev/null
+++ b/recipes/init-ifupdown/init-ifupdown/fixed_mac_address
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3if [ ! -e /etc/network/interfaces.fixed ]; then
4 HWADDRESS=$(cat /sys/class/net/eth0/address)
5 sed -i -e 's,^#\(.*\)00:00:00:00:00:00,\1'$HWADDRESS',' /etc/network/interfaces
6 touch /etc/network/interfaces.fixed
7fi
diff --git a/recipes/init-ifupdown/init-ifupdown/interfaces b/recipes/init-ifupdown/init-ifupdown/interfaces
index 02960ab..e315b94 100644
--- a/recipes/init-ifupdown/init-ifupdown/interfaces
+++ b/recipes/init-ifupdown/init-ifupdown/interfaces
@@ -16,7 +16,8 @@ iface atml0 inet dhcp
16# Wired or wireless interfaces 16# Wired or wireless interfaces
17auto eth0 17auto eth0
18iface eth0 inet dhcp 18iface eth0 inet dhcp
19hostname `/bin/hostname` 19 hostname `/bin/hostname`
20# hwaddress ether 00:00:00:00:00:00
20iface eth1 inet dhcp 21iface eth1 inet dhcp
21 22
22# Ethernet/RNDIS gadget (g_ether) 23# Ethernet/RNDIS gadget (g_ether)
diff --git a/recipes/init-ifupdown/init-ifupdown_1.0.bbappend b/recipes/init-ifupdown/init-ifupdown_1.0.bbappend
index 6d4804d..c2ed1b8 100644
--- a/recipes/init-ifupdown/init-ifupdown_1.0.bbappend
+++ b/recipes/init-ifupdown/init-ifupdown_1.0.bbappend
@@ -1,2 +1,8 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2 2
3SRC_URI += "file://fixed_mac_address"
4
5do_install_append() {
6 install -d ${D}${sysconfdir}/init.d
7 install -m 0755 ${WORKDIR}/fixed_mac_address ${D}${sysconfdir}/network/if-pre-up.d/
8}