From 491a385ca6fd6e47c364d0bda0ffdf557eec6da0 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 22 Nov 2021 20:28:27 +0000 Subject: config: introduce hostname generation hooks Overriding hostname in a .conf file, via base-files: HOST_NAME="k3s-host" hostname_pn-base-files = "${HOST_NAME}" Is always a valid option, but if it is not configured, we can easily have two hosts with the same name on the network, confusing adddress assignement, etc. This commit introduces a way to generate a unique hostname based on the uuid of the build host, and the machine being built. If virt-unique-hostname is added to IMAGE_FEATURES, like the following: IMAGE_FEATURES += "virt-unique-hostname" IMAGE_FEATURES[validitems] += "virt-unique-hostname" Then a rootfs postprocessing hook will override hostnae to something unique. Note: this means your image will be reproducible on a single builder, but not between them. Signed-off-by: Bruce Ashfield --- conf/layer.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'conf') diff --git a/conf/layer.conf b/conf/layer.conf index 149b42ee..4a1448a4 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -57,5 +57,6 @@ K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc" USER_CLASSES:append = " meta-virt-cfg" USER_CLASSES:append = " meta-virt-k8s-cfg" USER_CLASSES:append = " meta-virt-xen-cfg" +USER_CLASSES:append = " meta-virt-hosts" HOSTTOOLS_NONFATAL += "getent" -- cgit v1.2.3-54-g00ecf