mirror of
https://github.com/Freescale/meta-freescale-3rdparty.git
synced 2025-07-05 05:15:24 +02:00
netbase (imx233-olinuxino-maxi): add MAC persistency
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
parent
b5ec87e785
commit
968b00896e
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
mac_file="/var/lib/mac/mac.$IFACE"
|
||||
|
||||
# Store MAC for reuse
|
||||
mkdir -p /var/lib/mac
|
||||
if [ ! -r "$mac_file" ]; then
|
||||
echo "Storing MAC for $IFACE for future use." > /dev/stderr
|
||||
cat /sys/class/net/usb0/address > "$mac_file"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Restore MAC setting
|
||||
stored=`cat "$mac_file"`
|
||||
current=`cat /sys/class/net/usb0/address`
|
||||
|
||||
if [ "$current" != "$stored" ]; then
|
||||
echo "Setting back to old MAC."
|
||||
ifconfig $IFACE hw ether $stored
|
||||
fi
|
|
@ -0,0 +1,22 @@
|
|||
# /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
|
||||
|
||||
auto usb0
|
||||
iface usb0 inet static
|
||||
address 192.168.7.2
|
||||
netmask 255.255.255.0
|
||||
network 192.168.7.0
|
||||
gateway 192.168.7.1
|
||||
|
||||
|
||||
|
9
recipes-core/netbase/netbase_4.47.bbappend
Normal file
9
recipes-core/netbase/netbase_4.47.bbappend
Normal file
|
@ -0,0 +1,9 @@
|
|||
FILESEXTRAPATHS_prepend := "${THISDIR}/netbase:"
|
||||
|
||||
PRINC := "${@int(PRINC) + 1}"
|
||||
|
||||
SRC_URI_append_imx233-olinuxino-maxi = " file://00-persistent-mac"
|
||||
|
||||
do_install_append_imx233-olinuxino-maxi () {
|
||||
install -m 0755 ${WORKDIR}/00-persistent-mac ${D}${sysconfdir}/network/if-pre-up.d
|
||||
}
|
Loading…
Reference in New Issue
Block a user