[Libosinfo] [RESEND RFC PATCH 2/2] ubuntu: Add jeos install-script (version >= 6.06)
Giuseppe Scrivano
gscrivan at redhat.com
Thu Nov 21 21:39:24 UTC 2013
"Zeeshan Ali (Khattak)" <zeeshanak at gnome.org> 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.
Cheers,
Giuseppe
More information about the Libosinfo
mailing list