[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, experimental, updated. debian/1%1.21.40-1
Richard W.M. Jones
rjones at redhat.com
Sat Jun 1 11:05:08 UTC 2013
The following commit has been merged in the experimental branch:
commit d2abdddf61c7bd0c6fc79dd83aa4332e213dc7ba
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue May 21 13:37:03 2013 +0100
sysprep: Update /etc/machine-info on Fedora 18+, RHEL 7+ (RHBZ#890027).
diff --git a/sysprep/sysprep_operation_hostname.ml b/sysprep/sysprep_operation_hostname.ml
index 83e197c..7f1150d 100644
--- a/sysprep/sysprep_operation_hostname.ml
+++ b/sysprep/sysprep_operation_hostname.ml
@@ -50,17 +50,29 @@ let hostname_perform g root =
in
let update_etc_hostname () =
- g#write "/etc/hostname" !hostname;
- [ `Created_files ]
+ g#write "/etc/hostname" !hostname
+ in
+
+ let update_etc_machine_info () =
+ replace_line_in_file "/etc/machine-info" "PRETTY_HOSTNAME" !hostname
in
match typ, distro, major_version with
- (* Fedora 18 (hence RHEL 7+) changed to using /etc/hostname
- * (RHBZ#881953, RHBZ#858696).
- *)
- | "linux", "fedora", v when v >= 18 -> update_etc_hostname ()
- | "linux", "rhel", v when v >= 7 -> update_etc_hostname ()
- | "linux", ("debian"|"ubuntu"), _ -> update_etc_hostname ()
+ (* Fedora 18 (hence RHEL 7+) changed to using /etc/hostname
+ * (RHBZ#881953, RHBZ#858696). We may also need to modify
+ * /etc/machine-info (RHBZ#890027).
+ *)
+ | "linux", "fedora", v when v >= 18 ->
+ update_etc_hostname ();
+ update_etc_machine_info ();
+ [ `Created_files ]
+ | "linux", "rhel", v when v >= 7 ->
+ update_etc_hostname ();
+ update_etc_machine_info ();
+ [ `Created_files ]
+ | "linux", ("debian"|"ubuntu"), _ ->
+ update_etc_hostname ();
+ [ `Created_files ]
| "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"redhat-based"), _ ->
replace_line_in_file "/etc/sysconfig/network" "HOSTNAME" !hostname;
--
Libguestfs Debian packaging
More information about the Pkg-libvirt-commits
mailing list