Adjust /etc/machine-id logic for buster.

Commit 26a7de63b0 in master:
/etc/machine-id needs to exist and be empty on buster, while bullseye
needs this file not to exist at all. For now, treat both bullseye and
bookworm the same way.
This commit is contained in:
Cyril Brulebois 2021-11-20 04:09:52 +01:00
parent 5f7a28d8ec
commit 592c0df22e
2 changed files with 9 additions and 1 deletions

View File

@ -113,6 +113,12 @@ else:
# deb http://deb.debian.org/debian %s main contrib non-free # deb http://deb.debian.org/debian %s main contrib non-free
""" % backports_suite """ % backports_suite
# Buster requires an existing, empty /etc/machine-id file:
if suite == 'buster':
touch_machine_id = 'touch /etc/machine-id'
else:
touch_machine_id = ''
### Write results: ### Write results:
@ -147,7 +153,8 @@ with open('raspi_master.yaml', 'r') as in_file:
.replace('__RASPI_FIRMWARE__', raspi_firmware) \ .replace('__RASPI_FIRMWARE__', raspi_firmware) \
.replace('__WIRELESS_FIRMWARE__', wireless_firmware) \ .replace('__WIRELESS_FIRMWARE__', wireless_firmware) \
.replace('__SERIAL_CONSOLE__', serial) \ .replace('__SERIAL_CONSOLE__', serial) \
.replace('__HOST__', hostname) .replace('__HOST__', hostname) \
.replace('__TOUCH_MACHINE_ID__', touch_machine_id)
out_text = align_replace(out_text, '__FIX_FIRMWARE_PKG_NAME__', fix_firmware_cmds) out_text = align_replace(out_text, '__FIX_FIRMWARE_PKG_NAME__', fix_firmware_cmds)
out_text = align_replace(out_text, '__EXTRA_ROOT_SHELL_CMDS__', extra_root_shell_cmds) out_text = align_replace(out_text, '__EXTRA_ROOT_SHELL_CMDS__', extra_root_shell_cmds)

View File

@ -163,3 +163,4 @@ steps:
- chroot: / - chroot: /
shell: | shell: |
rm -f /etc/machine-id /var/lib/dbus/machine-id rm -f /etc/machine-id /var/lib/dbus/machine-id
__TOUCH_MACHINE_ID__