Compile RutOs with Docker and Gitlab-CI

Hello there,

I’d like to automate the compilation of RutOs within my Gitlab environment.
I created a Docker container running ubunty jammy.
This is my Dockerfile:

FROM docker.io/ubuntu:jammy
ENV GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests --yes \
    'ca-certificates' \
    'ca-certificates-java' \
  && \
  apt install --yes \
  build-essential \
  ccache \
  ecj \
  fastjar \
  file \
  flex \
  g++ \
  gawk \
  gettext \
  git \
  java-propose-classpath \
  java-wrappers \
  jq \
  libelf-dev \
  libffi-dev \
  libncurses5-dev \
  libncursesw5-dev \
  libssl-dev \
  libtool \
  python2.7-dev \
  python3 \
  python3-dev \
  python3-distutils \
  python3-setuptools \
  rsync \
  subversion \
  swig \
  time u-boot-tools \
  unzip \
  wget \
  xsltproc \
  zlib1g-dev \
  bison \
  nodejs \
  npm \
  liblz4-tool \
  && \
  rm -f -r '/var/lib/apt/' && \
  rm -f -r '/var/cache/apt/' && \
  useradd -m -s '/bin/bash' buildbot

USER buildbot
WORKDIR /workdir

These are the commands I use to compile within the docker container:

cd rutos-mdm9x07-trb1-gpl
./scripts/feeds update -a
make oldconfig
make -j1 V=s > /builds/make.log

I can compile, but not with multiple CPUs. It stopps then in random places.
With j1, though it works fine. I could live with that.

My problem is that it does not run at all anymore, when I try to use gitlab-CI. I dont really understand whats going wrong. The compilation of vuci package fails. Apparently some Teltonika related stuff is missing, which it doesnt when compiling manually in the same docker container.

Side note: I can successfully compile an official openWRT image that way, no problem.

I’m providing here a small piece of my build log, I cant upload the entire file, as I am a new user and the entries here can only be 32k characters.

install -d -m0755 /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/bin/packages/arm_cortex-a7_neon-vfpv4/vuci
/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/host/bin/fakeroot /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/scripts/ipkg-build -m "" /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-ui-core-2023-07-18-2d88efef79/ipkg-arm_cortex-a7_neon-vfpv4/vuci-ui-core /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/bin/packages/arm_cortex-a7_neon-vfpv4/vuci
/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/host/bin/find: '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-ui-core-2023-07-18-2d88efef79/ipkg-arm_cortex-a7_neon-vfpv4/vuci-ui-core/etc/config/widget': No such file or directory
Packaged contents of /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-ui-core-2023-07-18-2d88efef79/ipkg-arm_cortex-a7_neon-vfpv4/vuci-ui-core into /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/bin/packages/arm_cortex-a7_neon-vfpv4/vuci/vuci-ui-core_2023-07-18-2d88efef79-2_arm_cortex-a7_neon-vfpv4.ipk
echo "vuci-ui-core" >> /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pkginfo/vuci-ui-core.default.install
make[3]: Leaving directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/package/feeds/vuci/vuci-ui-core'
time: package/feeds/vuci/vuci-ui-core/compile#1.06#1.08#2.21
make[3]: Entering directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/package/feeds/vuci/vuci-app-access-control-ui'
touch /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.prepared_5765bdd70066bf7decd69c4c260671f5_6664517399ebbbc92a37c5bb081b5c53_check
touch /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.prepared_5765bdd70066bf7decd69c4c260671f5_6664517399ebbbc92a37c5bb081b5c53
rm -f /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.configured_*
rm -f /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.vuci-app-access-control-ui_installed
touch /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.built
touch /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.built_check
if [[ -d ./files ]]; then cp -fpR ./files/ /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/ ; fi
CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui=vuci-app-access-control-ui -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include -DTRB1_PLATFORM -DSINGLE_ETH_PORT -DMOBILE_SUPPORT     -DIO_SUPPORT -DBASEBAND_SUPPORT  " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui=vuci-app-access-control-ui -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include -DTRB1_PLATFORM -DSINGLE_ETH_PORT -DMOBILE_SUPPORT     -DIO_SUPPORT -DBASEBAND_SUPPORT  " LDFLAGS="-L/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/lib -L/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/lib -znow -zrelro " make -j1 -C /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui=vuci-app-access-control-ui -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" vuci-app-access-control-ui;  
make[4]: Entering directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui'
make[4]: *** No rule to make target 'vuci-app-access-control-ui'.  Stop.
make[4]: Leaving directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui'
make[3]: *** [../app.mk:89: /builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-app-access-control-ui/.built] Error 2
make[3]: Leaving directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/package/feeds/vuci/vuci-app-access-control-ui'
time: package/feeds/vuci/vuci-app-access-control-ui/compile#0.23#0.16#0.36
    ERROR: package/feeds/vuci/vuci-app-access-control-ui failed to build.
make[2]: Leaving directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl'
make[1]: Leaving directory '/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl'

I hope, someone has an idea, what’s going wrong.

Best, David

Hello,

The main issue here seems to be

'/builds/external/devices/openwrt/sdks/teltonika-trb1/rutos-mdm9x07-trb1-gpl/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/vuci-ui-core-2023-07-18-2d88efef79/ipkg-arm_cortex-a7_neon-vfpv4/vuci-ui-core/etc/config/widget': No such file or directory

Could you try running make clean and check if the issue replicates? Ideally, as many directories as possible should be re-compiled using the table provided here: https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#cleaning_up
Just in case you are following the instructions on the Wiki page, and not the README file, we provide different instructions for compiling on Docker and Host OS. The particular instructions for docker are as follows:

## Building with Docker environment

	1. Install Docker (https://docs.docker.com/engine/install/ubuntu).

	2. Extract the GPL archive to an empty folder

		$ mkdir TRB1_R_GPL_00.07.05
		$ tar -xzf ~/Downloads/TRB1_R_GPL_00.07.05.tar.gz -C TRB1_R_GPL_00.07.05

	3. Update feeds

		$ cd TRB1_R_GPL_00.07.05
		$ ./scripts/dockerbuild ./scripts/feeds update -a

	4. Build the image

		$ ./scripts/dockerbuild make

In case that does not help, perhaps someone from our community more experienced in development could help you out.

Best regards,

This topic was automatically closed after 15 days. New replies are no longer allowed.