On 25 November 2011 13:20, Daniel Golle <[email protected]> wrote: > Allow reading the Ethernet MAC address from different places in the firmware. > > Use parameters for partition name, offset and OR-mask, so support for more > boards can be added easily. > > Signed-off-by: Daniel Golle <[email protected]> > > Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac > =================================================================== > --- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (revision > 29328) > +++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (working copy) > @@ -2,7 +2,7 @@ > # Copyright (C) 2011 OpenWrt.org > # > > -nw718_set_mac() { > +extract_and_set_mac() { > local part > local mac > > @@ -10,13 +10,13 @@ > > . /etc/functions.sh > > - part=$(find_mtd_part "factory") > + part=$(find_mtd_part "$1") > [ -z $part ] && return > > - mac=$(dd bs=1 skip=4 count=6 if=$part 2>/dev/null | maccalc bin2mac) > + mac=$(dd bs=1 skip=$2 count=6 if=$part 2>/dev/null | maccalc bin2mac) > [ -z $mac ] && return > > - mac=$(maccalc or "$mac" "02:00:00:00:00:00") > + mac=$(maccalc or "$mac" "$3") > ifconfig eth0 hw ether $mac 2>/dev/null > } > > @@ -24,9 +24,12 @@ > . /lib/ramips.sh > > case $(ramips_board_name) in > bc2 | nw718) > - nw718_set_mac > + extract_and_set_mac "factory" 4 "02:00:00:00:00:00" > ;; > + hw550-3g) > + extract_and_set_mac "factory" 40 "00:00:00:00:00:00" > + ;; > esac > } > >
Right.. this is what was already proposed at least 2 times before (by me and then, enhanced, by Alexander Gordeev) but never commited. There also are several pending patches for ramips platform (and affecting it) from me and others. Seems like OpenWrt needs more people with commit access to ramips target. I would be happy to help with that. Regards, Roman _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
