diff options
author | Samuli Piippo <samuli.piippo@digia.com> | 2013-05-15 12:30:06 +0300 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2013-05-21 16:05:28 +0300 |
commit | 5b594414cbb1aba3513d8ff5d0f0d3b3bd4c2818 (patch) | |
tree | a46a11e470a06e9db6fe81831b4bc4a850157b49 /recipes/init-ifupdown | |
parent | c572bf044336852637b3ac3d0a2e1ad666b3a905 (diff) | |
download | meta-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>
Diffstat (limited to 'recipes/init-ifupdown')
-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 | } | ||