Unable to build OpenWrt image

Hi,

Trying to build the latest image from Opwnwrt. Download the latest code from https://github.com/openwrt/openwrt but when building, encountered a few errors:


make[5]: Leaving directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4'
make docs
make[5]: Entering directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4'
make[5]: [Makefile:394: docs] Error 1 (ignored)
make[5]: Leaving directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4'
make[4]: Leaving directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4'
touch /home/test/openwrt/build_dir/host/e2fsprogs-1.46.4/.built

--

 make[5]: Entering directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/ext2fs'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/ext2fs'
make[4]: [Makefile:397: install-doc-libs] Error 1 (ignored)
make install-libs
make[5]: Entering directory '/home/test/openwrt/build_dir/host/e2fsprogs-1.46.4'
making install in lib/et
--
mkdir -p /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/share/gdb
cp -R /home/test/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/gdb-11.2/gdb/data-directory/python /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/share/gdb/
cp: cannot stat '/home/test/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/gdb-11.2/gdb/data-directory/python': No such file or directory
make[3]: [Makefile:78: /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/stamp/.gdb_installed] Error 1 (ignored)
cp -R /home/test/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/gdb-11.2/gdb/data-directory/syscalls /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/share/gdb/
cp -R /home/test/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/gdb-11.2/gdb/data-directory/system-gdbinit /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/share/gdb/
mkdir -p /home/test/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/stamp
--
make[6]: Entering directory '/home/test/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/gcc-11.2.0-final/aarch64-openwrt-linux-musl/libstdc++-v3/include'
echo timestamp > stamp-pb
echo timestamp > stamp-host
make[6]: [Makefile:1767: aarch64-openwrt-linux-musl/bits/largefile-config.h] Error 1 (ignored)
make[6]: [Makefile:1768: aarch64-openwrt-linux-musl/bits/largefile-config.h] Error 1 (ignored)
echo 0 > stamp-namespace-version
echo 1 > stamp-visibility
echo 1 > stamp-extern-template

run it again, using make -j1 V=s.

use the </> tag when posting cli text.

1 Like

Have tried a few time with 'make -j1 V=s'. It the same every time.

I'm not even sure that these errors mean. If it was a missing module, then I could install it but that does not seem to be the case.

I run the following make -j1 V=s 2>&1 | tee build.log | grep -i -E "^make.*(error|[12345]...Entering dir)" but it came back with the same error.

You only provide small hunks of error log lines. I think you look to close to the error line to see the actual problem message. The actual fault log line where it derails can typically be at least 10-20lines or more above the error text before the build stops with the error.

And the problem message will probably not contain the word “error” so there is no point of grep:ing that word.

2 Likes

If you run that command (originating from my build scripts), you can still see the full detailed log in the "build.log" file. The command is intended to show the brief summary (via grep) of the build progress on screen, while the the full log goes to build.log (via tee).

I have been through the log but can't find anything, related to these error.

I wanted to post my build.log here but it 120,000 lines long. Have uploaded to google drive: https://drive.google.com/file/d/1Z1XwMBSr8IEZzXPckRQP-yNnFVJOTF6P/view?usp=sharing

If anyone can have a look, its would be very much appreciated.

It is impossible to scroll to the end, it just loads 2new cm over and over again…

But I said 10-20 lines above the error! Not 120000lines!!!

1 Like

It the entire log. :smile:

Posting errors here, with additional line:

CC test_icount_cmds.c
	LD test_icount
	CC crcsum.c
	LD crcsum
make[6]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/tests/progs'
making all in po
make[6]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/po'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/po'
making all in scrub
make[6]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/scrub'
	SUBST e2scrub
	SUBST e2scrub_all
	SUBST e2scrub.8
        SUBST e2scrub_all.8
	SUBST e2scrub.conf
