[Libosinfo] [osinfo-db PATCH 12/16] install-script, rhel, desktop: Add avatar-disk template
Fabiano Fidêncio
fidencio at redhat.com
Tue Jun 18 19:06:28 UTC 2019
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 at redhat.com>
---
.../redhat.com/rhel-kickstart-desktop.xml.in | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in b/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
index d4993e8..8353929 100644
--- a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
+++ b/data/install-script/redhat.com/rhel-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 > 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 name="installation-url">
<xsl:choose>
<xsl:when test="config/installation-url != ''">
@@ -167,7 +183,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
More information about the Libosinfo
mailing list