Error while building OpenWrt 21.02.3 image to DLink DIR-885L

Hello guys,

I'm having a hard time building OpenWRT 21.02.3 image to DLink DIR-885L. I'm image using the official release image builder. For now, I just trying to build with default configs and packages, I'll add some custom packages later but it is not important for this topic.

Following is a Dockerfile that I'm using to build the image and (part of) the output log from the last command (the one that fails).

FROM ubuntu:20.04

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libncurses5-dev libncursesw5-dev zlib1g-dev gawk git gettext libssl-dev xsltproc rsync wget unzip python3

WORKDIR /usr/src

RUN wget https://downloads.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64.tar.xz

RUN tar xJf openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64.tar.xz

WORKDIR /usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64

RUN make -j1 V=sc image PROFILE="dlink_dir-885l"
Step 8/8 : RUN make -j1 V=sc image PROFILE="dlink_dir-885l"
 ---> Running in 036f28d98bc7

Configuring libnl-tiny1.
Configuring libubox20210516.
Configuring libuci20130104.
Configuring libubus20210630.
Configuring libiwinfo-data.
Configuring libiwinfo20210430.
Configuring iwinfo.
Configuring kmod-nls-base.
Configuring kmod-usb-core.
Configuring kmod-usb-bcma.
Configuring libuclient20201210.
Configuring uclient-fetch.
Configuring libpthread.
Configuring opkg.
Configuring libjson-c5.
Configuring libblobmsg-json20210516.
Configuring ubusd.
Configuring ubus.
Configuring iw.
Configuring busybox.
Configuring kmod-nf-reject6.
Configuring swconfig.
Configuring kmod-nf-conntrack.
Configuring kmod-nf-flow.
Configuring libwolfssl5.2.0.99a5b54a.
Configuring libustream-wolfssl20201210.
Configuring kmod-lib-crc-ccitt.
Configuring getrandom.
Configuring kmod-slhc.
Configuring kmod-ppp.
Configuring kmod-pppox.
Configuring kmod-pppoe.
Configuring kmod-phy-bcm-ns-usb2.
Configuring kmod-phy-bcm-ns-usb3.
Configuring hostapd-common.
Configuring wpad-basic-wolfssl.
Configuring kmod-nf-reject.
Configuring kmod-nf-ipt.
Configuring kmod-ipt-core.
Configuring kmod-ipt-conntrack.
Configuring jshn.
Configuring netifd.
Configuring jsonfilter.
Configuring usign.
Configuring openwrt-keyring.
Configuring ubi-utils.
Configuring ubox.
Configuring fstools.
Configuring fwtool.
Configuring base-files.
Configuring kmod-nf-nat.
Configuring libjson-script20210516.
Configuring kmod-usb-ohci.
Configuring dnsmasq.
Configuring procd.
Configuring kmod-usb-ehci.
Configuring libxtables12.
Configuring kmod-usb2.
Configuring kmod-usb3.
Configuring libip4tc2.
Configuring libip6tc2.
Configuring kmod-nf-conntrack6.
Configuring kmod-ipt-nat.
Configuring firewall.
Configuring kmod-nf-ipt6.
Configuring kmod-ip6tables.
Configuring odhcp6c.
Configuring uci.
Configuring dropbear.
Configuring oseama.
Configuring mtd.
Configuring odhcpd-ipv6only.
Configuring wireless-regdb.
Configuring kmod-cfg80211.
Configuring kmod-brcmutil.
Configuring brcmfmac-firmware-usb.
Configuring kmod-brcmfmac.
Configuring nvram.
Configuring urandom-seed.
Configuring otrx.
Configuring ppp.
Configuring kmod-leds-gpio.
Configuring kmod-gpio-button-hotplug.
Configuring brcmfmac-firmware-4366b1-pcie.
Configuring logd.
Configuring iptables.
Configuring ip6tables.
Configuring ca-bundle.
Configuring kmod-usb-ledtrig-usbport.
Configuring osafeloader.
Configuring kmod-ipt-offload.
Configuring urngd.
Configuring ppp-mod-pppoe.

Finalizing root filesystem...
Enabling boot
Enabling clear_partialboot
Enabling cron
Enabling dnsmasq
Enabling done
Enabling dropbear
Enabling firewall
Enabling gpio_switch
Enabling led
Enabling log
Enabling network
Enabling odhcpd
Enabling sysctl
Enabling sysfixtime
Enabling sysntpd
Enabling system
Enabling umount
Enabling urandom_seed
Enabling urngd
Enabling wpad

