Ramips/mt7621 TP-Link RE350 V1 not building factory or sysupgrade images

I was hoping to try to install LEDE on a TP-Link R350 but there's no factory images listed in the snapshot builds directory here https://downloads.lede-project.org/snapshots/targets/ramips/mt7621/

Trying to build it locally with the image builder for rampis I get the following errors:

os-image partition too big (more than 1703936 bytes): Success
Failed to open firmware file
stat: cannot stat '/lede/imagebuilder/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-re350-v1-squashfs-sysupgrade.bin': No such file or directory
bash: line 0: [: : integer expression expected
WARNING: Image file /lede/imagebuilder/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-re350-v1-squashfs-sysupgrade.bin is too big
cp: cannot stat '/lede/imagebuilder/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-re350-v1-squashfs-sysupgrade.bin': No such file or directory
3873+1 records in
3873+1 records out
1983416 bytes (2.0 MB) copied, 0.00875844 s, 226 MB/s
os-image partition too big (more than 1703936 bytes): Success
cp: cannot stat '/lede/imagebuilder/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-re350-v1-squashfs-factory.bin': No such file or directory

The package set is the minimal base of

Packages: base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-gpio-button-hotplug kmod-leds-gpio kmod-mt7603 kmod-mt76x2 libc libgcc logd mtd netifd odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe swconfig uci uclient-fetch wpad-mini

Is there anything I can do to trim this down to fit? Or do I need to build an image from scratch rather than the image builder?

So I can build a factory and sysupgrade image for the TP-Link RE350 if I build from scratch and not using the image builder. Does this suggest the ramips image builder needs changing?

Looks like the image got too big. For stable builds some debugging options will be disabled, leading to a smaller image; for master, it looks like it is broken because it grew too much. Better file a bug report about it I think.

Hrm, yeah. After the upgrade to kernel 4.9 to 4.14 for ramips I can't even get an image building from master. Will dig a bit further.

Do you happen to know which debugging options are turned off for release? I might try that and see if it makes it small enough.

At least CONFIG_KERNEL_KALLSYMS is something that is disabled for stable builds. Also, you might want to compare ar71xx tiny and regular configs, since the tiny subtarget has some extra stuff stripped to keep 4 MB ar71xx targets usable with newer kernels.

Tried various things (including disabling kernel symbols) and the image is still too large for the TP link size checker. The R350 has 8 MB of flash so I'm a little surprised, but I guess the partition layout or something doesn't allow larger firmwares. Here's hoping someone else can figure this out...

Thanks for your help @Borromini

Oh, found a fix. After examining the diffconfig for some of the smaller routers I got an image with the following diffconfig:

CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_re350-v1=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
# CONFIG_KERNEL_CRASHLOG is not set
# CONFIG_KERNEL_DEBUG_FS is not set
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
# CONFIG_KERNEL_KALLSYMS is not set
# CONFIG_KERNEL_MAGIC_SYSRQ is not set
# CONFIG_KERNEL_PRINTK is not set
# CONFIG_KERNEL_PRINTK_TIME is not set
# CONFIG_KERNEL_SWAP is not set
# CONFIG_PACKAGE_MAC80211_DEBUGFS is not set
1 Like

A bigger kernel partition might be needed, all depends on how the ramips partition layout is. Do file a bug please so the devs can take a look at it before 18.04/05 gets released.

Done: https://bugs.openwrt.org/index.php?do=details&task_id=1479

Thanks! :grinning: