2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-24 19:32:29 +00:00

Keep the source machine-id in captured images

An empty machine-id in the image only works with deployment scripts that
set one per node. With older ones, which ship separately from imgutil,
systemd made up a new machine-id on every diskless boot and a disk install
got a second set of boot entries. The deployment now replaces whatever
machine-id the image carries, so leave it in the image.
This commit is contained in:
Markus Hilger
2026-11-03 17:17:36 +01:00
parent fc63269dc7
commit 42907cb014
-6
View File
@@ -268,7 +268,6 @@ def capture_fs(args):
masker.mask('/etc/netplan/*.yaml')
# an empty hostname keeps the node name the deployment initramfs set
masker.mask('/etc/hostname', '/run/imgutil/captmp/empty')
masker.mask('/etc/machine-id', '/run/imgutil/captmp/machine-id')
mksquashargs = ['mksquashfs', '/run/imgutil/capin', fname + '.sfs', '-comp', 'xz']
excludes = get_capture_excludes(mdir)
exfile = None
@@ -492,11 +491,6 @@ def capture_system_back(args):
shadowout.write(newgshadow)
with open('/run/imgutil/captmp/empty', 'w') as shadowout:
pass
# an empty machine-id makes systemd generate one at boot without first
# boot semantics, the deployment sets a stable one per node
with open('/run/imgutil/captmp/machine-id', 'w') as midout:
pass
os.chmod('/run/imgutil/captmp/machine-id', 0o444)
i = 0
todelete = []
with open('/run/imgutil/capout/rootimg.sfs.plain', 'wb') as outimg: