this was the first time I built openwrt myself (so far only stock images). The reason is that I have a TPlink WDR4300 which has been modified with a 16MB flash (not by me) and came with LEDE Reboot, which is a bit dated now...
I first made a full backup, documented some stuff of the existing install, verified that the bootloader was indeed pepe2k (it was) and the serial pin header did work (it didn't, the person who did the mod failed to get a good ground connection - as did I in several tries - a jumper wire fixed that).
As a first try, I used the generic 19.07.7 sysupgrade image via luci. This worked in the sense that I had a booting router, but as expected with an 8MB flash layout and no wifi (as the art partition was not where it should be in the 8MB layout). The latter was of course easily fixed from backup...
Then I got the 19.7.07 source tree and went on to build it as per https://openwrt.org/docs/guide-user/additional-software/beginners-build-guide and https://openwrt.org/docs/guide-developer/quickstart-build-images.
Before I edited target/linux/ath79/image/generic-tp-link.mk as shown in https://tbspace.de/wr84116mbflashmod.html (which is for a LEDE based Freifunk Gluon, which might be the reason why it didn't work) to have a 16MB model of the 4300 by adding this:
define Device/tplink_tl-wdr4300-v1-16 $(Device/tplink-16mlzma) ATH_SOC := ar9344 DEVICE_TITLE := TP-Link TL-WDR4300 v1 16MB DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport TPLINK_HWID := 0x43000001 SUPPORTED_DEVICES += tl-wdr4300 endef TARGET_DEVICES += tplink_tl-wdr4300-v1-16
I then chose the 16MB version in make menuconfig and built it with make. After some time, the make stopped with the complaint that ./target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1-16.dts could not be found. I did find ./target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts though and since it didn't seem to contain anything related to the flash size, I just made a copy with the new name and tried again.
This did indeed result into a 16MB factory image, which I could install (via webserver in pepe2k BL) and could boot from. Unfortunately the flash layout was still 8MB like this:
dev: size erasesize name mtd0: 00020000 00010000 "u-boot" mtd1: 007d0000 00010000 "firmware" mtd2: 0018e10f 00010000 "kernel" mtd3: 00641ef0 00010000 "rootfs" mtd4: 00430000 00010000 "rootfs_data" mtd5: 00010000 00010000 "art"
while the LEDE reboot I had originally had the correct length 0f 00fd0000:
dev: size erasesize name mtd0: 00020000 00010000 "u-boot" mtd1: 001333cc 00010000 "kernel" mtd2: 00e9cc34 00010000 "rootfs" mtd3: 00c60000 00010000 "rootfs_data" mtd4: 00010000 00010000 "art" mtd5: 00fd0000 00010000 "firmware"
So what is the correct procedure to build a current openwrt for a larger than stock flash (I'm not adverse to try the 21 RC or master but thought stable would be easiest as a first try)?
Thanks in advance,