gmp.h not found when building kernel-modules-headers in balena-raspberrypi

Hi all,

When doing the Yocto environment setup everything seems ot be in working order and a

bitbake core-image-sato

results in a image possible to run

runqemu qemux86

starts /poky/build/tmp/deploy/images/qemux86-64/bzImage–5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20220502165114.bin
and everything seems to be working in order so the Yocto environment setup seems to be ok.

Then when trying to build a balenaOS raspberrypi3 I have to add the following
do a git config to force https instead of git since all parts of the build script not yet seems to be updated according to githubs requirements

git config --global url.“https://”.insteadOf git://

Additional packages needed

npm, jq, liblz4-tool, zstd, docker.io

build user needs to be added to docker group

sudo usermod -aG docker $USER

But when I then run

./balena-yocto-scripts/build/barys -m raspberrypi3

I get the error below.

What might be the cause of fatal error: gmp.h: No such file or directory? Is the original error something else?
Have I missed some setup step?

ERROR: kernel-modules-headers-1.0-r0 do_compile: ExecutionError(‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/run.do_compile.24166’, 2, None, None)
ERROR: Logfile of failure stored in: /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/log.do_compile.24166
Log data follows:
| DEBUG: Executing shell function do_compile
| Running modules_prepare…
| make[1]: Entering directory ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/kernel_modules_headers’
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:645: include/config/auto.conf: No such file or directory
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:689: include/config/auto.conf.cmd: No such file or directory
| SYNC include/config/auto.conf.cmd
| GEN Makefile
| HOSTCC scripts/basic/fixdep
| HOSTCC scripts/kconfig/conf.o
| HOSTCC scripts/kconfig/confdata.o
| HOSTCC scripts/kconfig/expr.o
| LEX scripts/kconfig/lexer.lex.c
| YACC scripts/kconfig/parser.tab.[ch]
| HOSTCC scripts/kconfig/lexer.lex.o
| HOSTCC scripts/kconfig/parser.tab.o
| HOSTCC scripts/kconfig/preprocess.o
| HOSTCC scripts/kconfig/symbol.o
| HOSTCC scripts/kconfig/util.o
| HOSTLD scripts/kconfig/conf
| *
| * Restart config…
| *
| *
| * Kernel Features
| *
| Symmetric Multi-Processing (SMP) [Y/n/?] y
| Allow booting SMP kernel on uniprocessor systems (SMP_ON_UP) [Y/n/?] y
| Support cpu topology definition (ARM_CPU_TOPOLOGY) [Y/n/?] y
| Multi-core scheduler support (SCHED_MC) [N/y/?] n
| SMT scheduler support (SCHED_SMT) [N/y/?] n
| Architected timer support (HAVE_ARM_ARCH_TIMER) [Y/?] y
| Multi-Cluster Power Management (MCPM) [N/y/?] n
| big.LITTLE support (Experimental) (BIG_LITTLE) [N/y/?] n
| Memory split
| 1. 3G/1G user/kernel split (VMSPLIT_3G)
| 2. 3G/1G user/kernel split (for full 1G low memory) (VMSPLIT_3G_OPT)
| > 3. 2G/2G user/kernel split (VMSPLIT_2G)
| 4. 1G/3G user/kernel split (VMSPLIT_1G)
| choice[1-4?]: 3
| Maximum number of CPUs (2-32) (NR_CPUS) [4] 4
| Support for hot-pluggable CPUs (HOTPLUG_CPU) [Y/?] y
| Support for the ARM Power State Coordination Interface (PSCI) (ARM_PSCI) [N/y/?] n
| Timer frequency
| > 1. 100 Hz (HZ_100)
| 2. 200 Hz (HZ_200)
| 3. 250 Hz (HZ_250)
| 4. 300 Hz (HZ_300)
| 5. 500 Hz (HZ_500)
| 6. 1000 Hz (HZ_1000)
| choice[1-6?]: 1
| Compile the kernel in Thumb-2 mode (THUMB2_KERNEL) [N/y/?] n
| Runtime patch udiv/sdiv instructions into _aeabi{u}idiv() (ARM_PATCH_IDIV) [Y/n/?] y
| Use the ARM EABI to compile the kernel (AEABI) [Y/?] y
| Allow old ABI binaries to run with this kernel (EXPERIMENTAL) (OABI_COMPAT) [N/y/?] n
| High Memory Support (HIGHMEM) [N/y/?] n
| Enable use of CPU domains to implement privileged no-access (CPU_SW_DOMAIN_PAN) [N/y/?] n
| Use PLTs to allow module memory to spill over into vmalloc area (ARM_MODULE_PLTS) [Y/n/?] y
| Maximum zone order (FORCE_MAX_ZONEORDER) [11] 11
| Use kernel mem{cpy,set}() for {copy_to,clear}_user() (UACCESS_WITH_MEMCPY) [Y/n/?] y
| Enable paravirtualization code (PARAVIRT) [N/y/?] n
| Paravirtual steal time accounting (PARAVIRT_TIME_ACCOUNTING) [N/y/?] n
| Xen guest support on ARM (XEN) [N/y/?] n
| Use a unique stack canary value for each task (STACKPROTECTOR_PER_TASK) [Y/n/?] (NEW)
| Error in reading or end of file.
|
| *
| * GCC plugins
| *
| GCC plugins (GCC_PLUGINS) [Y/n/?] (NEW)
| Error in reading or end of file.
|
| Compute the cyclomatic complexity of a function (GCC_PLUGIN_CYC_COMPLEXITY) [N/y/?] (NEW)
| Error in reading or end of file.
|
| Generate some entropy during boot and runtime (GCC_PLUGIN_LATENT_ENTROPY) [N/y/?] (NEW)
| Error in reading or end of file.
|
| Randomize layout of sensitive kernel structures (GCC_PLUGIN_RANDSTRUCT) [N/y/?] (NEW)
| Error in reading or end of file.
|
| *
| * Memory initialization
| *
| Initialize kernel stack variables at function entry
| > 1. no automatic initialization (weakest) (INIT_STACK_NONE)
| 2. zero-init structs marked for userspace (weak) (GCC_PLUGIN_STRUCTLEAK_USER) (NEW)
| 3. zero-init structs passed by reference (strong) (GCC_PLUGIN_STRUCTLEAK_BYREF) (NEW)
| 4. zero-init anything passed by reference (very strong) (GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) (NEW)
| choice[1-4?]:
| Error in reading or end of file.
| Enable heap memory zeroing on allocation by default (INIT_ON_ALLOC_DEFAULT_ON) [N/y/?] n
| Enable heap memory zeroing on free by default (INIT_ON_FREE_DEFAULT_ON) [N/y/?] n
| GEN Makefile
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-common.h
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-oabi.h
| SYSHDR arch/arm/include/generated/uapi/asm/unistd-eabi.h
| HOSTCC scripts/dtc/dtc.o
| HOSTCC scripts/dtc/flattree.o
| HOSTCC scripts/dtc/fstree.o
| HOSTCC scripts/dtc/data.o
| HOSTCC scripts/dtc/livetree.o
| HOSTCC scripts/dtc/treesource.o
| HOSTCC scripts/dtc/srcpos.o
| HOSTCC scripts/dtc/checks.o
| HOSTCC scripts/dtc/util.o
| LEX scripts/dtc/dtc-lexer.lex.c
| YACC scripts/dtc/dtc-parser.tab.[ch]
| HOSTCC scripts/dtc/dtc-lexer.lex.o
| HOSTCC scripts/dtc/dtc-parser.tab.o
| HOSTLD scripts/dtc/dtc
| HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so
| In file included from /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/…/…/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/plugin/include/gcc-plugin.h:28:0,
| from /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/gcc-common.h:7,
| from /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
| /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/…/…/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/plugin/include/system.h:698:10: fatal error: gmp.h: No such file or directory
| #include <gmp.h>
| ^~~~~~~
| compilation terminated.
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/gcc-plugins/Makefile:47: recipe for target ‘scripts/gcc-plugins/arm_ssp_per_task_plugin.so’ failed
| make[3]: *** [scripts/gcc-plugins/arm_ssp_per_task_plugin.so] Error 1
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/scripts/Makefile.build:497: recipe for target ‘scripts/gcc-plugins’ failed
| make[2]: *** [scripts/gcc-plugins] Error 2
| /home/jonas/balena-raspberrypi/build/tmp/work-shared/raspberrypi3/kernel-source/Makefile:1199: recipe for target ‘scripts’ failed
| make[1]: *** [scripts] Error 2
| make[1]: Leaving directory ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/kernel_modules_headers’
| Makefile:185: recipe for target ‘__sub-make’ failed
| make: *** [__sub-make] Error 2
| WARNING: exit code 2 from a shell command.
ERROR: Task (/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 3969 tasks of which 0 didn’t need to be rerun and 1 failed.

Summary: 1 task failed:
/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_compile
Summary: There were 12 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[000006644][LOG]Build for raspberrypi3 failed. Check failed log in build/tmp/log/cooker/raspberrypi3 .
[000006644][LOG]If build for raspberrypi3 succeeded, final image should have been generated here:
[000006644][LOG] build/tmp/deploy/images/raspberrypi3/balena-image-raspberrypi3.balenaos-img
[000006644][LOG]Done.

is this the updated version of raspberry pie

Hi @jonke,

Which OS are you running the build from? Also, can you check if libgmp3-dev is available among the other dependencies. Missing this might lead to gmp.h missing error.

Regards,
Nitish

Hi @nitish,

Thanks for your help.

I’m currently running the build from Ubuntu 18.04 LTS. Do you have a preferred dist I should build from?

libgmp3-dev was not installed and after I installed it and built again I did get a similar error with

#include <mpc.h>

so I did

apt install libmpc-dev

and got past it.

Now I get another type of error but I guess I’m still is missing a dependency or?

Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 39 Local 0 Network 0 Missed 39 Current 1793 (0% match, 97% complete)
Removing 9 stale sstate objects for arch raspberrypi3: 100% |#################################################################################################| Time: 0:00:00
Removing 3 stale sstate objects for arch x86_64: 100% |#######################################################################################################| Time: 0:00:00
NOTE: Executing Tasks
ERROR: kernel-modules-headers-1.0-r0 do_package: Fatal errors occurred in subprocesses:
Command ‘[‘arm-poky-linux-gnueabi-objcopy’, ‘–only-keep-debug’, ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/arm_ssp_per_task_plugin.so’, ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/.debug/arm_ssp_per_task_plugin.so’]’ returned non-zero exit status 1.
Subprocess output:arm-poky-linux-gnueabi-objcopy: /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/arm_ssp_per_task_plugin.so: file format not recognized

ERROR: Logfile of failure stored in: /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/log.do_package.30333
ERROR: Task (/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_package) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 4337 tasks of which 4303 didn’t need to be rerun and 1 failed.

Summary: 1 task failed:
/home/jonas/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-devtools/kernel-modules-headers/kernel-modules-headers.bb:do_package
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[000000304][LOG]Build for raspberrypi3 failed. Check failed log in build/tmp/log/cooker/raspberrypi3 .
[000000304][LOG]If build for raspberrypi3 succeeded, final image should have been generated here:
[000000304][LOG] build/tmp/deploy/images/raspberrypi3/balena-image-raspberrypi3.balenaos-img
[000000304][LOG]Done.

Content of /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/log.do_package.30333

DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are [‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-core/util-linux/util-linux_2.37.2.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/rpm/rpm_4.16.1.3.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/bison/bison_3.7.6.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-core/glibc/glibc_2.34.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-core/util-linux/util-linux_2.37.2.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-connectivity/openssl/openssl_1.1.1l.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/gcc/gcc-cross_11.2.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.10.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot’, ‘/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-connectivity/openssl/openssl_1.1.1l.bb:do_populate_sysroot’, ‘virtual:native:/home/jonas/balena-raspberrypi/build/…/layers/poky/meta/recipes-devtools/dwarfsrcfiles/dwarfsrcfiles.bb:do_populate_sysroot’]
NOTE: Installed into sysroot: [‘rpm-native’, ‘dwarfsrcfiles-native’, ‘file-native’, ‘popt-native’]
NOTE: Skipping as already exists in sysroot: [‘elfutils’, ‘util-linux-native’, ‘gcc-runtime’, ‘quilt-native’, ‘bison-native’, ‘glibc’, ‘elfutils-native’, ‘util-linux’, ‘openssl-native’, ‘patch-native’, ‘gcc-cross-arm’, ‘pseudo-native’, ‘bc-native’, ‘linux-raspberrypi’, ‘kern-tools-native’, ‘openssl’, ‘libarchive’, ‘sqlite3’, ‘zlib’, ‘curl’, ‘libmicrohttpd’, ‘gettext-minimal-native’, ‘ncurses-native’, ‘xz-native’, ‘libpcre2-native’, ‘pkgconfig-native’, ‘autoconf-native’, ‘libcap-ng-native’, ‘util-linux-libuuid-native’, ‘automake-native’, ‘zlib-native’, ‘libtool-native’, ‘db-native’, ‘bzip2-native’, ‘python3-native’, ‘libgcrypt-native’, ‘libgcc’, ‘linux-libc-headers’, ‘texinfo-dummy-native’, ‘flex-native’, ‘libmicrohttpd-native’, ‘curl-native’, ‘libarchive-native’, ‘sqlite3-native’, ‘util-linux-libuuid’, ‘bash-completion’, ‘libxcrypt’, ‘opkg-utils’, ‘libcap-ng’, ‘ncurses’, ‘attr-native’, ‘binutils-cross-arm’, ‘gnu-config-native’, ‘libmpc-native’, ‘mpfr-native’, ‘gmp-native’, ‘readline-native’, ‘xz’, ‘zstd’, ‘bzip2’, ‘attr’, ‘lzo’, ‘acl’, ‘libidn2’, ‘libgcrypt’, ‘gnutls’, ‘file’, ‘m4-native’, ‘libnsl2-native’, ‘libtirpc-native’, ‘gdbm-native’, ‘libffi-native’, ‘libgpg-error-native’, ‘libcap-native’, ‘gnutls-native’, ‘lzo-native’, ‘zstd-native’, ‘e2fsprogs-native’, ‘systemd-systemctl-native’, ‘update-rc.d-native’, ‘shadow-native’, ‘qemu-native’, ‘opkg-utils-native’, ‘depmodwrapper-cross’, ‘kmod-native’, ‘debianutils-native’, ‘shared-mime-info-native’, ‘libunistring’, ‘libgpg-error’, ‘libcap’, ‘gmp’, ‘nettle’, ‘libseccomp’, ‘gperf-native’, ‘nettle-native’, ‘gtk-doc-native’, ‘libunistring-native’, ‘libidn2-native’, ‘meson-native’, ‘glib-2.0-native’, ‘ninja-native’, ‘perl-native’, ‘libxml2-native’, ‘xmlto-native’, ‘itstool-native’, ‘python3-setuptools-native’, ‘libpcre-native’, ‘gettext-native’, ‘re2c-native’, ‘perlcross-native’, ‘docbook-xsl-stylesheets-native’, ‘libxslt-native’, ‘docbook-xml-dtd4-native’]
DEBUG: sed -e ‘s:[1]*/:/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native/:g’ /home/jonas/balena-raspberrypi/build/tmp/sysroots-components/x86_64/rpm-native/fixmepath | xargs sed -i -e ‘s:FIXMESTAGINGDIRTARGET:/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot:g; s:FIXMESTAGINGDIRHOST:/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/recipe-sysroot-native:g’ -e ‘s:FIXME_PSEUDO_SYSROOT:/home/jonas/balena-raspberrypi/build/tmp/sysroots-components/x86_64/pseudo-native:g’ -e ‘s:FIXME_HOSTTOOLS_DIR:/home/jonas/balena-raspberrypi/build/tmp/hosttools:g’ -e ‘s:FIXME_PKGDATA_DIR:/home/jonas/balena-raspberrypi/build/tmp/pkgdata/raspberrypi3:g’ -e ‘s:FIXME_PSEUDO_LOCALSTATEDIR:/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/pseudo/:g’ -e ‘s:FIXME_LOGFIFO:/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/temp/fifo.30333:g’
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_package
DEBUG: Executing python function package_convert_pr_autoinc
DEBUG: Python function package_convert_pr_autoinc finished
DEBUG: Executing python function package_prepare_pkgdata
NOTE: Installed into pkgdata-sysroot: [‘elfutils’, ‘glibc’, ‘util-linux’, ‘openssl’, ‘linux-raspberrypi’, ‘gcc-runtime’, ‘db’, ‘systemd-conf’, ‘glib-2.0’, ‘libcap’, ‘tpm2-abrmd’, ‘mtools’, ‘libgcrypt’, ‘balena-ntp-config’, ‘shadow’, ‘acl’, ‘libxml2’, ‘cryptsetup’, ‘libdevmapper’, ‘libedit’, ‘shared-mime-info’, ‘mdadm’, ‘kexec-tools’, ‘autoconf-archive’, ‘tpm2-tss’, ‘chrony’, ‘balena-keys’, ‘libnsl2’, ‘update-rc.d’, ‘tar’, ‘libaio’, ‘libgcc’, ‘util-linux-libuuid’, ‘busybox’, ‘coreutils’, ‘libunistring’, ‘perl’, ‘sqlite3’, ‘libseccomp’, ‘linux-libc-headers’, ‘bash-completion’, ‘bzip2’, ‘json-c’, ‘base-files’, ‘libtirpc’, ‘kmod’, ‘shadow-securetty’, ‘systemd-serialgetty’, ‘ca-certificates’, ‘pps-tools’, ‘tpm2-tools’, ‘glibc-locale’, ‘lvm2’, ‘os-release’, ‘libxcrypt’, ‘kbd’, ‘expat’, ‘run-postinsts’, ‘libpcre’, ‘parted’, ‘libidn2’, ‘libffi’, ‘libgpg-error’, ‘systemd-compat-units’, ‘base-passwd’, ‘dosfstools’, ‘dbus’, ‘gmp’, ‘zlib’, ‘ncurses’, ‘opkg-utils’, ‘os-helpers’, ‘readline’, ‘gdbm’, ‘libcap-ng’, ‘e2fsprogs’, ‘bash’, ‘systemd’, ‘volatile-binds’, ‘gawk’, ‘curl’, ‘initramfs-framework’, ‘python3’, ‘popt’, ‘periodic-vacuum-logs’, ‘zstd’, ‘xz’, ‘attr’, ‘findutils’, ‘qemuwrapper-cross’, ‘libmicrohttpd’, ‘libarchive’, ‘gnutls’, ‘file’, ‘lzo’, ‘nettle’]
DEBUG: Python function package_prepare_pkgdata finished
DEBUG: Executing python function perform_packagecopy
DEBUG: Python function perform_packagecopy finished
DEBUG: Executing python function split_and_strip_files
ERROR: Fatal errors occurred in subprocesses:
Command ‘[‘arm-poky-linux-gnueabi-objcopy’, ‘–only-keep-debug’, ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/arm_ssp_per_task_plugin.so’, ‘/home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/.debug/arm_ssp_per_task_plugin.so’]’ returned non-zero exit status 1.
Subprocess output:arm-poky-linux-gnueabi-objcopy: /home/jonas/balena-raspberrypi/build/tmp/work/raspberrypi3-poky-linux-gnueabi/kernel-modules-headers/1.0-r0/package/usr/src/kernel-hdrs/scripts/gcc-plugins/arm_ssp_per_task_plugin.so: file format not recognized

DEBUG: Python function split_and_strip_files finished
DEBUG: Python function do_package finished


  1. ^/ ↩︎

I got balenaOS building by

remove libgmp3-dev and libmpc-dev since I guess they should not be needed

sudo apt remove libgmp3-dev libmpc-dev

Reverted to v2.95.8 (Last released and maybe last building version for Balena Fin (CM3) as of now?)

git checkout v2.95.8

git submodule update --init --recursive

./balena-yocto-scripts/build/barys -m fincm3

And now everything builds. Note that I have not tested the built image yet but it is building.

Hi, I am glad that it is now working. For the future, we provide a containerized build process that you can use to avoid this type of host dependencies problems. You can do this with the balena-build.sh script in balena-yocto-scripts/balena-build.sh at fe688d2bfbb121401830ec804fa423619048a224 · balena-os/balena-yocto-scripts · GitHub

./build/balena-build.sh -d raspberrypi3

Should also work.

Hi @alexgg

When I try to run

./build/balena-build.sh -d raspberrypi3

jonas@jonas-VirtualBox:~/sandbox/balena-raspberrypi/balena-yocto-scripts$ ./build/balena-build.sh -d raspberrypi3
[balena_lib_environment]: Defaulting to balena-cloud.com
jonas@jonas-VirtualBox:~/sandbox/balena-raspberrypi/balena-yocto-scripts$

It stops directly

If I add

            echo "before"
            _token="${_token:-$(balena_lib_token "${_api_env}")}"
            echo "after"

jonas@jonas-VirtualBox:~/sandbox/balena-raspberrypi/balena-yocto-scripts$ ./build/balena-build.sh -d raspberrypi3
[balena_lib_environment]: Defaulting to balena-cloud.com
before
jonas@jonas-VirtualBox:~/sandbox/balena-raspberrypi/balena-yocto-scripts$

I’m not that familiar with bash scripts but what might be the reason for this?

What Linux distro should I be using? Ubuntu, CentOS, Gentoo, Slackware or?

Hi @alexgg

After a reboot of my build machine I can’t recreate the problem with

_token="${_token:-$(balena_lib_token "${_api_env}")}"

So it think it had something to do with my shell and what I had previously done in it.

Hi @alexgg

Thanks for the information about

./build/balena-build.sh

Now everything build and runs just fine with balenaOS version v2.98.23 even with my own device tree’s pin settings.

Maybe the “Building your Own” page should have some information about the script?

Glad it helped, will note your suggestion on improving the documentation.