rpi-boot Kernel Hook
von schorsch_76- SNIPPET_TEXT:
-
- #!/bin/sh -e
- version="$1"
- bootopt=""
- # passing the kernel version is required
- if [ -z "${version}" ]; then
- echo >&2 "W: fdt-boot: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
- exit 2
- fi
- # avoid running multiple times
- if [ -n "$DEB_MAINT_PARAMS" ]; then
- eval set -- "$DEB_MAINT_PARAMS"
- if [ -z "$1" ] || [ "$1" != "configure" ]; then
- exit 0
- fi
- fi
- # we're good - copy fdt directory
- # shellcheck disable=SC2086
- echo "rpi-boot (post-inst): Version=${version}"
- # check that firmware is mounted
- if [ -z /boot/firmware/config.txt ]; then
- echo "W: /boot/firmware/config.txt not found"
- exit 0
- fi
- # update the vmlinuz,initrd.img and fdt link in the firmware partition
- latest_kernel=`ls /boot/vmlinuz-* | cut -d'-' -f 2- | sort -rV | head -n1`
- echo "Latest: ${latest_kernel}"
- if [ -z "${latest_kernel}" ]; then
- echo "W: rpi-boot (post-inst): no kernel found"
- exit 2
- fi
- cat /boot/vmlinuz-${latest_kernel} > /boot/firmware/upstream/kernel8.img
- cp /boot/initrd.img-${latest_kernel} /boot/firmware/upstream/initrd.img
- cp /usr/lib/linux-image-${version}/broadcom/* /boot/firmware/upstream/
Quellcode
Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN