__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/sh
# vim:ts=2:sw=2:et
# see also:
# https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html#s-kernel-hooks
set -e
# Play nice when run under debconf.
exec </dev/null >&2
kernel_version="$1"
image_path="$2"
eval set -- "$DEB_MAINT_PARAMS"
case "$1" in
configure|remove)
;;
*)
exit 0
;;
esac
firmware_dst="/boot/firmware"
if ischroot ; then
true # chroot detected - skip mount point check
elif [ -e /usr/bin/systemd-detect-virt ] && systemd-detect-virt -q ; then
true # virtualization detected - skip mount point check
elif [ "$(stat -f -c %T "${firmware_dst}")" = "nfs" ]; then
true
elif ! mountpoint -q "${firmware_dst}" ; then
echo "raspi-firmware: missing ${firmware_dst}, did you forget to mount it?" >&2
exit 1
fi
# Ensure the target directory exists. See https://bugs.debian.org/887062
mkdir -p "${firmware_dst}/overlays"
# Default configurations, overridable at /etc/default/raspi-firmware
KERNEL=${KERNEL:-auto}
# Load user configuration
if [ -r /etc/default/raspi-firmware ] ; then
. /etc/default/raspi-firmware
fi
# TODO:
# Handle removal of device tree files
flavour="${kernel_version#*-rpi-}"
case $flavour in
v8|v8-rt|2712)
dtb_path="/usr/lib/linux-image-${kernel_version}/broadcom"
;;
v6|v7|v7l)
dtb_path="/usr/lib/linux-image-${kernel_version}"
;;
*)
echo "WARNING: Unsupported kernel version ($kernel_version) - skipping setup"
echo "NOTE: Manual boot configuration may be required"
exit 0
;;
esac
# Handle kernel files
if [ "$KERNEL" = "auto" ]; then
kernel_dst="$firmware_dst/kernel$(echo "$flavour" | sed 's/^v//;s/^6//;s/2712/_2712/;s/-/_/;').img"
latest_kernel=$(find /boot -maxdepth 1 -name "vmlinuz-*-rpi-$flavour" -print0 | sort -z -V -r | head -z -n1)
overlay_path="/usr/lib/linux-image-${kernel_version}/overlays"
case "$1" in
configure)
if ! [ -e "$image_path" ]; then
echo "ERROR: $image_path not found"
exit 1
elif [ "$image_path" != "$latest_kernel" ]; then
exit 0
fi
rsync -crt "${dtb_path}"/bcm27*.dtb /boot/firmware/
rsync -crt "${overlay_path}"/*.dtb* "${overlay_path}"/README "${firmware_dst}/overlays"
if [ -e "${firmware_dst}/.firmware_revision" ]; then
echo "WARNING: raspi-firmware: replacing rpi-update kernels" >&2
rm -f "${firmware_dst}/.firmware_revision"
fi
cp -v "$image_path" "$kernel_dst"
;;
remove)
if [ -z "$latest_kernel" ] ; then
rm -fv "$kernel_dst"
/etc/initramfs/post-update.d/z50-raspi-firmware "$kernel_version" "$(echo "$image_path" | sed 's/vmlinuz/initrd.img/')"
fi
;;
*)
exit 1
;;
esac
sync "$firmware_dst"
fi
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| initramfs-tools | File | 863 B | 0755 |
|
| z50-raspi-firmware | File | 2.67 KB | 0755 |
|