diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-11-22 20:28:27 +0000 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-12-13 15:59:35 -0500 |
commit | 491a385ca6fd6e47c364d0bda0ffdf557eec6da0 (patch) | |
tree | 0f4905717b68e04976ab815ee473747dc59187df /conf | |
parent | 6fe326b68012b0eae5c951ab21d55b0ccfda84f9 (diff) | |
download | meta-virtualization-491a385ca6fd6e47c364d0bda0ffdf557eec6da0.tar.gz |
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 <bruce.ashfield@gmail.com>
Diffstat (limited to 'conf')
-rw-r--r-- | conf/layer.conf | 1 |
1 files changed, 1 insertions, 0 deletions
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" | |||
57 | USER_CLASSES:append = " meta-virt-cfg" | 57 | USER_CLASSES:append = " meta-virt-cfg" |
58 | USER_CLASSES:append = " meta-virt-k8s-cfg" | 58 | USER_CLASSES:append = " meta-virt-k8s-cfg" |
59 | USER_CLASSES:append = " meta-virt-xen-cfg" | 59 | USER_CLASSES:append = " meta-virt-xen-cfg" |
60 | USER_CLASSES:append = " meta-virt-hosts" | ||
60 | 61 | ||
61 | HOSTTOOLS_NONFATAL += "getent" | 62 | HOSTTOOLS_NONFATAL += "getent" |