[Libosinfo] [PATCH 7/7] data: added lxc install script for suse
Daniel P. Berrange
berrange at redhat.com
Mon Apr 14 15:03:25 UTC 2014
On Mon, Apr 14, 2014 at 04:09:38PM +0200, Cédric Bosdonnat wrote:
> ---
> data/install-scripts/Makefile.am | 1 +
> data/install-scripts/suse.xml | 41 ++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 42 insertions(+)
> create mode 100644 data/install-scripts/suse.xml
>
> diff --git a/data/install-scripts/Makefile.am b/data/install-scripts/Makefile.am
> index 78decc2..71dc277 100644
> --- a/data/install-scripts/Makefile.am
> +++ b/data/install-scripts/Makefile.am
> @@ -4,6 +4,7 @@ database_DATA = \
> debian.xml \
> fedora.xml \
> rhel.xml \
> + suse.xml \
> ubuntu.xml \
> windows-sif.xml \
> windows-cmd.xml \
> diff --git a/data/install-scripts/suse.xml b/data/install-scripts/suse.xml
> new file mode 100644
> index 0000000..79ff53d
> --- /dev/null
> +++ b/data/install-scripts/suse.xml
> @@ -0,0 +1,41 @@
> +<libosinfo version="0.0.1">
> + <install-script id='http://suse.com/scripts/sle/lxc'>
> + <profile>lxc</profile>
> + <expected-filename>create-rootfs.sh</expected-filename>
> + <config>
> + <param name="admin-password" policy="optional"/>
> + <!-- target-disk contains the path to the rootfs to create -->
> + <param name="target-disk" policy="required"/>
> + <!-- script-disk contains the path to the ISO to use -->
> + <param name="script-disk" policy="required"/>
> + <!-- The registration key from SCC -->
> + <param name="reg-product-key" policy="required"/>
> + </config>
> + <injection-method>lxc</injection-method>
> + <template>
> + <xsl:stylesheet
> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> + version="1.0">
> +
> + <xsl:output method="text"/>
> +
> + <xsl:template match="/command-line">
> + <xsl:text>/bin/sh</xsl:text>
> + <xsl:value-of select="script/expected-filename"/>
> + </xsl:template>
> +
> + <xsl:template match="/install-script-config">#!/bin/sh
> +SUSEConnect --root <xsl:value-of select="config/target-disk"/> -r <xsl:value-of select="config/reg-product-key"/>
> +zypper --root <xsl:value-of select="config/target-disk"/> --non-interactive \
> + in --auto-agree-with-licenses -t pattern Minimal
> +echo "pts/0" >> <xsl:value-of select="config/target-disk"/>etc/securetty
> + <xsl:if test="config/admin-password != ''">
> +echo "root:<xsl:value-of select="config/admin-password"/>" | chpasswd \
> + --root <xsl:value-of select="config/target-disk"/>
> + </xsl:if>
> + </xsl:template>
> +
> + </xsl:stylesheet>
> + </template>
> + </install-script>
> +</libosinfo>
Can you explain a bit about what this is doing / how it is working ?
Obviously given the injection method, this is not going to work for
non-lxc cases.
How does a client app make use of this 'lxc' injection method ?
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the Libosinfo
mailing list