On Sun, 28 Oct 2018 at 03:09, matt merhar <mattmer...@protonmail.com> wrote: > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > On Sunday, October 28, 2018 12:40 AM, Weedy <weedy2...@gmail.com> wrote: > > > On Sat, 27 Oct 2018 at 22:46, matt merhar mattmer...@protonmail.com wrote: > > > > > Hi, > > > > Hello, I replied to you on IRC but like 2 days later :V > > Yeah, I figured it would be better to get the reply on the ML anyhow, as it > might help others. > > > > Due to the switch to using devicetree in ath79, it became necessary to > > > populate the MAC addresses via userland during first boot. This is done > > > using target/linux/ath79/base-files/etc/board.d/02_network, > > > specifically: > > > > > > ubnt,routerstation|\\ > > > ubnt,routerstation-pro) > > > wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot > > > config") -n ar7100_esa) > > > lan_mac=$(macaddr_add "$wan_mac" 1) > > > > > > > > > This said, I can think of a few potential reasons for your > > > /etc/config/network to lack the 'macaddr' option for lan/wan interfaces: > > > 1.) Rather than modify the UCI network config generated at first boot, > > > the config was instead overwritten with those from an ar71xx install > > > (uploading via scp, .tar.gz via LuCI, cat >, etc.) > > > > I use $topdir/flies/ > > This is probably causing the issue. If you're building a pre-made > $topdir/files/etc/config/network into the image, I don't believe it will > overwrite that existing /etc/config/network file on first boot. If you > want to continue doing things this way then you'll need to add the > 'macaddr' options to your $topdir config, or alternatively try using the > patch I provided. I suppose you could also add something like an init > script to update the config file (e.g. with "uci set") on boot instead.
When I upgraded my tplink4300 the wifi code added another block to my $topdir customized config for the 2.4ghz radio, the pci path had changed. Shouldn't the boot code check for unset macaddr and uci commit like the wifi code does? > If you check /etc/board.json it should still contain the autogenerated > config similar to: > > ... > "network": { > "wan": { > "ifname": "eth0", > "protocol": "dhcp", > "macaddr": "00:15:6d:aa:bb:cc" > }, > "lan": { > "ifname": "eth1.1", > "protocol": "static", > "macaddr": "00:15:6d:aa:bb:cd" > } > }, > ... > > ...as long as you're not pre-populating that file in $topdir/files as > well. If the MACs there are correct then things are working as intended. This is all fine and my macs are also 00:15:6d:aa:bb:cc, so I just copied them over to my $topdir/. From my end the problem is solved, thanks for your time. > > > 2.) Using sysupgrade -F and preserving the old config while migrating > > > from ar71xx -> ath79 > > > 2.) Building your own image and deselecting the 'fconfig' utility which > > > is necessary to read the base MAC address from the RedBoot config > > > partition > > > > Now this is interesting because I use defconfig. I don't mind adding > > fconfig to my scripts, but then why isn't defconfig picking that up? > > > > buildImage () { > > make V=99 defconfig && \ > > nice -n 7 make V=1 -j4 || exit 1 > > } > > cat configs/rsPRO-home-repeater.config > .config > > > > buildImage > > scp > > bin/targets/ath79/generic/openwrt-ath79-generic-ubnt_routerstation-pro-squashfs-sysupgrade.bin > > > > > > r...@repeater.lan:/tmp/ > > > > $ cat configs/rsPRO-home-repeater.config > > CONFIG_TARGET_ath79=y > > CONFIG_TARGET_ath79_generic=y > > CONFIG_TARGET_ath79_generic_DEVICE_ubnt_routerstation-pro=y > > CONFIG_PACKAGE_wpad=y > > CONFIG_PACKAGE_wpad-mini=n > > CONFIG_ATH_USER_REGD=y > > CONFIG_PACKAGE_ATH_DFS=y > > CONFIG_PACKAGE_ATH_DYNACK=y > > CONFIG_PACKAGE_kmod-ath9k=y > > CONFIG_ATH9K_SUPPORT_PCOEM=y > > CONFIG_ATH9K_UBNTHSR=n > > I tested this (to the point of running "make defconfig" anyways) and the > following *are* properly selected in .config using the contents of your > configs/rsPRO-home-repeater.config: > > CONFIG_DEFAULT_fconfig=y > CONFIG_PACKAGE_fconfig=y > > It lives at /usr/sbin/fconfig on the router. I didn't bother to check this, I was assuming that lacking this util caused my random macs. You are right it's there. _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel