From a438d086b2b5443f3c794e94bbc04bb65061b20e Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Wed, 22 May 2019 12:22:59 -0500 Subject: [PATCH] image-builder: create /etc/machine-id systemd complains if `/etc/machine-id` does not exist. Create the `machine-id` file to make systemd happy, it'll bind-mount that file to write the machine id. fixes #296 fixes github.com/kata-containers/runtime#1537 Signed-off-by: Julio Montes --- image-builder/image_builder.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/image-builder/image_builder.sh b/image-builder/image_builder.sh index fcb0eff14..753f34abb 100755 --- a/image-builder/image_builder.sh +++ b/image-builder/image_builder.sh @@ -382,6 +382,9 @@ create_rootfs_image() { find "${mount_dir}" -type f -name "${u}" -exec rm -f {} \; done + info "Creating empty machine-id to allow systemd to bind-mount it" + touch "${mount_dir}/etc/machine-id" + info "Unmounting root partition" umount "${mount_dir}" OK "Root partition unmounted"