On Thu, Nov 21, 2013 at 9:39 PM, Giuseppe Scrivano <gscrivan@xxxxxxxxxx> wrote: > "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx> writes: > >> Ah ok but that could imply that we require some config variable to be >> set, which we don't declare as mandatory. I would feel much better >> about merging these if they are actually tested in any UI (be that >> virt-manager or Boxes). > > I have done some tests, after I amended these bits on top of my original > patch: > > > diff --git a/data/install-scripts/ubuntu.xml b/data/install-scripts/ubuntu.xml > index f86eff4..0379ddf 100644 > --- a/data/install-scripts/ubuntu.xml > +++ b/data/install-scripts/ubuntu.xml > @@ -30,6 +30,18 @@ > </xsl:choose> > </xsl:template> > > + <xsl:template name="hostname"> > + <xsl:choose> > + <xsl:when test="config/hostname != ''"> > + <xsl:value-of select="config/hostname"/> > + </xsl:when> > + <xsl:otherwise> > + <!-- IDE --> > + <xsl:text>localhost</xsl:text> > + </xsl:otherwise> > + </xsl:choose> > + </xsl:template> > + > <xsl:template match="/install-script-config"> > # Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/> > d-i debian-installer/locale string <xsl:value-of select="config/l10n-language"/> > @@ -37,7 +49,7 @@ d-i console-setup/ask_detect boolean false > d-i console-setup/layoutcode string <xsl:value-of select="config/l10n-keyboard"/> > > d-i netcfg/choose_interface select auto > -d-i netcfg/get_hostname string <xsl:value-of select="config/hostname"/> > +d-i netcfg/get_hostname string <xsl:call-template name="hostname"/> > d-i netcfg/get_domain string unassigned-domain > d-i netcfg/wireless_wep string > > --------------------------------------------------------------------------------------------------------------------- > > and then I was able to run: > > virt-install --os-type=linux --os-variant=ubunturaring --name=foo --ram=1024 --initrd-inject=preseed.cfg --disk=ubuntu.img,size=10 --location=http://us.archive.ubuntu.com/ubuntu/dists/raring/main/installer-i386 --extra-args="locale=en_US priority=critical console-setup/ask_detect=false keyboard-configuration/layoutcode=us hostname=virtual domain=unassigned-domain interface=auto file=file:/preseed.cfg" --virt-type kvm --video=vga > > I am quite sure that some of the arguments in --extra-args can be > removed (I have discovered priority=critical when it was too late in my > trial-and-error process) and I've got a VM running Ubuntu Raring. Cool, well ACK if you have tested these and now that Chris gave his permission for re-licensing. Since these scripts only work with initrd injection, I think we need some kind of indication xml & api to indicate the need for that to the Apps. Perhaps a boolean 'initrd-injection-required' in the script xml and corresponding getter on InstallScript class? -- Regards, Zeeshan Ali (Khattak) FSF member#5124 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo