[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#990976: marked as done (unblock: raspi-firmware/1.20210303+ds-2)



Your message dated Mon, 12 Jul 2021 21:15:06 +0000
with message-id <E1m33Gc-0000jJ-Ex@respighi.debian.org>
and subject line unblock raspi-firmware
has caused the Debian Bug report #990976,
regarding unblock: raspi-firmware/1.20210303+ds-2
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
990976: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990976
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please allow version 1.20210303+ds-2 of raspi-firmware into
testing. This is a minor version, adding a config option that avoids
setting the GPU_FREQ for a fixed GPU speed, which works around a bug
in the RPi4 family that changes the baud rate for the serial interface
rendering it useless. Some other much minor changes are included as
well.

As you will see when reviewing this bug, I should have filed this
request about two months ago. I completely forgot about it... shame on
me! Thanks to Adrian Bunk for reminding me.

The impact of not having this change accepted in Bullseye is not being
able to use a serial console on the current top of the line Raspberry
lineup.

I don't have automated tests in place for this package; as it's
basically a firmware blob needed to boot the system, the main test is
whether it boots and *seems* to work correctly (it does!) or not.

[ Checklist ]
  [X] all changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in testing

unblock raspi-firmware/1.20210303+ds-2

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-3-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff --git a/debian/changelog b/debian/changelog
index c3c54ff..a2dee16 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+raspi-firmware (1.20210303+ds-2) unstable; urgency=medium
+
+  * Add a header to config.txt warning users it's an autogenerated file
+    (Closes: #983896)
+  * Added config option GPU_FREQ to allow specifying a fixed GPU speed,
+    needed for using the serial console in the RPi4 family
+  * ignore *.old-dkms when configuring a new kernel/initrd (Closes:
+    #983409)
+  * Applied some shellcheck fixes to improve clarity. Thanks Diederik!
+
+ -- Gunnar Wolf <gwolf@debian.org>  Wed, 21 Apr 2021 00:52:21 -0500
+
 raspi-firmware (1.20210303+ds-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/default/raspi-firmware b/debian/default/raspi-firmware
index e8e83bc..3e9d9cd 100644
--- a/debian/default/raspi-firmware
+++ b/debian/default/raspi-firmware
@@ -67,6 +67,25 @@
 #
 #CONSOLES="auto"
 
+# In the RPi4 and p400 families, the video processor (GPU) has several
+# possible operating frequencies, but is known to corrupt the serial
+# console (switch to an invalid baud rate), as the UART (the component
+# which drives the serial ports) gets its clock from the GPU, as
+# explained here:
+#
+# https://www.raspberrypi.org/documentation/configuration/uart.md
+#
+# The clock speeds the RPi4 GPU uses are 360/500/550 MHz. If you
+# intend to use the serial console, you need to set GPU_FREQ to
+# 360. If you intend to use this computer as a desktop system, set it
+# to "auto". Both 500 and 550 MHz also corrupt the serial console.
+#
+# Do note that earlier models have fixed frequencies, and this setting
+# will be ignored if your board does not identify as a RPi 4 (any
+# model) or p400.
+#
+#GPU_FREQ="auto"
+
 # Force the architecture to install the kernel as. You will most
 # likely want to leave this setting alone; the only use case I have
 # found for this is when you want to run a 32-bit userland on a
diff --git a/debian/kernel/postinst.d/z50-raspi-firmware b/debian/kernel/postinst.d/z50-raspi-firmware
index 09b882f..1cb1334 100755
--- a/debian/kernel/postinst.d/z50-raspi-firmware
+++ b/debian/kernel/postinst.d/z50-raspi-firmware
@@ -1,7 +1,7 @@
 #!/bin/sh
 # vim:ts=2:sw=2:et
 # see also:
-# https://kernel-handbook.alioth.debian.org/ch-update-hooks.html#s-kernel-hooks
+# https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html#s-kernel-hooks
 
 set -e
 
@@ -31,13 +31,15 @@ fi
 # Ensure the target directory exists. See https://bugs.debian.org/887062
 mkdir -p /boot/firmware
 
-latest_kernel=$(ls -1 /boot/vmlinuz-* | grep -v '\.dpkg-bak$' | sort -V -r | head -1)
+# shellcheck disable=SC2010
+latest_kernel=$(ls -1 /boot/vmlinuz-* | grep -E -v '\.(dpkg-bak|old-dkms)$' | sort -V -r | head -1)
 if [ -z "$latest_kernel" ]; then
   echo "raspi-firmware: no kernel found in /boot/vmlinuz-*, cannot populate /boot/firmware"
   exit 0
 fi
 
-latest_initrd=$(ls -1 /boot/initrd.img-* | grep -v '\.dpkg-bak$' | sort -V -r | head -1)
+# shellcheck disable=SC2010
+latest_initrd=$(ls -1 /boot/initrd.img-* | grep -E -v '\.(dpkg-bak|old-dkms)$' | sort -V -r | head -1)
 if [ -z "$latest_initrd" ]; then
   echo "raspi-firmware: no initrd found in /boot/initrd.img-*, cannot populate /boot/firmware"
   exit 0
@@ -76,7 +78,7 @@ else
 fi
 
 if [ "$KERNEL" = "auto" ]; then
-  for dtb in ${dtb_path}/bcm*.dtb; do
+  for dtb in "${dtb_path}"/bcm*.dtb; do
       [ -e "${dtb}" ] || continue
       cp "${dtb}" /boot/firmware/
   done
@@ -92,7 +94,17 @@ fi
 
 
 # Truncate the config.txt file so that we start with a blank slate
-: >/boot/firmware/config.txt
+echo <<EOF >/boot/firmware/config.txt
+# Do not modify this file!
+#
+# It is automatically generated upon install or update of either the
+# firmware or the Linux kernel.
+#
+# If you need to set boot-time parameters, do so via the
+# /etc/default/raspi-firmware or /etc/default/raspi-extra-cmdline
+#files.
+
+EOF
 
 if [ "$arch" = "arm64" ]; then
   cat >/boot/firmware/config.txt <<EOF
@@ -102,6 +114,16 @@ arm_64bit=1
 EOF
 fi
 
+if grep -q 'Raspberry Pi 4' /sys/firmware/devicetree/base/model
+then
+    # This matches all RPi4 boards ("Raspberry Pi 4 Model B Rev 1.4")
+    # and p400 full computer systems ("Raspberry Pi 400 Rev 1.0")
+    if [ "$GPU_FREQ" != "auto" ]
+    then
+	echo "core_freq=$GPU_FREQ" >> /boot/firmware/config.txt
+    fi
+fi
+
 cat >>/boot/firmware/config.txt <<EOF
 enable_uart=1
 upstream_kernel=1
@@ -122,7 +144,7 @@ if [ -f "$firmware_custom" ]; then
   cat >>/boot/firmware/config.txt <<EOF
 
 # Inserted by ${firmware_custom}
-`cat ${firmware_custom}`
+$(cat ${firmware_custom})
 EOF
 fi
 
@@ -164,7 +186,7 @@ fi
 
 cmdline_custom="/etc/default/raspi-extra-cmdline"
 if [ -f "$cmdline_custom" ]; then
-    post_cmdline=`cat $cmdline_custom`
+  post_cmdline=$(cat $cmdline_custom)
 fi
 
 cat >/boot/firmware/cmdline.txt <<EOF
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-21676-] {+21677+}
Version: [-1.20210303+ds-1-] {+1.20210303+ds-2+}

--- End Message ---
--- Begin Message ---
Unblocked.

--- End Message ---

Reply to: