[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
On Wed, Sep 19, 2012 at 07:14:50PM +0200, Olaf Hering wrote:
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
Thanks -- pushed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On Wed, Sep 19, 2012 at 07:14:50PM +0200, Olaf Hering wrote:
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") ->
I should add here this would require us to detect "sles". I'm not sure what SLES guests return right now, it could be "opensuse", but I don't have a guest to test with. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On Wed, Sep 19, Richard W.M. Jones wrote:
I should add here this would require us to detect "sles". I'm not sure what SLES guests return right now, it could be "opensuse", but I don't have a guest to test with.
Right now its still opensuse because the code just matches /etc/SuSE-release Olaf
On Wed, Sep 19, 2012 at 07:26:21PM +0200, Olaf Hering wrote:
On Wed, Sep 19, Richard W.M. Jones wrote:
I should add here this would require us to detect "sles". I'm not sure what SLES guests return right now, it could be "opensuse", but I don't have a guest to test with.
Right now its still opensuse because the code just matches /etc/SuSE-release
We should probably differentiate between "opensuse" and "sles", as we currently do with the various Fedora/RHEL/derivatives. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Wed, Sep 19, Richard W.M. Jones wrote:
On Wed, Sep 19, 2012 at 07:26:21PM +0200, Olaf Hering wrote:
On Wed, Sep 19, Richard W.M. Jones wrote:
I should add here this would require us to detect "sles". I'm not sure what SLES guests return right now, it could be "opensuse", but I don't have a guest to test with.
Right now its still opensuse because the code just matches /etc/SuSE-release
We should probably differentiate between "opensuse" and "sles", as we currently do with the various Fedora/RHEL/derivatives.
Looking at this, the code could detect 'opensuse', 'sle' (to catch SLES, SLED and SLERT), and suse_based. I will prepare a patch to implement that. Olaf
On Wed, Sep 19, 2012 at 08:08:39PM +0200, Olaf Hering wrote:
On Wed, Sep 19, Richard W.M. Jones wrote:
On Wed, Sep 19, 2012 at 07:26:21PM +0200, Olaf Hering wrote:
On Wed, Sep 19, Richard W.M. Jones wrote:
I should add here this would require us to detect "sles". I'm not sure what SLES guests return right now, it could be "opensuse", but I don't have a guest to test with.
Right now its still opensuse because the code just matches /etc/SuSE-release
We should probably differentiate between "opensuse" and "sles", as we currently do with the various Fedora/RHEL/derivatives.
Looking at this, the code could detect 'opensuse', 'sle' (to catch SLES, SLED and SLERT), and suse_based.
For "sle" (ugly - better to just call it "sles"?), note there's a subfield (guestfs_inspect_get_product_variant) that could be used to differentiate between server/desktop/realtime variants. One day I intend to implement this for RHEL (ie. RHEL Desktop vs Server). However currently that field only returns useful information for Windows guests ("Client" or "Server" in that case). It is used in virt-v2v to differentiate between Windows 7 and its server equivalent (Win2008 IIRC) which are otherwise identical. It's a nice to have if you want to implement it, but not necessary. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Wed, Sep 19, Richard W.M. Jones wrote:
For "sle" (ugly - better to just call it "sles"?), note there's a subfield (guestfs_inspect_get_product_variant) that could be used to differentiate between server/desktop/realtime variants.
It's a nice to have if you want to implement it, but not necessary.
I think we can implement such finetuning if there is a real need for that. opensuse vs. sles should be good enough for the time being. Olaf
participants (2)
-
Olaf Hering -
Richard W.M. Jones