[osinfo-db PATCH 02/16] install-script, fedora: Improve script-disk template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's improve the script disk template so we don't actually require the
apps to set it (but, if they do, the value set will be used).

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 .../fedora-kickstart-desktop.xml.in             | 17 +++++++++++++++--
 .../fedora-kickstart-jeos.xml.in                | 17 +++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
index 0d14243..d21fdbb 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
@@ -15,7 +15,7 @@
         <param name="avatar-location" policy="optional"/>
         <param name="avatar-disk" policy="optional"/>
         <param name="target-disk" policy="optional"/>
-        <param name="script-disk" policy="required"/>
+        <param name="script-disk" policy="optional"/>
     </config>
     <injection-method>cdrom</injection-method>
     <injection-method>disk</injection-method>
@@ -53,7 +53,20 @@
 
         <xsl:template name="script-disk">
           <xsl:variable name="script-disk">
-            <xsl:value-of select="config/script-disk"/>
+            <xsl:choose>
+              <xsl:when test="config/script-disk != ''">
+                <xsl:value-of select="config/script-disk"/>
+              </xsl:when>
+              <xsl:when test="os/version &gt; 9">
+                <xsl:text>/dev/sda</xsl:text>
+              </xsl:when>
+              <xsl:when test="os/version &gt; 6">
+                <xsl:text>/dev/sdb</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>/dev/hdb</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:variable>
           <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
         </xsl:template>
diff --git a/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
index 79b5846..68ece05 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
@@ -10,7 +10,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"/>
+      <param name="script-disk" policy="optional"/>
     </config>
     <injection-method>cdrom</injection-method>
     <injection-method>disk</injection-method>
@@ -45,7 +45,20 @@
 
         <xsl:template name="script-disk">
           <xsl:variable name="script-disk">
-            <xsl:value-of select="config/script-disk"/>
+            <xsl:choose>
+              <xsl:when test="config/script-disk != ''">
+                <xsl:value-of select="config/script-disk"/>
+              </xsl:when>
+              <xsl:when test="os/version &gt; 9">
+                <xsl:text>/dev/sda</xsl:text>
+              </xsl:when>
+              <xsl:when test="os/version &gt; 6">
+                <xsl:text>/dev/sdb</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>/dev/hdb</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:variable>
           <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
         </xsl:template>
-- 
2.21.0

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux