Ubinize error: Cannot build new device

I'm trying to add provider branded device (Beeline Smartbox Turbo+) from Sercomm manufacturer. As of now, there is an instructions how to flash OpenWrt for Netgear R6350 to that device. I want to do everything in a proper way (R6350 and Turbo+ have buttons/leds mismatch, different partitions and so on).

I've added .dts file, copy-pasted description in the target/linux/ramips/image/mt7621.mk and I cannot build new device. If I change config to R6350 everything compiles fine. Seems like the problem in ubinize script.

make[5]: [Makefile:200: /home/apla/work/justbuild/openwrt/bin/targets/ramips/mt7621/openwrt-ramips-mt7621-beeline_smartbox-turbo-plus-squashfs-sysupgrade.bin] Error 127 (ignored)
ubinize: error!: cannot open file "/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-beeline_smartbox-turbo-plus-squashfs-factory.img.tmp"
         error 21 (Is a directory)
make[5]: *** [Makefile:201: /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-beeline_smartbox-turbo-plus-squashfs-factory.img] Error 255
make[4]: *** [Makefile:26: install] Error 2
make[3]: *** [Makefile:13: install] Error 2
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[1]: *** [target/Makefile:19: /home/apla/work/justbuild/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.target_install] Error 2
make: *** [/home/apla/work/justbuild/openwrt/include/toplevel.mk:227: world] Error 2

Not sure what to do next.

1 Like

make V=s and look at the logs to find why that file isn't there

1 Like

Error not in a missing file, but instead of file, build scripts generate directory. There is no mention of img.tmp in scripts, I've checked the diff between two build logs and there is no difference until ubinize.

1 Like
  1. post the part from the make log where it successfully compiles your dts
  2. post the relevant makefile parts that you a) copied from and b) created
1 Like

Commit with all my changes

I sourced device definition from Netgear r6350

When I removed two lines below from definitions, and removed factory.img from IMAGES section build finished without errors:

  IMAGE/factory.img := pad-extra 2048k | append-kernel | pad-to 6144k | append-ubi | \
        pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip $$$$(DEVICE_MODEL).bin | sercom-seal

dts build log with device before and after — seems ok to me:

mipsel-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts/include -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/include/ -undef -D__DTS__  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_asus_rt-ac85p.dtb.tmp ../dts/mt7621_asus_rt-ac85p.dts
/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/scripts/dtc/dtc -O dtb -i../dts/ -Wno-unit_address_vs_reg -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_asus_rt-ac85p.dtb /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_asus_rt-ac85p.dtb.tmp
rm -f /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_asus_rt-ac85p.dtb.tmp
mipsel-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts/include -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/include/ -undef -D__DTS__  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_beeline_smartbox-turbo-plus.dtb.tmp ../dts/mt7621_beeline_smartbox-turbo-plus.dts
/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/scripts/dtc/dtc -O dtb -i../dts/ -Wno-unit_address_vs_reg -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_beeline_smartbox-turbo-plus.dtb /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_beeline_smartbox-turbo-plus.dtb.tmp
rm -f /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_beeline_smartbox-turbo-plus.dtb.tmp
mipsel-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/arch/mips/boot/dts/include -I/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/include/ -undef -D__DTS__  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_buffalo_wsr-1166dhp.dtb.tmp ../dts/mt7621_buffalo_wsr-1166dhp.dts
/home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.151/scripts/dtc/dtc -O dtb -i../dts/ -Wno-unit_address_vs_reg -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg  -o /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_buffalo_wsr-1166dhp.dtb /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_buffalo_wsr-1166dhp.dtb.tmp
rm -f /home/apla/work/justbuild/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/image-mt7621_buffalo_wsr-1166dhp.dtb.tmp

1 Like

your makefile bits

DEVICE_MODEL := SmartBox Turbo Plus
zip $$$$(DEVICE_MODEL).bin

Seeing anything possibly troublesome there?

Thank you, without spaces it builds ok.

I saw many device models with whitespace in the same .mk file, but $DEVICE_MODEL missing in logs and openwrt-ramips-mt7621-beeline_smartbox-turbo-plus-squashfs-factory.img.tmp doesn't look like $DEVICE_MODEL

1 Like