From 563233bb3047429d4fb4561036a40e4a40e47d97 Mon Sep 17 00:00:00 2001 From: Hiago De Franco Date: Mon, 22 Apr 2024 09:52:03 -0300 Subject: set-hostname: update sethostname script to handle read-only root filesystem The sethostname script has issues when the root filesystem is mounted as read-only, making not possible to create or modify the /etc/hostname file. Therefore, this change updates the sethostname script and adds the @@HOSTNAMECTL_OPT@@ that can further be replaced with the "--transient" flag for hostnamectl if the system uses a read-only root FS. This flag will change the hostname without creating the /etc/hostname file. With this change, update recipe version from 1.0 to 1.1. Related-to: ELB-5713 Signed-off-by: Hiago De Franco (cherry picked from commit 9d2e8422f17a52e4dd7d2170c685cad2acba5550) --- recipes-core/set-hostname/files/sethostname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'recipes-core/set-hostname/files/sethostname') diff --git a/recipes-core/set-hostname/files/sethostname b/recipes-core/set-hostname/files/sethostname index 87e6320..aacb7ab 100644 --- a/recipes-core/set-hostname/files/sethostname +++ b/recipes-core/set-hostname/files/sethostname @@ -13,7 +13,7 @@ fi hostname=@@MACHINE@@"-"${serial} if [ -f /usr/bin/hostnamectl ]; then - /usr/bin/hostnamectl set-hostname ${hostname} + /usr/bin/hostnamectl set-hostname @@HOSTNAMECTL_OPT@@ ${hostname} else hostname ${hostname} fi -- cgit v1.2.3