From 1ffce8e6bb75dd8f2fff33d5e760184956502d10 Mon Sep 17 00:00:00 2001 From: Gunnar Wolf Date: Wed, 12 Oct 2022 10:25:53 -0500 Subject: [PATCH] For Bookworm, use the new non-free-firmware section instead of non-free --- generate-recipe.py | 23 +++++++++++++++++++---- raspi_master.yaml | 7 +++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/generate-recipe.py b/generate-recipe.py index fd536f6..18c7d71 100755 --- a/generate-recipe.py +++ b/generate-recipe.py @@ -50,6 +50,19 @@ else: raspi_firmware = 'raspi-firmware' fix_firmware = False +# Bookworm introduced the 'non-free-firmware' component¹; before that, +# raspi-firmware was in 'non-free' +# +# ¹ https://www.debian.org/vote/2022/vote_003 +if suite == 'bookworm': + firmware_component = 'non-free-firmware' +else: + # We only need "non-free". "Contrib" was before included as well, + # as they are usually enabled together, but adding a second YAML + # element... makes the resulting code ugly and brittle. Besides, + # we don't use anything from contrib! + firmware_component = 'non-free' + # Extra wireless firmware: if version != '2': wireless_firmware = 'firmware-brcm80211' @@ -108,14 +121,15 @@ else: if backports_enable: backports_stanza = """ %s -deb http://deb.debian.org/debian/ %s main contrib non-free -""" % (backports_enable, backports_suite) +deb http://deb.debian.org/debian/ %s main %s +""" % (backports_enable, backports_suite, firmware_component) else: + # ugh backports_stanza = """ # Backports are _not_ enabled by default. # Enable them by uncommenting the following line: -# deb http://deb.debian.org/debian %s main contrib non-free -""" % backports_suite +# deb http://deb.debian.org/debian %s main %s +""" % (backports_suite, firmware_component) # Buster requires an existing, empty /etc/machine-id file: if suite == 'buster': @@ -159,6 +173,7 @@ with open('raspi_master.yaml', 'r') as in_file: out_text = in_text \ .replace('__RELEASE__', suite) \ .replace('__ARCH__', arch) \ + .replace('__FIRMWARE_COMPONENT__', firmware_component) \ .replace('__LINUX_IMAGE__', linux) \ .replace('__DTB__', dtb) \ .replace('__SECURITY_SUITE__', security_suite) \ diff --git a/raspi_master.yaml b/raspi_master.yaml index cefe1de..290a476 100644 --- a/raspi_master.yaml +++ b/raspi_master.yaml @@ -45,14 +45,13 @@ steps: arch: __ARCH__ components: - main - - contrib - - non-free + - __FIRMWARE_COMPONENT__ unless: rootfs_unpacked - create-file: /etc/apt/sources.list contents: |+ - deb http://deb.debian.org/debian __RELEASE__ main contrib non-free - deb http://security.debian.org/debian-security __SECURITY_SUITE__ main contrib non-free + deb http://deb.debian.org/debian __RELEASE__ main __FIRMWARE_COMPONENT__ + deb http://security.debian.org/debian-security __SECURITY_SUITE__ main __FIRMWARE_COMPONENT__ __BACKPORTS__ unless: rootfs_unpacked