Changes to rebuild without recompiling

This commit is contained in:
g-vidal
2025-11-01 09:57:48 +01:00
parent 92b81a7a4e
commit 62675a0971
6 changed files with 28 additions and 155 deletions

View File

@@ -8,6 +8,8 @@
VARIANT=""
COMPONENTS="main"
if [ "$BUILD_KERNEL" != "uselocal" ]; then #ajout 2025
# Use non-free Debian packages if needed
# One use variable which is only needed by wifi firmware blob => reworked to use non free in /etc/apt/sources.list - we could just use ENABLE_WIRELESS here
if [ "$ENABLE_WIRELESS" = true ] || [ "$ENABLE_NONFREE" = true ] ; then
@@ -24,11 +26,12 @@ fi
#if [ "$RELEASE" = "bookworm" ] || [ "$RELEASE" = "bullseye" ] ; then
# APT_EXCLUDES="--exclude=init,systemd-sysv"
#fi
# Base debootstrap (unpack only)
http_proxy=${APT_PROXY} debootstrap ${APT_EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian"
# Copy qemu emulator binary to chroot
install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
@@ -36,9 +39,13 @@ install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
mkdir -p "${R}/usr/share/keyrings"
install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg"
# Complete the bootstrapping process
chroot_exec /debootstrap/debootstrap --second-stage
fi
# Mount required filesystems
mount -t proc none "${R}/proc"
mount -t sysfs none "${R}/sys"

View File

@@ -15,7 +15,7 @@ fi
# Fetch and build latest raspberry kernel
case "$BUILD_KERNEL" in
"build")
"true")
#if [ "$BUILD_KERNEL" = build ] ; then
# Setup source directory
mkdir -p "${KERNEL_DIR}"
@@ -800,10 +800,10 @@ case "$BUILD_KERNEL" in
chroot_exec ln -sf /usr/src/linux "/lib/modules/${KERNEL_VERSION}/source"
fi
fi
;;
;;
"download")
else # BUILD_KERNEL=false
#else # BUILD_KERNEL=false
if [ "$SET_ARCH" = 64 ] ; then
if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
# Use Sakakis modified kernel if ZSWAP is active
@@ -879,20 +879,19 @@ else # BUILD_KERNEL=false
rm -fr "${temp_dir}"
rm -f "${R}"/tmp/kernel.deb
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
;;
"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

View File

@@ -8,6 +8,8 @@
# Install and setup fstab
install_readonly files/mount/fstab "${ETC_DIR}/fstab"
if [ "$BUILD_KERNEL" != "uselocal" ]; then #ajout 2025
# Generate initramfs file
if [ "$ENABLE_INITRAMFS" = true ] ; then
if [ "$ENABLE_CRYPTFS" = true ] ; then
@@ -119,3 +121,5 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then
chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}"
fi
fi
fi

View File

@@ -141,7 +141,7 @@ if [ "$ENABLE_HARDNET" = true ] ; then
install_readonly files/sysctl.d/82-rpi-net-hardening.conf "${ETC_DIR}/sysctl.d/82-rpi-net-hardening.conf"
# Setup resolver warnings about spoofed addresses
sed -i "s/^# spoof warn/spoof warn/" "${ETC_DIR}/host.conf"
#sed -i "s/^# spoof warn/spoof warn/" "${ETC_DIR}/host.conf" # comment 2025
fi
# Enable time sync

View File

@@ -1,7 +1,7 @@
#
# Setup users and security settings
#
if [ "$BUILD_KERNEL" != "uselocal" ]; then #ajout 2025
# Load utility functions
. ./functions.sh
@@ -22,3 +22,4 @@ else
# Set no root password to disable root login
chroot_exec usermod -p \'!\' root
fi
fi