From 1030de27980e81a67b659b43b464079e0ff4da89 Mon Sep 17 00:00:00 2001 From: Vidal Gerard Date: Thu, 30 Oct 2025 08:02:51 +0100 Subject: [PATCH] Suppression de l'effacement du build selon les choix de compilation --- README.md | 2 +- bootstrap.d/13-kernel.sh | 17 +++++++++-------- rpiGenImage.sh | 8 +++++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9e1578b..b7f0983 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ The following static networking parameters are only supported if `ENABLE_WIFI_DH |Option|Value|default value|value format|desciption| |---|---|---|---|---| -|BUILD_KERNEL||true|`true`\|`false`|Build and install the latest RPi 0/1/2/3/4 Linux kernel. The default RPi 0/1/2/3/ kernel configuration is used most of the time. ENABLE_NEXMON - Changes Kernel Source to [https://github.com/Re4son/](Kali Linux Kernel) Precompiled 32bit kernel for RPI0/1/2/3 by [https://github.com/hypriot/](hypriot) Precompiled 64bit kernel for RPI3/4 by [https://github.com/sakaki-/](sakaki)| +|BUILD_KERNEL||build|`build`\|`uselocal`\|`download`|Build and install the latest RPi 0/1/2/3/4 Linux kernel. The default RPi 0/1/2/3/ kernel configuration is used most of the time. ENABLE_NEXMON - Changes Kernel Source to [https://github.com/Re4son/](Kali Linux Kernel) Precompiled 32bit kernel for RPI0/1/2/3 by [https://github.com/hypriot/](hypriot) Precompiled 64bit kernel for RPI3/4 by [https://github.com/sakaki-/](sakaki)| |CROSS_COMPILE|string|||This sets the cross-compile environment for the compiler. Set by RPI_MODEL| |KERNEL_ARCH|string|||This sets the kernel architecture for the compiler. Set by RPI_MODEL| |KERNEL_IMAGE|string|||Name of the image file in the boot partition. Set by RPI_MODEL| diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index c5fff0a..b7cd7fd 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -875,12 +875,13 @@ 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 + +# 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 + diff --git a/rpiGenImage.sh b/rpiGenImage.sh index 5ae182d..e26707f 100755 --- a/rpiGenImage.sh +++ b/rpiGenImage.sh @@ -573,13 +573,15 @@ if [ -r "/dev/mapping/${CRYPTFS_MAPPING}" ] ; then fi # Don't clobber an old build -if [ -e "$BUILDDIR" ] ; then +if [ -e "$BUILDDIR" ] && [ "$BUILD_KERNEL" = true ] ; then echo "error: directory ${BUILDDIR} already exists, not proceeding" exit 1 fi -# Setup chroot directory -mkdir -p "${R}" +if [ "$BUILD_KERNEL" = true ] ; then + # Setup chroot directory + mkdir -p "${R}" +fi # Check if build directory has enough of free disk space >512MB if [ "$(df --output=avail "${BUILDDIR}" | sed "1d")" -le "524288" ] ; then