summaryrefslogtreecommitdiffstats
path: root/recipes/init-ifupdown
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/init-ifupdown')
-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}