make[6]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/scrub'
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
make docs
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
**make[5]: [Makefile:394: docs] Error 1 (ignored)**
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
make[4]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
touch /home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/.built
CFLAGS="-O2 -I/home/ghaffar/openwrt/staging_dir/host/include  -DPIC -fPIC" CPPFLAGS="-I/home/ghaffar/openwrt/staging_dir/host/include " CXXFLAGS="" LDFLAGS="-L/home/ghaffar/openwrt/staging_dir/host/lib " make  -C /home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4  install
make[4]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
making install-shlibs in lib/e2p
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/e2p'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/e2p'
making install-shlibs in lib/uuid
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/uuid'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/uuid'
making install-shlibs in lib/blkid
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/blkid'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/blkid'
making install-shlibs in lib/support
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/support'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/support'
making install-shlibs in lib/ext2fs
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/ext2fs'
make[5]: Nothing to be done for 'install-shlibs'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/ext2fs'
**make[4]: [Makefile:397: install-doc-libs] Error 1 (ignored)**
make install-libs
make[5]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4'
making install in lib/et
make[6]: Entering directory '/home/ghaffar/openwrt/build_dir/host/e2fsprogs-1.46.4/lib/et'
	MKDIR_P /home/ghaffar/openwrt/staging_dir/host/lib /home/ghaffar/openwrt/staging_dir/host/include/et /home/ghaffar/openwrt/staging_dir/host/share/et /home/ghaffar/openwrt/staging_dir/host/bin /home/ghaffar/openwrt/staging_dir/host/share/man/man1 /home/ghaffar/openwrt/staging_dir/host/share/man/man3
 f=./../system-gdbinit/$file ; \
  if test -f $f ; then \
    /home/ghaffar/openwrt/staging_dir/host/bin/install -c -m 644 $f ./system-gdbinit ; \
  fi ; \
done
touch stamp-system-gdbinit
make[8]: Leaving directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/data-directory'
make[7]: Leaving directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb'
make[6]: Leaving directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb'
make[5]: Nothing to be done for 'all-target'.
make[5]: Leaving directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2'
make[4]: Leaving directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2'
touch /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/.built
mkdir -p /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/bin
install -m0755 /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/gdb /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/bin/aarch64-openwrt-linux-musl-gdb
ln -fs aarch64-openwrt-linux-musl-gdb /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/bin/aarch64-openwrt-linux-gdb
strip /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/bin/aarch64-openwrt-linux-musl-gdb
mkdir -p /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/share/gdb
cp -R /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/data-directory/python /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/share/gdb/
cp: cannot stat '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/data-directory/python': No such file or directory
**make[3]: [Makefile:78: /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/stamp/.gdb_installed] Error 1 (ignored)**
cp -R /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/data-directory/syscalls /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/share/gdb/
cp -R /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/gdb/data-directory/system-gdbinit /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/share/gdb/
mkdir -p /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/stamp
touch /home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gdb-11.2/.built
touch /home/ghaffar/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/stamp/.gdb_installed
config.status: creating include/Makefile
config.status: creating libsupc++/Makefile
config.status: creating src/Makefile
config.status: creating src/c++98/Makefile
config.status: creating src/c++11/Makefile
config.status: creating src/c++17/Makefile
config.status: creating src/c++20/Makefile
config.status: creating src/filesystem/Makefile
config.status: creating doc/Makefile
config.status: creating po/Makefile
config.status: creating testsuite/Makefile
config.status: creating python/Makefile
config.status: creating config.h
config.status: executing default-1 commands
config.status: executing libtool commands
config.status: executing include/gstdint.h commands
config.status: executing generate-headers commands
make[6]: Entering directory '/home/ghaffar/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/gcc-11.3.0-final/aarch64-openwrt-linux-musl/libstdc++-v3/include'
echo timestamp > stamp-pb
echo timestamp > stamp-host
**make[6]: [Makefile:1767: aarch64-openwrt-linux-musl/bits/largefile-config.h] Error 1 (ignored)**
**make[6]: [Makefile:1768: aarch64-openwrt-linux-musl/bits/largefile-config.h] Error 1 (ignored)**
echo 0 > stamp-namespace-version
echo 1 > stamp-visibility
echo 1 > stamp-extern-template
echo 1 > stamp-dual-abi
echo 1 > stamp-cxx11-abi

