summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-09-19 18:18:29 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-19 18:18:29 +0100
commitae0f60744b7f20538f8b9945ef99301fa1ecfe45 (patch)
treed1e0959ef76928ed153df6959f3b6ea636847522
parent88c406feba1390f830c20bfb4c11989a4e877b91 (diff)
downloadlibguestfs-ae0f60744b7f20538f8b9945ef99301fa1ecfe45.tar.gz
libguestfs-ae0f60744b7f20538f8b9945ef99301fa1ecfe45.tar.xz
libguestfs-ae0f60744b7f20538f8b9945ef99301fa1ecfe45.zip
sysprep: handle SuSE in hostname operation
SuSE based installations store the hostname in /etc/HOSTNAME. Add code to handle both opensuse and sles. Code to properly detect the latter will be added with another patch. Signed-off-by: Olaf Hering <olaf@aepfle.de>
-rw-r--r--sysprep/sysprep_operation_hostname.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysprep/sysprep_operation_hostname.ml b/sysprep/sysprep_operation_hostname.ml
index 4b9d6d17..db541848 100644
--- a/sysprep/sysprep_operation_hostname.ml
+++ b/sysprep/sysprep_operation_hostname.ml
@@ -54,6 +54,10 @@ let hostname_perform g root =
);
[ `Created_files ]
+ | "linux", ("opensuse"|"sles") ->
+ g#write "/etc/HOSTNAME" !hostname;
+ [ `Created_files ]
+
| "linux", ("debian"|"ubuntu") ->
g#write "/etc/hostname" !hostname;
[ `Created_files ]