Hi,
I was trying to add GPIO drivers into kernel. i’m using “Variscite DART-6UL” board and the OS version is “BalenaOS 2.98.33+rev1” - Development variant.
I have followed the example of building out-of-tree kernel module (GitHub - balena-os/kernel-module-build: Example project for building an OOT kernel module in balena) and it worked fine. I could insert the hello.ko files into the
kernel. But when i try to add my own source code by following the same folder structure as example module, it’s giving me an error saying “/bin/sh: 1: ./build.sh: Permission denied”
I have my source files in a git repository and my docker_template is as below.
FROM ubuntu:jammy-20220531 as kernel-build
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get update &&
apt-get install -y
awscli
bc
bison
build-essential
curl
flex
git
libelf-dev
libssl-dev
wget
WORKDIR /usr/src/app
Clones the kernel builder repository
RUN git clone https://github.com/xxxxx/kernel-module-build.git .
RUN apt-get -y update
RUN apt-get -y install vim nano
RUN apt-get -y install kmod
You can switch to a specific commit of the kernel builder if you want to ensure consistent builds
git reset --hard f889851c5d00890b51b27c63eaa59a976063265a
Copy your kernel source from your local build context to the build directory
COPY example_module .
Set the name of the directory where you have copied your kernel source in the step above
ENV MOD_DIR “example_module”
Set the balena OS version you intend to use
ENV OS_VERSION ‘2.98.33’
Start the build
RUN BALENA_MACHINE_NAME=%%BALENA_MACHINE_NAME%% ./build.sh build --device imx6ul-var-dart --os-version ‘2.98.33+rev1’ --src example_module
Please let me know anything else that is needed and I appreciate the assistance.