c – Braiins OS won’t build

There’s no way to build Braiins OS from the source. we tried bb.py, the docker guideline, and building bosminer with cargo, and calling the lede make file on branches firmware_latest and bos_release. with each of the methods we ended up in errors. the errors and exceptions we’ve got are as follows.

1. Running docker builder

the guideline we went through is the official website

Commands executed

  1. cd braiins/braiins-os
  2. ./docker/build-docker-container.sh
  3. ./docker/build-in-docker.sh zynq-am1-s9

Errors and exceptions

INFO:root:Preparing LEDE build system...
-- prepare:default_config
.  prepare:config
scripts/config/conf: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.27' not found (required by scripts/config/conf)
/src/braiins-os/build/zynq/lede/include/toplevel.mk:114: recipe for target 'defconfig' failed
make: *** [defconfig] Error 1
TaskError - taskid:prepare:config
PythonAction Error
Traceback (most recent call last):
  File "/home/build/.local/lib/python3.5/site-packages/doit/action.py", line 424, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/src/braiins-os/builder/dodo.py", line 50, in <lambda>
    task.update({'actions': [lambda: next(generator, None)]})
  File "/src/braiins-os/builder/builder.py", line 1020, in prepare_config_doit
    self._run('make', 'defconfig')
  File "/src/braiins-os/builder/builder.py", line 565, in _run
    process = subprocess.run(args, input=input, stdout=stdout, check=True, cwd=cwd, env=env, preexec_fn=init)
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('make', 'defconfig')' returned non-zero exit status 2
INFO:root:Preparing LEDE build system..
.  prepare:config
scripts/config/conf: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.27' not found (required by scripts/config/conf)
/src/braiins-os/build/zynq/lede/include/toplevel.mk:114: recipe for target 'defconfig' failed
make: *** [defconfig] Error 1
TaskError - taskid:prepare:config
PythonAction Error
Traceback (most recent call last):
  File "/home/build/.local/lib/python3.5/site-packages/doit/action.py", line 424, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/src/braiins-os/builder/dodo.py", line 50, in <lambda>
    task.update({'actions': [lambda: next(generator, None)]})
  File "/src/braiins-os/builder/builder.py", line 1020, in prepare_config_doit
    self._run('make', 'defconfig')
  File "/src/braiins-os/builder/builder.py", line 565, in _run
    process = subprocess.run(args, input=input, stdout=stdout, check=True, cwd=cwd, env=env, preexec_fn=init)
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('make', 'defconfig')' returned non-zero exit status 2
INFO:root:Start cleaning LEDE build directory...'
scripts/config/mconf: error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
/src/braiins-os/build/zynq/lede/include/toplevel.mk:127: recipe for target 'menuconfig' failed
make[1]: *** [menuconfig] Error 127
make[1]: Leaving directory '/src/braiins-os/build/zynq/lede'
/src/braiins-os/build/zynq/lede/include/toplevel.mk:94: recipe for target '.config' failed
make: *** [.config] Error 2
Traceback (most recent call last):
  File "./bb.py", line 370, in <module>
    main(sys.argv[1:])
  File "./bb.py", line 364, in main
    args.func()
  File "./bb.py", line 119, in clean
    builder.clean(purge=self._args.purge)
  File "/src/braiins-os/builder/builder.py", line 1109, in clean
    self._run('make', 'clean')
  File "/src/braiins-os/builder/builder.py", line 565, in _run
    process = subprocess.run(args, input=input, stdout=stdout, check=True, cwd=cwd, env=env, preexec_fn=init)
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('make', 'clean')' returned non-zero exit status 2

to simplify the log I have removed the successful steps. please let me know if you need them.

Steps taken

  1. installed lib32z1 and libncurses5

2. Running bb.py

we learned from the source that to debug we can add the log flag. and it revealed bb.py is calling a problematic make file located in zynq/lede

Commands executed

  1. python3.5 bb.py --log debug build

Errors and exceptions

