Added triple choice for kernel : build download or uselocal

This commit is contained in:
Vidal Gerard
2025-10-29 16:48:35 +01:00
parent 698e9d4398
commit a3cae20caa
2 changed files with 22 additions and 10 deletions

View File

@@ -14,7 +14,9 @@ if [ "$ENABLE_NEXMON" = true ] ; then
fi
# Fetch and build latest raspberry kernel
if [ "$BUILD_KERNEL" = true ] ; then
case "$BUILD_KERNEL" in
"build")
#if [ "$BUILD_KERNEL" = build ] ; then
# Setup source directory
mkdir -p "${KERNEL_DIR}"
@@ -798,7 +800,9 @@ if [ "$BUILD_KERNEL" = true ] ; then
chroot_exec ln -sf /usr/src/linux "/lib/modules/${KERNEL_VERSION}/source"
fi
fi
;;
"download")
else # BUILD_KERNEL=false
if [ "$SET_ARCH" = 64 ] ; then
if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
@@ -875,12 +879,20 @@ else # BUILD_KERNEL=false
rm -fr "${temp_dir}"
rm -f "${R}"/tmp/kernel.deb
fi
# Check if kernel installation was successful
KERNEL="$(ls -1 "${R}"/boot/firmware/kernel* | sort | tail -n 1)"
if [ -z "$KERNEL" ] ; then
echo "error: kernel installation failed! (/boot/kernel* not found)"
cleanup
exit 1
fi
fi
;;
"uselocal")
echo "using local kernel previous run"
;;
esac
# Check if kernel installation was successful
KERNEL="$(ls -1 "${R}"/boot/firmware/kernel* | sort | tail -n 1)"
if [ -z "$KERNEL" ] ; then
echo "error: kernel installation failed! (/boot/kernel* not found)"
cleanup
exit 1
fi
#fi