From 637fd8348a768335a8fde685f9d49da7f548e8fc Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 12 Aug 2013 10:34:52 +0300 Subject: init-ifupdown: use different interfaces configs for devices beagleboard: sets fixed mac address on first boot emulator: eth0 is for simulator connection and eth1 for network rest: use hostname for dns registration Change-Id: I8acca677fcf7c6b85bb03ae0a29011c85b7ffbf3 Reviewed-by: Samuli Piippo --- .../init-ifupdown/beagleboard/interfaces | 33 ++++++++++++++++++++++ .../init-ifupdown/emulator/interfaces | 33 ++++++++++++++++++++++ recipes/init-ifupdown/init-ifupdown/interfaces | 1 - recipes/init-ifupdown/init-ifupdown_1.0.bbappend | 4 +-- 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 recipes/init-ifupdown/init-ifupdown/beagleboard/interfaces create mode 100644 recipes/init-ifupdown/init-ifupdown/emulator/interfaces diff --git a/recipes/init-ifupdown/init-ifupdown/beagleboard/interfaces b/recipes/init-ifupdown/init-ifupdown/beagleboard/interfaces new file mode 100644 index 0000000..e315b94 --- /dev/null +++ b/recipes/init-ifupdown/init-ifupdown/beagleboard/interfaces @@ -0,0 +1,33 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wireless interfaces +iface wlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf + +iface atml0 inet dhcp + +# Wired or wireless interfaces +auto eth0 +iface eth0 inet dhcp + hostname `/bin/hostname` +# hwaddress ether 00:00:00:00:00:00 +iface eth1 inet dhcp + +# Ethernet/RNDIS gadget (g_ether) +# ... or on host side, usbnet and random hwaddr +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.0 + network 192.168.7.0 + gateway 192.168.7.1 + +# Bluetooth networking +iface bnep0 inet dhcp + diff --git a/recipes/init-ifupdown/init-ifupdown/emulator/interfaces b/recipes/init-ifupdown/init-ifupdown/emulator/interfaces new file mode 100644 index 0000000..06adafb --- /dev/null +++ b/recipes/init-ifupdown/init-ifupdown/emulator/interfaces @@ -0,0 +1,33 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wireless interfaces +iface wlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf + +iface atml0 inet dhcp + +# Wired or wireless interfaces +auto eth0 +iface eth0 inet dhcp +auto eth1 +iface eth1 inet dhcp + hostname `/bin/hostname` + +# Ethernet/RNDIS gadget (g_ether) +# ... or on host side, usbnet and random hwaddr +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.0 + network 192.168.7.0 + gateway 192.168.7.1 + +# Bluetooth networking +iface bnep0 inet dhcp + diff --git a/recipes/init-ifupdown/init-ifupdown/interfaces b/recipes/init-ifupdown/init-ifupdown/interfaces index e315b94..5c1ec07 100644 --- a/recipes/init-ifupdown/init-ifupdown/interfaces +++ b/recipes/init-ifupdown/init-ifupdown/interfaces @@ -17,7 +17,6 @@ iface atml0 inet dhcp auto eth0 iface eth0 inet dhcp hostname `/bin/hostname` -# hwaddress ether 00:00:00:00:00:00 iface eth1 inet dhcp # 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 c2ed1b8..31c189d 100644 --- a/recipes/init-ifupdown/init-ifupdown_1.0.bbappend +++ b/recipes/init-ifupdown/init-ifupdown_1.0.bbappend @@ -1,8 +1,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://fixed_mac_address" +SRC_URI_append_beagleboard = " file://fixed_mac_address" -do_install_append() { +do_install_append_beagleboard() { install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/fixed_mac_address ${D}${sysconfdir}/network/if-pre-up.d/ } -- cgit v1.2.3-54-g00ecf