[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] 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>

diff --git a/sysprep/sysprep_operation_hostname.ml b/sysprep/sysprep_operation_hostname.ml
index 3fc8800..363069b 100644
--- a/sysprep/sysprep_operation_hostname.ml
+++ b/sysprep/sysprep_operation_hostname.ml
@@ -45,6 +45,10 @@ let hostname_perform g root =
     g#write filename file;
     [ `Created_files ]
 
+  | "linux", ("opensuse"|"sles") ->
+    g#write "/etc/HOSTNAME" !hostname;
+    [ `Created_files ]
+
   | "linux", ("debian"|"ubuntu") ->
     g#write "/etc/hostname" !hostname;
     [ `Created_files ]
-- 
1.7.12


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]