Building images...
Pseudo file "/dev" exists in source filesystem "/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/root-bcm53xx/dev".
Ignoring, exclude it (-e/-ef) to override.
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs, block size 262144.
[===============================================================|] 653/653 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 3424.83 Kbytes (3.34 Mbytes)
        37.90% of uncompressed filesystem size (9036.99 Kbytes)
Inode table size 6040 bytes (5.90 Kbytes)
        19.87% of uncompressed inode table size (30403 bytes)
Directory table size 8818 bytes (8.61 Kbytes)
        46.45% of uncompressed directory table size (18982 bytes)
Number of duplicate files found 100
Number of inodes 910
Number of files 644
Number of fragments 21
Number of symbolic links  192
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 73
Number of ids (unique uids + gids) 1
Number of uids 1
        unknown (0)
Number of gids 1
        unknown (0)
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
6849+1 records in
6849+1 records out
3507026 bytes (3.5 MB, 3.3 MiB) copied, 0.0150366 s, 233 MB/s
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
3424+1 records in
3425+0 records out
3507200 bytes (3.5 MB, 3.3 MiB) copied, 0.00784722 s, 447 MB/s
sysupgrade-meraki_mr32/
sysupgrade-meraki_mr32/CONTROL
sysupgrade-meraki_mr32/kernel
sysupgrade-meraki_mr32/root
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H245T00_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0xc242b807
mkchkimg:  Image Checksum: 0xc242b807
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H240T00_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0xec75f5a3
mkchkimg:  Image Checksum: 0xec75f5a3
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H270T00_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0xb70dc91b
mkchkimg:  Image Checksum: 0xb70dc91b
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H315T30_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0x552e5678
mkchkimg:  Image Checksum: 0x552e5678
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H315T00_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0x55d06841
mkchkimg:  Image Checksum: 0x55d06841
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
mkchkimg: Netgear CHK writer - v0.1
mkchkimg:        Board Id: U12H334T00_NETGEAR
mkchkimg:          Region: World Wide (WW)
mkchkimg:      Kernel Len: 8257536
mkchkimg: Kernel Checksum: 0x2148d857
mkchkimg:  Image Checksum: 0x2148d857
6849+1 records in
6849+1 records out
3507026 bytes (3.5 MB, 3.3 MiB) copied, 0.0149576 s, 234 MB/s
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=/usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/root.squashfs
vol_size=3507200
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize
6849+1 records in
6849+1 records out
3507026 bytes (3.5 MB, 3.3 MiB) copied, 0.0150946 s, 232 MB/s
6849+1 records in
6849+1 records out
3507026 bytes (3.5 MB, 3.3 MiB) copied, 0.0147907 s, 237 MB/s
mjn3's trx replacement - v0.81.1
WARNING: maxlen exceeds default maximum!  Beware of overwriting nvram!
os-image partition too big (more than 2097152 bytes): Success
make[3]: *** [Makefile:453: /usr/src/openwrt-imagebuilder-21.02.3-bcm53xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a9_musl_eabi/linux-bcm53xx_generic/tmp/openwrt-21.02.3-bcm53xx-generic-tplink_archer-c5-v2-squashfs.bin] Error 1
make[2]: *** [Makefile:186: build_image] Error 2
make[1]: *** [Makefile:124: _call_image] Error 2
make: *** [Makefile:240: image] Error 2
The command '/bin/sh -c make -j1 V=sc image PROFILE="dlink_dir-885l"' returned a non-zero code: 2

Does anyone know why the image builder is failing?

Thank you.

Maybe this is a hint since everything goes fine until this?

Is this device you have some low memory 4/32MB device?

1 Like

The device has 128MB.
I also noticed that it looks like the error is related to Archer C5-v2, but I'm not trying to build for it:

Does anyone have any clues?

Many devices are limited in storage capacity and there is no guarantee that the build system will detect when you have added too many packages to fit into the device storage space, which may render the device unbootable if installed. If in doubt, do not go overboard. Use what you had installed on the device last as a guide or create a minimal image first, install it to the device and test what you would like to add first. Consider removing unnecessary packages to save firmware space.

Yes, but I'm using the image builder used in the official release. Shouldn't it work?

It is quite strange the error messages refer to "Archer C5-v2" as the build profile is not targeted for that in his command [RUN make -j1 V=sc image PROFILE="dlink_dir-885l"] !
Do we have a bug evidence here?
If yes, how to overcome that problem for now, before the problem itself is solved?

Indeed. Maybe there is some workaround that we can use? For instance, removing any commands related to build for the Archer C5-v2 or any other devices that is failing?