NoPaste

rpi-boot Kernel Hook

von schorsch_76

SNIPPET_TEXT:
  1. #!/bin/sh -e
  2.  
  3. version="$1"
  4. bootopt=""
  5.  
  6. # passing the kernel version is required
  7. if [ -z "${version}" ]; then
  8.         echo >&2 "W: fdt-boot: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
  9.         exit 2
  10. fi
  11.  
  12. # avoid running multiple times
  13. if [ -n "$DEB_MAINT_PARAMS" ]; then
  14.         eval set -- "$DEB_MAINT_PARAMS"
  15.         if [ -z "$1" ] || [ "$1" != "configure" ]; then
  16.                 exit 0
  17.         fi
  18. fi
  19.  
  20. # we're good - copy fdt directory
  21. # shellcheck disable=SC2086
  22. echo "rpi-boot (post-inst): Version=${version}"
  23.  
  24. # check that firmware is mounted
  25. if [ -z /boot/firmware/config.txt ]; then
  26.         echo "W: /boot/firmware/config.txt not found"
  27.         exit 0
  28. fi
  29.  
  30. # update the vmlinuz,initrd.img and fdt link in the firmware  partition
  31. latest_kernel=`ls /boot/vmlinuz-* | cut -d'-' -f 2- | sort -rV | head -n1`
  32. echo "Latest: ${latest_kernel}"
  33. if [ -z "${latest_kernel}" ]; then
  34.         echo "W: rpi-boot (post-inst): no kernel found"
  35.         exit 2
  36. fi
  37.  
  38. cat /boot/vmlinuz-${latest_kernel} > /boot/firmware/upstream/kernel8.img
  39. cp /boot/initrd.img-${latest_kernel} /boot/firmware/upstream/initrd.img
  40. 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