[Libosinfo] [PATCHv2 2/2] rhel, fedora: Add kickstart commandline

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Fri Apr 12 13:44:21 UTC 2013


On Fri, Apr 12, 2013 at 4:09 AM, Fabiano Fidêncio <fidencio at redhat.com> wrote:
> ---
>  data/install-scripts/fedora.xml | 34 ++++++++++++++++++++++++++++++++++
>  data/install-scripts/rhel.xml   | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+)
>
> diff --git a/data/install-scripts/fedora.xml b/data/install-scripts/fedora.xml
> index b5b20bb..a52fc09 100644
> --- a/data/install-scripts/fedora.xml
> +++ b/data/install-scripts/fedora.xml
> @@ -9,6 +9,7 @@
>        <param name="l10n-language" policy="optional"/>
>        <param name="l10n-timezone" policy="optional"/>
>        <param name="target-disk" policy="optional"/>
> +      <param name="script-disk" policy="required"/>
>      </config>
>      <template>
>        <xsl:stylesheet
> @@ -37,6 +38,15 @@
>            </xsl:choose>
>          </xsl:template>
>
> +        <xsl:template name="script-disk">
> +          <xsl:if test="config/script-disk != ''">

This check is redundant as script-disk is now mandatory.

> +            <xsl:variable name="script-disk">
> +              <xsl:value-of select="config/script-disk"/>
> +            </xsl:variable>
> +            <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
> +          </xsl:if>
> +        </xsl:template>
> +
>
>         <xsl:template name="rootfs">
>           <xsl:choose>
>             <xsl:when test="os/version > 10">
> @@ -74,6 +84,13 @@
>           </xsl:choose>
>         </xsl:template>
>
> +        <xsl:template match="/command-line">
> +            <xsl:text>ks=hd:</xsl:text>
> +            <xsl:call-template name="script-disk"/>
> +            <xsl:text>:/</xsl:text>
> +            <xsl:value-of select="script/expected-filename"/>
> +        </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"/>
>  install
> @@ -143,6 +160,7 @@ reboot
>          <param name="avatar-location" policy="optional"/>
>          <param name="avatar-disk" policy="optional"/>
>          <param name="target-disk" policy="optional"/>
> +        <param name="script-disk" policy="required"/>
>      </config>
>      <avatar-format>
>        <mime-type>image/png</mime-type>
> @@ -174,6 +192,15 @@ reboot
>            </xsl:choose>
>          </xsl:template>
>
> +        <xsl:template name="script-disk">
> +          <xsl:if test="config/script-disk != ''">

Same here.

> +            <xsl:variable name="script-disk">
> +              <xsl:value-of select="config/script-disk"/>
> +            </xsl:variable>
> +            <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
> +          </xsl:if>
> +        </xsl:template>
> +
>         <xsl:template name="rootfs">
>           <xsl:choose>
>             <xsl:when test="os/version > 10">
> @@ -211,6 +238,13 @@ reboot
>           </xsl:choose>
>         </xsl:template>
>
> +        <xsl:template match="/command-line">
> +            <xsl:text>ks=hd:</xsl:text>
> +            <xsl:call-template name="script-disk"/>
> +            <xsl:text>:/</xsl:text>
> +            <xsl:value-of select="script/expected-filename"/>
> +        </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"/>
>  install
> diff --git a/data/install-scripts/rhel.xml b/data/install-scripts/rhel.xml
> index 37cf410..f26adc2 100644
> --- a/data/install-scripts/rhel.xml
> +++ b/data/install-scripts/rhel.xml
> @@ -9,6 +9,7 @@
>        <param name="l10n-language" policy="optional"/>
>        <param name="l10n-timezone" policy="optional"/>
>        <param name="target-disk" policy="optional"/>
> +      <param name="script-disk" policy="required"/>
>      </config>
>      <template>
>        <xsl:stylesheet
> @@ -33,6 +34,22 @@
>            </xsl:choose>
>          </xsl:template>
>
> +        <xsl:template name="script-disk">
> +          <xsl:if test="config/script-disk != ''">

Here too

> +            <xsl:variable name="script-disk">
> +              <xsl:value-of select="config/script-disk"/>
> +            </xsl:variable>
> +            <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
> +          </xsl:if>
> +        </xsl:template>
> +
> +        <xsl:template match="/command-line">
> +            <xsl:text>ks=hd:</xsl:text>
> +            <xsl:call-template name="script-disk"/>
> +            <xsl:text>:/</xsl:text>
> +            <xsl:value-of select="script/expected-filename"/>
> +        </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"/>
>  install
> @@ -92,6 +109,7 @@ reboot
>          <param name="avatar-location" policy="optional"/>
>          <param name="avatar-disk" policy="optional"/>
>          <param name="target-disk" policy="optional"/>
> +        <param name="script-disk" policy="required"/>
>      </config>
>      <avatar-format>
>        <mime-type>image/png</mime-type>
> @@ -119,6 +137,22 @@ reboot
>            </xsl:choose>
>          </xsl:template>
>
> +        <xsl:template name="script-disk">
> +          <xsl:if test="config/script-disk != ''">

And here.

> +            <xsl:variable name="script-disk">
> +              <xsl:value-of select="config/script-disk"/>
> +            </xsl:variable>
> +            <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
> +          </xsl:if>
> +        </xsl:template>
> +
> +        <xsl:template match="/command-line">
> +            <xsl:text>ks=hd:</xsl:text>
> +            <xsl:call-template name="script-disk"/>
> +            <xsl:text>:/</xsl:text>
> +            <xsl:value-of select="script/expected-filename"/>
> +        </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"/>
>  install

ACK with redundant ifs removed.

--
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the Libosinfo mailing list