mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
d5ce659e2c136fbcf0a0b9058711765cfae6c210
systemd defined an /etc/machine-id file which is supposed to contain a unique, unchanging ID for the host. This file is initially zero-sized and is meant to be set by systemd on the first boot of the system. In virt-builder Fedora templates, the file is empty. Unfortunately the Fedora kernel %post script requires the machine-id to have been set, else the script exits with an error: Running scriptlet: kernel-core-4.12.13-300.fc26.x86_64 209/209 Could not determine your machine ID from /etc/machine-id. Please run 'systemd-machine-id-setup' as root. See man:machine-id(5) warning: %posttrans(kernel-core-4.12.13-300.fc26.x86_64) scriptlet failed, exit status 1 This also leaves the kernel package half-installed. The files are present in the filesystem, but important initialization is not done, in particular the vmlinuz file is not copied into /boot. A simple reproducer for this problem is: $ virt-builder fedora-26 --update which will leave the image with a half-installed kernel. (Add -v -x to see the error above amongst the debug output). This change makes virt-customize set /etc/machine-id to a random value if the file exists and is zero sized. This is done unconditionally at the same time as setting the random seed (a similar issue), and before running any customize options such as installing or updating packages.
…
…
…
…
…
…
Libguestfs is tools and a library for accessing and modifying guest disk images. For more information see the home page: http://libguestfs.org/ For discussion, development, patches, etc. please use the mailing list: http://www.redhat.com/mailman/listinfo/libguestfs To find out how to build libguestfs from source, read: docs/guestfs-building.pod http://libguestfs.org/guestfs-building.1.html man docs/guestfs-building.1 Copyright (C) 2009-2017 Red Hat Inc. The library is distributed under the LGPLv2+. The programs are distributed under the GPLv2+. Please see the files COPYING and COPYING.LIB for full license information. The examples are under a very liberal license.
Description
Languages
C
42.7%
OCaml
35.5%
Shell
7.1%
Makefile
4%
Perl
2.6%
Other
8%