Skip to content

Can't build for OS_VERSION: 5.2.8 #58

@goedonsopjani

Description

@goedonsopjani

this is the dockerfile:

FROM ubuntu:jammy-20220531 as kernel-build

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

RUN apt-get update && \
    apt-get install -y \
    bison \
    build-essential \
    flex \
    libelf-dev \
    libssl-dev \
    wget

WORKDIR /usr/src/app

ARG SRC_DIR=src
ARG OUT_DIR=out
ARG OS_VERSION

COPY src $SRC_DIR/
COPY include include/
COPY build.sh .
COPY load.sh .
COPY workarounds.sh .
RUN ./build.sh -s %%BALENA_MACHINE_NAME%% -v $OS_VERSION -i $SRC_DIR -o $OUT_DIR

FROM alpine

ARG SRC_DIR=src
ARG OUT_DIR=out
ARG OS_VERSION

# Set the location for kernel modules
ARG MOD_PATH=/opt/lib/modules/$OS_VERSION
# Required for access when the container starts
ENV MOD_PATH="$MOD_PATH"

# Copy the built kernel module into your app
COPY --from=kernel-build /usr/src/app/"$OUT_DIR"/"$SRC_DIR"_%%BALENA_MACHINE_NAME%%_"$OS_VERSION" "$MOD_PATH"

# Copy the startup script for loading the modules
COPY --from=kernel-build /usr/src/app/load.sh /usr/src/app/load.sh

# Start the script that loads the modules.
ENTRYPOINT ["sh", "/usr/src/app/load.sh"]

I got the error here: RUN ./build.sh -s %%BALENA_MACHINE_NAME%% -v $OS_VERSION -i $SRC_DIR -o $OUT_DIR

Logs:

[load]     Step 14/23 : RUN ./build.sh -s raspberrypi4-64 -v $OS_VERSION -i $SRC_DIR -o $OUT_DIR
[load]      ---> Running in 7cea94e1b099
[load]     [build.sh][INFO] Building source from src into out/src_raspberrypi4-64_5.2.8 for:
[load]                          OS versions: 5.2.8
[load]                          Device types: raspberrypi4-64
[load]     
[load]     make: Entering directory '/tmp/tmp.635xJF3OgQ'
[load]       SYNC    include/config/auto.conf.cmd
[load]       HOSTCC  scripts/basic/fixdep
[load]       HOSTCC  scripts/kconfig/conf.o
[load]       HOSTCC  scripts/kconfig/confdata.o
[load]       HOSTCC  scripts/kconfig/expr.o
[load]       LEX     scripts/kconfig/lexer.lex.c
[load]       YACC    scripts/kconfig/parser.tab.[ch]
[load]       HOSTCC  scripts/kconfig/lexer.lex.o
[load]       HOSTCC  scripts/kconfig/menu.o
[load]       HOSTCC  scripts/kconfig/parser.tab.o
[load]       HOSTCC  scripts/kconfig/preprocess.o
[load]       HOSTCC  scripts/kconfig/symbol.o
[load]       HOSTCC  scripts/kconfig/util.o
[load]       HOSTLD  scripts/kconfig/conf
[load]       HOSTCC  scripts/dtc/dtc.o
[load]       HOSTCC  scripts/dtc/flattree.o
[load]       HOSTCC  scripts/dtc/fstree.o
[load]       HOSTCC  scripts/dtc/data.o
[load]       HOSTCC  scripts/dtc/livetree.o
[load]       HOSTCC  scripts/dtc/treesource.o
[load]       HOSTCC  scripts/dtc/srcpos.o
[load]       HOSTCC  scripts/dtc/checks.o
[load]       HOSTCC  scripts/dtc/util.o
[load]       LEX     scripts/dtc/dtc-lexer.lex.c
[load]       YACC    scripts/dtc/dtc-parser.tab.[ch]
[load]       HOSTCC  scripts/dtc/dtc-lexer.lex.o
[load]       HOSTCC  scripts/dtc/dtc-parser.tab.o
[load]       HOSTLD  scripts/dtc/dtc
[load]       HOSTCC  scripts/dtc/libfdt/fdt.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_ro.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_wip.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_sw.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_rw.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
[load]       HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
[load]       HOSTCC  scripts/dtc/fdtoverlay.o
[load]       HOSTLD  scripts/dtc/fdtoverlay
[load]       HOSTCC  scripts/genksyms/genksyms.o
[load]       YACC    scripts/genksyms/parse.tab.[ch]
[load]       HOSTCC  scripts/genksyms/parse.tab.o
[load]       LEX     scripts/genksyms/lex.lex.c
[load]       HOSTCC  scripts/genksyms/lex.lex.o
[load]       HOSTLD  scripts/genksyms/genksyms
[load]       HOSTCC  scripts/kallsyms
[load]       HOSTCC  scripts/sorttable
[load]       HOSTCC  scripts/asn1_compiler
[load]       HOSTCC  scripts/extract-cert
[load]       WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/errno.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/ioctls.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/ipcbuf.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/msgbuf.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/poll.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/resource.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/sembuf.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/shmbuf.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/siginfo.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/socket.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/sockios.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/stat.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/swab.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/termbits.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/termios.h
[load]       WRAP    arch/arm64/include/generated/uapi/asm/types.h
[load]       WRAP    arch/arm64/include/generated/asm/early_ioremap.h
[load]       WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
[load]       WRAP    arch/arm64/include/generated/asm/qrwlock.h
[load]       WRAP    arch/arm64/include/generated/asm/qspinlock.h
[load]       WRAP    arch/arm64/include/generated/asm/user.h
[load]       WRAP    arch/arm64/include/generated/asm/bugs.h
[load]       WRAP    arch/arm64/include/generated/asm/delay.h
[load]       WRAP    arch/arm64/include/generated/asm/div64.h
[load]       WRAP    arch/arm64/include/generated/asm/dma-mapping.h
[load]       WRAP    arch/arm64/include/generated/asm/dma.h
[load]       WRAP    arch/arm64/include/generated/asm/emergency-restart.h
[load]       WRAP    arch/arm64/include/generated/asm/hw_irq.h
[load]       WRAP    arch/arm64/include/generated/asm/irq_regs.h
[load]       WRAP    arch/arm64/include/generated/asm/kdebug.h
[load]       WRAP    arch/arm64/include/generated/asm/kmap_size.h
[load]       WRAP    arch/arm64/include/generated/asm/local.h
[load]       WRAP    arch/arm64/include/generated/asm/local64.h
[load]       WRAP    arch/arm64/include/generated/asm/mmiowb.h
[load]       WRAP    arch/arm64/include/generated/asm/msi.h
[load]       WRAP    arch/arm64/include/generated/asm/serial.h
[load]       WRAP    arch/arm64/include/generated/asm/softirq_stack.h
[load]       WRAP    arch/arm64/include/generated/asm/switch_to.h
[load]       WRAP    arch/arm64/include/generated/asm/trace_clock.h
[load]       WRAP    arch/arm64/include/generated/asm/unaligned.h
[load]       WRAP    arch/arm64/include/generated/asm/vga.h
[load]       GEN     arch/arm64/include/generated/asm/cpucaps.h
[load]       CC      scripts/mod/empty.o
[load]       HOSTCC  scripts/mod/mk_elfconfig
[load]       MKELF   scripts/mod/elfconfig.h
[load]       HOSTCC  scripts/mod/modpost.o
[load]       CC      scripts/mod/devicetable-offsets.s
[load]       UPD     scripts/mod/devicetable-offsets.h
[load]       HOSTCC  scripts/mod/file2alias.o
[load]       HOSTCC  scripts/mod/sumversion.o
[load]       HOSTLD  scripts/mod/modpost
[load]       CC      kernel/bounds.s
[load]     /bin/sh: 1: bc: not found
[load]     
[load]     make[1]: *** [Kbuild:24: include/generated/timeconst.h] Error 127
[load]     
[load]     make: *** [Makefile:1255: prepare0] Error 2
[load]     
[load]     make: Leaving directory '/tmp/tmp.635xJF3OgQ'
[load]     Removing intermediate container 7cea94e1b099
[load]     The command '/bin/sh -c ./build.sh -s raspberrypi4-64 -v $OS_VERSION -i $SRC_DIR -o $OUT_DIR' returned a non-zero code: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions