From 592c0df22e3edf4ff416946473b1862a5c1627b9 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sat, 20 Nov 2021 04:09:52 +0100 Subject: [PATCH] Adjust /etc/machine-id logic for buster. Commit 26a7de63b0bb3de1b5d0c4d0529240721c322dbb 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. --- generate-recipe.py | 9 ++++++++- raspi_master.yaml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/generate-recipe.py b/generate-recipe.py index 2993138..dbfe345 100755 --- a/generate-recipe.py +++ b/generate-recipe.py @@ -113,6 +113,12 @@ else: # deb http://deb.debian.org/debian %s main contrib non-free """ % 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: @@ -147,7 +153,8 @@ with open('raspi_master.yaml', 'r') as in_file: .replace('__RASPI_FIRMWARE__', raspi_firmware) \ .replace('__WIRELESS_FIRMWARE__', wireless_firmware) \ .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, '__EXTRA_ROOT_SHELL_CMDS__', extra_root_shell_cmds) diff --git a/raspi_master.yaml b/raspi_master.yaml index daee86f..bfae52a 100644 --- a/raspi_master.yaml +++ b/raspi_master.yaml @@ -163,3 +163,4 @@ steps: - chroot: / shell: | rm -f /etc/machine-id /var/lib/dbus/machine-id + __TOUCH_MACHINE_ID__