[osinfo-db PATCH 05/16] install-script, silverblue: Add target-disk template

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

 



Let's add a target-disk template so we actually can use what apps set
as target-disk, instead of using a hardcoded path to /dev/vda.

With this change we keep not requiring the apps to set this value.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 .../silverblue-kickstart-desktop.xml.in           | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/data/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml.in b/data/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml.in
index e981184..72ed130 100644
--- a/data/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml.in
+++ b/data/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml.in
@@ -12,6 +12,7 @@
         <param name="user-login" policy="required"/>
         <param name="user-password" policy="optional"/>
         <param name="admin-password" policy="optional"/>
+        <param name="target-disk" policy="optional"/>
         <param name="script-disk" policy="optional"/>
     </config>
     <injection-method>cdrom</injection-method>
@@ -25,6 +26,18 @@
 
         <xsl:output method="text"/>
 
+        <xsl:template name="target-disk">
+          <xsl:choose>
+            <xsl:when test="config/target-disk != ''">
+              <xsl:value-of select="config/target-disk"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <!-- virtio -->
+              <xsl:text>/dev/vda</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:template>
+
         <xsl:template name="script-disk">
           <xsl:variable name="script-disk">
             <xsl:choose>
@@ -81,7 +94,7 @@ timezone --utc <xsl:value-of select="config/l10n-timezone"/>
 bootloader --location=mbr
 zerombr
 
-clearpart --all --drives=/dev/vda
+clearpart --all --drives=<xsl:call-template name="target-disk"/>
 
 firstboot --disable
 
-- 
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