Standardize firmware handling.

Group raspi-firmware and firmware-brcm80211 together, and make the
firmware package a regular list item in the master YAML file (making
editors happy about it).

Of course, this means that in all generated recipes, linux-image and
raspi*-firmware switch places.
This commit is contained in:
Cyril Brulebois 2021-08-28 05:20:39 +02:00
parent 4483f4cdfb
commit 433100f5cb
2 changed files with 11 additions and 9 deletions

View File

@ -51,9 +51,9 @@ else:
# Extra wireless firmware: # Extra wireless firmware:
if version != '2': if version != '2':
wireless_firmware_maybe = '- firmware-brcm80211' wireless_firmware = 'firmware-brcm80211'
else: else:
wireless_firmware_maybe = '' wireless_firmware = ''
# Serial console: # Serial console:
if version in ['1', '2']: if version in ['1', '2']:
@ -68,7 +68,7 @@ if version == '4' and suite == 'buster':
backports_enable = "# raspi 4 needs kernel and firmware newer than buster's" backports_enable = "# raspi 4 needs kernel and firmware newer than buster's"
linux = '%s/%s' % (linux, backports_suite) linux = '%s/%s' % (linux, backports_suite)
raspi_firmware = 'raspi-firmware/%s' % backports_suite raspi_firmware = 'raspi-firmware/%s' % backports_suite
wireless_firmware_maybe = '- firmware-brcm80211/%s' % backports_suite wireless_firmware = 'firmware-brcm80211/%s' % backports_suite
fix_firmware = False fix_firmware = False
# CMA fixup: # CMA fixup:
@ -141,8 +141,8 @@ with open('raspi_master.yaml', 'r') as in_file:
out_text = in_text \ out_text = in_text \
.replace('__RELEASE__', suite) \ .replace('__RELEASE__', suite) \
.replace('__SECURITY_SUITE__', security_suite) \ .replace('__SECURITY_SUITE__', security_suite) \
.replace('__FIRMWARE_PKG__', raspi_firmware) \ .replace('__RASPI_FIRMWARE__', raspi_firmware) \
.replace('__WIRELESS_FIRMWARE_PKG_MAYBE__', wireless_firmware_maybe) \ .replace('__WIRELESS_FIRMWARE__', wireless_firmware) \
.replace('__SERIAL_CONSOLE__', serial) \ .replace('__SERIAL_CONSOLE__', serial) \
.replace('__LINUX_IMAGE__', linux) \ .replace('__LINUX_IMAGE__', linux) \
.replace('__DTB__', dtb) \ .replace('__DTB__', dtb) \
@ -155,6 +155,8 @@ with open('raspi_master.yaml', 'r') as in_file:
out_text = align_replace(out_text, '__BACKPORTS__', backports_stanza.splitlines()) out_text = align_replace(out_text, '__BACKPORTS__', backports_stanza.splitlines())
# Try not to keep lines where the placeholder was replaced # Try not to keep lines where the placeholder was replaced
# with nothing at all: # with nothing at all (including on a "list item" line):
filtered = [x for x in out_text.splitlines() if not re.match(r'^\s+$', x)] filtered = [x for x in out_text.splitlines()
if not re.match(r'^\s+$', x)
and not re.match(r'^\s+-\s*$', x)]
out_file.write('\n'.join(filtered) + "\n") out_file.write('\n'.join(filtered) + "\n")

View File

@ -79,9 +79,9 @@ steps:
- parted - parted
- ssh - ssh
- wpasupplicant - wpasupplicant
- __FIRMWARE_PKG__
- __LINUX_IMAGE__ - __LINUX_IMAGE__
__WIRELESS_FIRMWARE_PKG_MAYBE__ - __RASPI_FIRMWARE__
- __WIRELESS_FIRMWARE__
tag: / tag: /
unless: rootfs_unpacked unless: rootfs_unpacked