Olaf Hering
2012-Sep-19 17:14 UTC
[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 at 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
Richard W.M. Jones
2012-Sep-19 17:20 UTC
[Libguestfs] [PATCH] sysprep: handle SuSE in hostname operation
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 at 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.12Thanks -- 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
Richard W.M. Jones
2012-Sep-19 17:21 UTC
[Libguestfs] [PATCH] sysprep: handle SuSE in hostname operation
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 at 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