DEBUG:root:Run 'make defconfig' in '/home/max/rust/braiins/braiins-os/build/zynq/lede'
#
# configuration written to .config
#
-- prepare:public_key
-- prepare:secret_key
INFO:root:Start building LEDE...'
DEBUG:root:Run 'make -j4' in '/home/max/rust/braiins/braiins-os/build/zynq/lede'
 make[1] world
 make[2] tools/install
 make[2] package/cleanup
 make[3] -C tools/flock compile
 make[3] -C tools/flock install
 make[3] -C tools/sed compile
 make[3] -C tools/sed install
 make[3] -C tools/xz compile
 make[3] -C tools/patch compile
 make[3] -C tools/tar compile
 make[3] -C tools/xz install
 make[3] -C tools/patch install
 make[3] -C tools/tar install
 make[3] -C tools/m4 compile
 make[3] -C tools/expat compile
 make[3] -C tools/pkg-config compile
 make[3] -C tools/sstrip compile
 make[3] -C tools/make-ext4fs compile
 make[3] -C tools/patch-image compile
 make[3] -C tools/scons compile
 make[3] -C tools/mtools compile
 make[3] -C tools/lzma compile
 make[3] -C tools/squashfs4 compile
 make[3] -C tools/pkg-config install
 make[3] -C tools/expat install
 make[3] -C tools/sstrip install
 make[3] -C tools/make-ext4fs install
make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
make: *** [/home/max/rust/braiins/braiins-os/build/zynq/lede/include/toplevel.mk:200: world] Error 1
Traceback (most recent call last):
  File "bb.py", line 370, in <module>
    main(sys.argv[1:])
  File "bb.py", line 364, in main
    args.func()
  File "bb.py", line 139, in build
    builder.build(targets=self._args.target)
  File "/home/max/rust/braiins/braiins-os/builder/builder.py", line 1159, in build
    self._run(args, path=path, init=partial(os.umask, 0o0022))
  File "/home/max/rust/braiins/braiins-os/builder/builder.py", line 565, in _run
    process = subprocess.run(args, input=input, stdout=stdout, check=True, cwd=cwd, env=env, preexec_fn=init)
  File "/home/max/.anaconda3/envs/bos/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', '-j4']' returned non-zero exit status 2

3. Calling lede make file manually

from bb.py with --log debug it got transparent that a make file located in braiins/braiins-os/build/zynq/lede is broken. so we executed that manually to see the logs.

Commands executed

  1. cd braiins/braiins-os/build/zynq/lede
  2. make -j1 V=s

Errors and exceptions

freadahead.c: In function 'freadahead':
freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   91 |  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
      |   ^~~~~
make[7]: *** [Makefile:1837: freadahead.o] Error 1
make[7]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede/build_dir/host/m4-1.4.17/lib'
make[6]: *** [Makefile:1602: all] Error 2
make[6]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede/build_dir/host/m4-1.4.17/lib'
make[5]: *** [Makefile:1506: all-recursive] Error 1
make[5]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede/build_dir/host/m4-1.4.17'
make[4]: *** [Makefile:1461: all] Error 2
make[4]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede/build_dir/host/m4-1.4.17'
make[3]: *** [Makefile:29: /home/max/rust/braiins/braiins-os/build/zynq/lede/build_dir/host/m4-1.4.17/.built] Error 2
make[3]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede/tools/m4'
make[2]: *** [tools/Makefile:148: tools/m4/compile] Error 2
make[2]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede'
make[1]: *** [tools/Makefile:145: /home/max/rust/braiins/braiins-os/build/zynq/lede/staging_dir/target-arm_cortex-a9+neon_musl-1.1.16_eabi/stamp/.tools_install_yynyyyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynyynynnyyynnny] Error 2
make[1]: Leaving directory '/home/max/rust/braiins/braiins-os/build/zynq/lede'
make: *** [/home/max/rust/braiins/braiins-os/build/zynq/lede/include/toplevel.mk:200: world] Error 2

Steps taken

  1. installed m4 to resolve freadahead.c but it didn’t work

4. Building Rust with cargo

the Rust codes builds on a local machine that does not set a target with no problem. but when it comes to target arm-unknown-linux-musleabieverything breaks.

Commands executed

  1. downloaded arm-linux-musleabihf-cross from musl.cc
  2. CC=/home/max/Downloads/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc cargo build --release --target arm-unknown-linux-musleabi

Errors and exceptions

error: linker `arm-openwrt-linux-muslgnueabi-gcc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `bosminer-erupter` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

Platform

OS: Ubuntu 20.04.3 LTS

cargo: cargo 1.60.0 (d1fd9fe 2022-03-01)

rustup: rustup 1.24.3 (ce5817a94 2021-05-31)

python: Python 3.5.6 :: Anaconda, Inc.

I am eagerly looking for advice for resolving this matter. thank you very much.

Leave a Comment