[osinfo-db PATCH 14/15] install-script, centos, desktop: Add avatar-disk template

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

 



Let's add the avatar disk template, which considers that the avatar file
is stored together with the install scripts files, 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>
---
 .../centos.org/centos-kickstart-desktop.xml.in | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/data/install-script/centos.org/centos-kickstart-desktop.xml.in b/data/install-script/centos.org/centos-kickstart-desktop.xml.in
index 76c747a..427a124 100644
--- a/data/install-script/centos.org/centos-kickstart-desktop.xml.in
+++ b/data/install-script/centos.org/centos-kickstart-desktop.xml.in
@@ -64,6 +64,22 @@
           <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
         </xsl:template>
 
+        <!-- The default values of avatar-disk consider the avatar is stored
+             in the same disk as the installation scripts. -->
+        <xsl:template name="avatar-disk">
+          <xsl:choose>
+            <xsl:when test="config/avatar-disk != ''">
+              <xsl:value-of select="config/avatar-disk"/>
+            </xsl:when>
+            <xsl:when test="os/version &gt; 5.5">
+              <xsl:text>/dev/sda</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>/dev/sdb</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:template>
+
         <xsl:template match="/command-line">
           <xsl:text>ks=</xsl:text>
           <xsl:choose>
@@ -195,7 +211,7 @@ fi
 # Set user avatar
 if test -n '<xsl:value-of select="config/avatar-location"/>'; then
 mkdir /mnt/unattended-media
-mount <xsl:value-of select='config/avatar-disk'/> /mnt/unattended-media
+mount <xsl:call-template name="avatar-disk"/> /mnt/unattended-media
 cp /mnt/unattended-media<xsl:value-of select="config/avatar-location"/> /home/<xsl:value-of select="config/user-login"/>/.face
 umount /mnt/unattended-media
 fi
-- 
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