diff options
-rwxr-xr-x | recipes/init-ifupdown/init-ifupdown/fixed_mac_address | 7 | ||||
-rw-r--r-- | recipes/init-ifupdown/init-ifupdown/interfaces | 3 | ||||
-rw-r--r-- | recipes/init-ifupdown/init-ifupdown_1.0.bbappend | 6 |
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 | |||
3 | if [ ! -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 | ||
7 | fi | ||
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 |
17 | auto eth0 | 17 | auto eth0 |
18 | iface eth0 inet dhcp | 18 | iface eth0 inet dhcp |
19 | hostname `/bin/hostname` | 19 | hostname `/bin/hostname` |
20 | # hwaddress ether 00:00:00:00:00:00 | ||
20 | iface eth1 inet dhcp | 21 | iface 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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
2 | 2 | ||
3 | SRC_URI += "file://fixed_mac_address" | ||
4 | |||
5 | do_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 | } | ||