ci: kernel no sudo

Build kernel without sudo docker this is not needed. This is part 4 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser 2024-05-28 10:03:22 +00:00
parent a7931115a0
commit c95ae5a502
3 changed files with 13 additions and 7 deletions

View File

@ -489,6 +489,7 @@ build_kernel_headers() {
pushd "${kernel_path}" >>/dev/null pushd "${kernel_path}" >>/dev/null
if [ "$linux_headers" == "deb" ]; then if [ "$linux_headers" == "deb" ]; then
export KBUILD_BUILD_USER="${USER}"
make -j $(nproc ${CI:+--ignore 1}) bindeb-pkg ARCH="${arch_target}" make -j $(nproc ${CI:+--ignore 1}) bindeb-pkg ARCH="${arch_target}"
fi fi
if [ "$linux_headers" == "rpm" ]; then if [ "$linux_headers" == "rpm" ]; then

View File

@ -1 +1 @@
130 131

View File

@ -42,30 +42,35 @@ if [ "${CROSS_BUILD}" == "true" ]; then
fi fi
fi fi
sudo docker pull ${container_image} || \ docker pull ${container_image} || \
(sudo docker ${BUILDX} build ${PLATFORM} \ (docker ${BUILDX} build ${PLATFORM} \
--build-arg ARCH=${ARCH} -t "${container_image}" "${script_dir}" && \ --build-arg ARCH=${ARCH} -t "${container_image}" "${script_dir}" && \
# No-op unless PUSH_TO_REGISTRY is exported as "yes" # No-op unless PUSH_TO_REGISTRY is exported as "yes"
push_to_registry "${container_image}") push_to_registry "${container_image}")
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
-w "${PWD}" \ -w "${PWD}" \
--user "$(id -u)":"$(id -g)" \
"${container_image}" \ "${container_image}" \
bash -c "${kernel_builder} ${kernel_builder_args} setup" bash -c "${kernel_builder} ${kernel_builder_args} setup"
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
-w "${PWD}" \ -w "${PWD}" \
--user "$(id -u)":"$(id -g)" \
"${container_image}" \ "${container_image}" \
bash -c "${kernel_builder} ${kernel_builder_args} build" bash -c "${kernel_builder} ${kernel_builder_args} build"
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
-w "${PWD}" \ -w "${PWD}" \
--env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \ --env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \
--user "$(id -u)":"$(id -g)" \
"${container_image}" \ "${container_image}" \
bash -c "${kernel_builder} ${kernel_builder_args} install" bash -c "${kernel_builder} ${kernel_builder_args} install"
sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
-w "${PWD}" \ -w "${PWD}" \
--env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \ --env DESTDIR="${DESTDIR}" --env PREFIX="${PREFIX}" \
--env USER="${USER}" \
--user "$(id -u)":"$(id -g)" \
"${container_image}" \ "${container_image}" \
bash -c "${kernel_builder} ${kernel_builder_args} build-headers" bash -c "${kernel_builder} ${kernel_builder_args} build-headers"