From 514c0a764e1f172a76bc6d4084ff09d7be306598 Mon Sep 17 00:00:00 2001 From: Kyle Harding Date: Wed, 22 Nov 2023 15:47:56 -0500 Subject: [PATCH] Enable setting a hostname after creating users Change-type: patch Signed-off-by: Kyle Harding --- yocto-build-env/s6-overlay/scripts/addusers | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yocto-build-env/s6-overlay/scripts/addusers b/yocto-build-env/s6-overlay/scripts/addusers index fa47f80..4b5bf57 100644 --- a/yocto-build-env/s6-overlay/scripts/addusers +++ b/yocto-build-env/s6-overlay/scripts/addusers @@ -48,3 +48,10 @@ for user_id in ${user_ids}; do # fetch the user's ssh keys from github fetch_ssh_keys "${name}" "$(eval echo ~"${name}")" || true done + +if [ -n "${SET_HOSTNAME:-}" ]; then + # set the desired hostname + echo "${SET_HOSTNAME}" > /etc/hostname + hostname -F /etc/hostname + hostname +fi