I have noticed that even with these errors, there are file in the bin\target directory. I'm not sure how stable they would be cos of these error.

Do you actually have a real build error in the bottom of the process or have you just searched for the word error in the whole build process log which is more like anomalies since the compiler it self has already ignored them?

One is some kind of doc file which is pretty useless anyway since nothing in the firmware runs on doc files.

If the build process ends with a checksum line and some cleanup lines then the image has been built.

If the build actually ends with an error then only a handful of cleanup lines comes after the error and then it stops and you definitely don’t have files in the bin directory, especially not the sha256 file since that is the last file to be made in the build process.

You could try installing the initramfs image if you are uncertain.

1 Like

Since I these days is in the line of build errors I give you a quick prime example as seen from the very end of the build process:

This is a typical build error, note the length between the fault at the top and the the actual error warning at the bottom:

Error: ../dts-5.10/rtl83xx_d-link_dgs-1210_poe.dtsi:7.1-6 Label or path leds not found
FATAL ERROR: Syntax error parsing input tree
make[5]: *** [Makefile:117: /home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/linux-realtek_rtl838x/image-rtl8380_d-link_dgs-1210-10mp.dtb] Error 1
make[5]: *** Waiting for unfinished jobs....
rm -f /home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/linux-realtek_rtl838x/image-rtl8380_d-link_dgs-1210-10p.dtb.tmp
rm -f /home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/linux-realtek_rtl838x/image-rtl8382_d-link_dgs-1210-20.dtb.tmp
rm -f /home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/linux-realtek_rtl838x/image-rtl8382_d-link_dgs-1210-16.dtb.tmp
rm -f /home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/linux-realtek_rtl838x/image-rtl8382_allnet_all-sg8208m.dtb.tmp
make[5]: Leaving directory '/home/nnnnn/openwrt/commit_test/target/linux/realtek/image'
make[4]: *** [Makefile:24: install] Error 2
make[4]: Leaving directory '/home/nnnnn/openwrt/commit_test/target/linux/realtek'
make[3]: *** [Makefile:11: install] Error 2
make[3]: Leaving directory '/home/nnnnn/openwrt/commit_test/target/linux'
time: target/linux/install#15.20#4.06#10.43
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:30: target/linux/install] Error 1
make[2]: Leaving directory '/home/nnnnn/openwrt/commit_test'
make[1]: *** [target/Makefile:24: /home/nnnnn/openwrt/commit_test/staging_dir/target-mips_4kec_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/nnnnn/openwrt/commit_test'
make: *** [/home/nnnnn/openwrt/commit_test/include/toplevel.mk:230: world] Error 2
nnnnn@nnnnn-probook-450-g8:~/openwrt/commit_test$ 

And this is a completed build in the same project with the fault fixed and with files in the bin directory, please note the checksum line:

Generating index for package ./lua-rs232_2019-11-20-c106c94d-2_mips_4kec.ipk
Signing package index...
make[2]: Leaving directory '/home/nnnnn/openwrt/commit_test'
export MAKEFLAGS= ;make -w -r json_overview_image_info
make[2]: Entering directory '/home/nnnnn/openwrt/commit_test'
WORK_DIR=/home/nnnnn/openwrt/commit_test/build_dir/target-mips_4kec_musl/json_info_files /home/nnnnn/openwrt/commit_test/scripts/json_overview_image_info.py /home/nnnnn/openwrt/commit_test/bin/targets/realtek/rtl838x/profiles.json 
make[2]: Leaving directory '/home/nnnnn/openwrt/commit_test'
export MAKEFLAGS= ;make -w -r checksum
make[2]: Entering directory '/home/nnnnn/openwrt/commit_test'
make[2]: Leaving directory '/home/nnnnn/openwrt/commit_test'
make[1]: Leaving directory '/home/nnnnn/openwrt/commit_test'
nnnnn@nnnnn-probook-450-g8:~/openwrt/commit_test$

Checking the log file, the errors are not near the end of the file. The last error occurs at line 81643 and log has 120256 line. Also I can see a sha256 file in the bin/target directory. This implies that the build process did complete.

Will try installing the image and see what happens.

1 Like