Skip to content

Commit

Permalink
add support for option --keep-kernel with raspbian OS bookworm
Browse files Browse the repository at this point in the history
Signed-off-by: bigbearishappy <953308023@qq.com>
  • Loading branch information
bigbearishappy committed Apr 15, 2024
1 parent 9d01d63 commit f99e686
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions scripts/reTerminal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,23 @@ function install_kernel() {
;;
esac
} || {
# We would like to a fixed version
KERN_NAME=raspberrypi-kernel_${FORCE_KERNEL}_${arch_r}.deb
HDR_NAME=raspberrypi-kernel-headers_${FORCE_KERNEL}_${arch_r}.deb
_url=$(apt-get download --print-uris raspberrypi-kernel | sed -nre "s/'([^']+)'.*$/\1/g;p")
_prefix=$(echo $_url | sed -nre 's/^(.*)raspberrypi-kernel_.*$/\1/g;p')

download_install_debpkg "$_prefix" "$KERN_NAME" && {
download_install_debpkg "$_prefix" "$HDR_NAME"
} || {
echo "Error: Install kernel or header failed"
exit 2
}
if [ $DEBIAN_NUM -lt $BOOKWORM_NUM ]; then
# We would like to a fixed version
KERN_NAME=raspberrypi-kernel_${FORCE_KERNEL}_${arch_r}.deb
HDR_NAME=raspberrypi-kernel-headers_${FORCE_KERNEL}_${arch_r}.deb
_url=$(apt-get download --print-uris raspberrypi-kernel | sed -nre "s/'([^']+)'.*$/\1/g;p")
_prefix=$(echo $_url | sed -nre 's/^(.*)raspberrypi-kernel_.*$/\1/g;p')

download_install_debpkg "$_prefix" "$KERN_NAME" && {
download_install_debpkg "$_prefix" "$HDR_NAME"
} || {
echo "Error: Install kernel or header failed"
exit 2
}
else
apt-get -y --force-yes install linux-image-rpi-${ker_ver##*-}=$FORCE_KERNEL
apt-get -y --force-yes install linux-headers-rpi-${ker_ver##*-}=$FORCE_KERNEL
fi
}
}

Expand Down Expand Up @@ -651,12 +656,10 @@ fi
if [ "X$keep_kernel" != "X" ]; then
if [ $DEBIAN_NUM -lt $BOOKWORM_NUM ]; then
FORCE_KERNEL=$(dpkg -s raspberrypi-kernel | awk '/^Version:/{printf "%s\n",$2;}')
echo -e "\n### Keep current system kernel not to change"
else
echo -e "\n### Don't support option --keep-kernel currently."
echo -e "\n### Pls remove --keep-kernel in your command."
exit 1
FORCE_KERNEL=$(dpkg -s linux-image-rpi-v8 | awk '/^Version:/{printf "%s\n",$2;}')
fi
echo -e "\n### Keep current system kernel not to change"
elif [ "X$compat_kernel" != "X" ]; then
if [ $DEBIAN_NUM -lt $BOOKWORM_NUM ]; then
echo -e "\n### Will compile with a compatible kernel..."
Expand Down

0 comments on commit f99e686

Please sign in to comment.