Pino Toscano
2019-Sep-26 15:32 UTC
[Libguestfs] [p2v PATCH] make-disk: set p2v.local as hostname
Set p2v.local as hostname for the p2v disk image, so it will be fixed, instead of whatever is set in the used templates. This is also somewhat important during the distribution update, and installation of our packages: there may be distribution packages actually using the hostname to initialize stuff (e.g. configuration values), and thus the unset value "(none)" triggers errors. The additional command to set the hostname is for the appliance itself: the hostname will be set on the running kernel, which is the appliance own, so getting it later on with hostname(1) works. --- virt-p2v-make-disk.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in index 1bec4e3..132211d 100644 --- a/virt-p2v-make-disk.in +++ b/virt-p2v-make-disk.in @@ -233,11 +233,16 @@ fi # Run virt-builder. Note we controversially assume systemd here. We # could provide a sysvinit fallback if required. +# The manual 'hostname' invocation is needed to set the hostname +# also for the appliance itself, so scriptlets can properly use +# the hostname we want. virt-builder "$osversion" \ $verbose_option \ --output "$output" \ $arch_option \ $preinstall_args \ + --hostname p2v.local \ + --run-command 'hostname p2v.local' \ --update \ --install "$install" \ --root-password password:p2v \ -- 2.21.0
Richard W.M. Jones
2019-Sep-28 11:23 UTC
Re: [Libguestfs] [p2v PATCH] make-disk: set p2v.local as hostname
On Thu, Sep 26, 2019 at 05:32:54PM +0200, Pino Toscano wrote:> Set p2v.local as hostname for the p2v disk image, so it will be fixed, > instead of whatever is set in the used templates. This is also somewhat > important during the distribution update, and installation of our > packages: there may be distribution packages actually using the hostname > to initialize stuff (e.g. configuration values), and thus the unset > value "(none)" triggers errors. > > The additional command to set the hostname is for the appliance itself: > the hostname will be set on the running kernel, which is the appliance > own, so getting it later on with hostname(1) works.I think you mean "appliance’s own" in this sentence?> --- > virt-p2v-make-disk.in | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in > index 1bec4e3..132211d 100644 > --- a/virt-p2v-make-disk.in > +++ b/virt-p2v-make-disk.in > @@ -233,11 +233,16 @@ fi > > # Run virt-builder. Note we controversially assume systemd here. We > # could provide a sysvinit fallback if required. > +# The manual 'hostname' invocation is needed to set the hostname > +# also for the appliance itself, so scriptlets can properly use > +# the hostname we want. > virt-builder "$osversion" \ > $verbose_option \ > --output "$output" \ > $arch_option \ > $preinstall_args \ > + --hostname p2v.local \ > + --run-command 'hostname p2v.local' \ > --update \ > --install "$install" \ > --root-password password:p2v \ > --I thought I'd ACKed this already ... Anyhow, ACK Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Seemingly Similar Threads
- [PATCH 4/4] p2v: virt-p2v-make-disk: prevent daemons to run on Debian
- [PATCH 0/4] p2v: fix virt-p2v-make-disk on Debian
- [PATCH] p2v: Compress virt-p2v binary and store it in $libdir/virt-p2v (RHBZ#1382275).
- [PATCH] p2v: make-disk: rely on os-release for host distro detection
- [PATCH 0/3] p2v: Add Configure Network button (RHBZ#1167921).