ImageBuilder fails for ath9k

Hi, I'm trying to use ImageBuilder but it fails to find some directory.

I built a custom image and now trying to use ImageBuilder from local packages.

make image PROFILE=tplink_tl-wr1043nd-v2 PACKAGES="-ca-bundle -opkg -ppp -ppp-mod-pppoe -uclient-fetch"

gives me:

/home/tatel/openwrt2/openwrt/ImageBuilder/staging_dir/host/bin/find: '/home/tatel/openwrt2/openwrt/ImageBuilder/staging_dir/target-mips_24kc_musl/root-ath79': No such file or directory
/home/tatel/openwrt2/openwrt/ImageBuilder/staging_dir/host/bin/find: '/home/tatel/openwrt2/openwrt/ImageBuilder/staging_dir/target-mips_24kc_musl/root-ath79': No such file or directory
Traceback (most recent call last):
  File "/home/tatel/openwrt2/openwrt/ImageBuilder/staging_dir/host/bin/mklibs", line 421, in <module>
    inode = os.stat(prog)[ST_INO]
FileNotFoundError: [Errno 2] No such file or directory: 'mips-openwrt-linux-musl'

I have only an "image" directory under staging_dir/target-mips_24kc_musl/

ls staging_dir/target-mips_24kc_musl/
image

What could I do?

Is Imagebuilder selected in the .config ?

Yes it is:

CONFIG_IB=y
CONFIG_IB_STANDALONE=y

It turns out that you need to package the ImageBuilder before customizing your config. If you just set target, subtarget, target profile and build the OpenWRT ImageBuilder, then you'll have a working ImageBuilder.

If you do your complete customization befor building, then ImageBuilder will fail. Problem seems to be in the prepare_rootfs stage and to have something to do with mklibs. But you can get a little bunch of funny errors, like:

Collected errors:
 * opkg_install_cmd: Cannot install package kmod-usb-ledtrig-usbport.
 * opkg_install_cmd: Cannot install package kmod-usb2.
 * opkg_install_cmd: Cannot install package procd-ujail.
make[2]: *** [Makefile:169: package_install] Error 255
make[1]: *** [Makefile:124: _call_image] Error 2
make: *** [Makefile:242: image] Error 2

Even if you have those modules built-in. Or missing root-ath79 directory. Or, after linking that directory from build_dir to staging_dir:

I: Using /lib/ld-musl-mips-sf.so.1 as dynamic linker.
I: library reduction pass 1
0 symbols, 0 unresolved
I: stripping and copying dynamic linker to ..//lib/ld-musl-mips-sf.so.1
mips-openwrt-linux-musl-objcopy: '/home/tatel/openwrt2/openwrt/openwrt-imagebuilder-ath79-generic.Linux-x86_64/tmp/mklibs-out/..//lib/ld-musl-mips-sf.so.1': No such file
Command failed with status 1 : mips-openwrt-linux-musl-objcopy --strip-unneeded -R .note -R .comment  /home/tatel/openwrt2/openwrt/openwrt-imagebuilder-ath79-generic.Linux-x86_64/tmp/mklibs-out/..//lib/ld-musl-mips-sf.so.1
With output: 
make[2]: *** [Makefile:176: prepare_rootfs] Error 1
make[1]: *** [Makefile:125: _call_image] Error 2
make: *** [Makefile:242: image] Error 2

...which can be solved by disabling USE_MKLIBS. But then you got:

Traceback (most recent call last):
  File "/home/tatel/openwrt2/openwrt/openwrt-imagebuilder-ath79-generic.Linux-x86_64/staging_dir/host/bin/mklibs", line 421, in <module>
    inode = os.stat(prog)[ST_INO]
FileNotFoundError: [Errno 2] No such file or directory: 'mips-openwrt-linux-musl'
make[2]: *** [Makefile:176: prepare_rootfs] Error 1
make[1]: *** [Makefile:125: _call_image] Error 2
make: *** [Makefile:242: image] Error 2

... which I have been unable to get any clue about. But, as said, if you package ImageBuilder before customizing your config too much, it works even if after packaging ImageBuilder you strip your config as much as you could.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.