Imagebuilder link-time error

Hi,

I’m trying to use the Imagebuilder to build an image for my B-1300 on a Debian buster machine.

After installing all the suggested dependencies with apt and cloning the repository, I ran ./gl_image -p b1300, and after several build steps succeeded, got this error from mksquashfs4:

/home/dgc/imagebuilder/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/staging_dir/host/bin/bundled/mksquashfs4: relocation error: /lib/x86_64-linux-gnu/libnss_files.so.2: symbol __libc_readline_unlocked, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

Any thoughts on what’s wrong here?

Thanks!

Seems like it may be an issue with the version of glibc on my system not matching expectations. Is there a supported version range?

Are you using an up to date version of Debian? I am on Ubuntu 20.04 and i have no issues. I tested also in Ubuntu 18.04 before that as well.

Yes, I’m on Debian 10 (Buster), which has glibc 2.28

A fully upgraded Ubuntu 20.04 would have glibc 2.31, 18.04 would have 2.27.

I suspect the problem might be this issue, which suggests that it would trigger upon upgrading to glibc >= 2.28.

But, if it’s working for you on Ubuntu 20.04, that may not be it.

Is gl_image downloading a pre-built mksquashfs4? I might try building that locally and substituting it in, which would eliminate glibc version compatibility issues.

The docker file is using debian:stretch-slim, and that is working fine, so might be something else? I have no idea really.

You can try using docker and see if it works for you?

Using the Dockerfile from the Imagebuilder repo, yes it works.

If I change the Dockerfile's FROM line to use debian:buster-slim instead of debian:stretch-slim, I get the link error same as I do locally.

So it seems the gl_image script works with Debian 9 but not Debian 10.

cp -fpR /src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/linux-ipq806x/fit-qcom-ipq40xx-ap.dkxx.itb /src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/bin/ipq806x/openwrt-ipq806x-qcom-ipq40xx-ap.dkxx-fit-uImage.itb
/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/staging_dir/host/bin/mksquashfs4 /src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/root-ipq806x /src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/linux-ipq806x/root.squashfs -nopad -noappend -root-owned -comp xz -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2 -Xbcj arm -b 256k -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -processors 1
Pseudo file "/dev" exists in source filesystem "/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/root-ipq806x/dev".
Ignoring, exclude it (-e/-ef) to override.
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/linux-ipq806x/root.squashfs, block size 262144.
[=============================================================-] 3350/3350 100%/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/staging_dir/host/bin/bundled/mksquashfs4: relocation error: /lib/x86_64-linux-gnu/libnss_files.so.2: symbol __libc_readline_unlocked, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
make[3]: *** [Makefile:138: mkfs-squashfs] Error 127
make[2]: *** [Makefile:170: build_image] Error 2
make[1]: *** [Makefile:116: _call_image] Error 2
make: *** [Makefile:199: image] Error 2
make[3]: Leaving directory '/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/target/linux/ipq806x/image'
make[2]: Leaving directory '/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1'
make[1]: Leaving directory '/src/imagebuilder/3.1/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1'
Update glinet repository ......
Update imagebuilder repository ......
Failed to build QSDK_Premium...

Yeah just looking at that and looking at the issue you linked in your previous post, it’s exactly the same issue basically. It means that there is something wrong with Debian 10’s glibc.

Unfortunately that specific image you are trying to build is QSDK, which is closed source. GL can only supply the precompiled builder, nothing more.

The only thing you can do is use the docker image, recompile an older version of glibc and use it on your system or use another system such as Ubuntu that doesn’t have the issue, it’s a pain i know :confused:, until Debian finds a fix in a later version.

Funny how Ubuntu is Debian based, but caught those issues before release.

Not so much a bug in Debian 10 as a backwards-incompatible change in glibc. We just need imagebuilder to provide a mksquashfs linked against a more recent glibc.

EDIT: I am having the same issue after i cleaned my Ubuntu install as well, but it’s only for the QSDK builds (S1300, B1300, AP1300 etc).

@hansome

This has been fixed by https://github.com/gl-inet-builder/openwrt-imagebuilder-ipq806x-QSDK_Premium_3.1/commit/bde31f8c4a83a8a3ce5199ce417c88e691080bfd

softlink of mksquashfs4 binary abnormal on ubuntu 20, so copying mksquashfs out of bundled works.

Thank you.

1 Like