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

[virt-tools-list] [PATCH 08/10] Add desktop profile for Fedora 15 and newer



    Based on boxes install script for fedora.
---
 data/install-scripts/fedora.xml |  148 ++++++++++++++++++++++++++++++++++++++-
 data/oses/fedora.xml            |    2 +
 2 files changed, 149 insertions(+), 1 deletion(-)

diff --git a/data/install-scripts/fedora.xml b/data/install-scripts/fedora.xml
index a1a59fb..78d8efa 100644
--- a/data/install-scripts/fedora.xml
+++ b/data/install-scripts/fedora.xml
@@ -1,4 +1,5 @@
 <libosinfo version="0.0.1">
+  <!-- JEOS PROFILE -->
   <install-script id='http://fedoraproject.org/scripts/fedora/jeos'>
     <profile>jeos</profile>
     <template>
@@ -94,4 +95,149 @@ reboot
     </template>
   </install-script>
 
-</libosinfo>
\ No newline at end of file
+  <!-- DESKTOP PROFILE -->
+  <install-script id='http://fedoraproject.org/scripts/fedora/desktop'>
+    <profile>desktop</profile>
+    <template>
+      <xsl:stylesheet
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+        version="1.0">
+
+        <xsl:output method="text"/>
+
+	<xsl:template name="disk">
+	  <xsl:choose>
+	    <xsl:when test="os/version &gt; 9">
+	      <!-- virtio -->
+	      <xsl:text>vda</xsl:text>
+	    </xsl:when>
+	    <xsl:when test="os/version &gt; 6">
+	      <!-- libata IDE -->
+	      <xsl:text>sda</xsl:text>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <!-- IDE -->
+	      <xsl:text>hda</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="rootfs">
+	  <xsl:choose>
+	    <xsl:when test="os/version &gt; 10">
+	      <xsl:text>ext4</xsl:text>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:text>ext3</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="bootfs">
+	  <xsl:choose>
+	    <xsl:when test="os/version &gt; 11">
+	      <xsl:text>ext4</xsl:text>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:text>ext3</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</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
+keyboard <xsl:value-of select="config/l10n-keyboard"/>
+lang <xsl:value-of select="config/l10n-language"/>
+<xsl:if test="os/version &lt; 7">
+langsupport --default <xsl:value-of select="config/l10n-language"/> <xsl:value-of select="config/l10n-language"/>
+mouse generic3ps/2 --device psaux
+</xsl:if>
+network --onboot yes --device eth0 --bootproto dhcp --noipv6 --activate
+rootpw <xsl:value-of select="config/admin-password"/>
+firewall --disabled
+authconfig --enableshadow --enablemd5
+<xsl:if test="os/version &gt; 1">
+selinux --enforcing
+</xsl:if>
+timezone --utc <xsl:value-of select="config/l10n-timezone"/>
+bootloader --location=mbr
+zerombr <xsl:if test="os/version &lt; 14">yes</xsl:if>
+
+clearpart --all --drives=<xsl:call-template name="disk"/>
+
+firstboot --disable
+
+<xsl:if test="os/version &gt; 15">
+part biosboot --fstype=biosboot --size=1
+</xsl:if>
+part /boot --fstype <xsl:call-template name="bootfs"/> --recommended --ondisk=<xsl:call-template name="disk"/>
+part pv.2 --size=1 --grow --ondisk=<xsl:call-template name="disk"/>
+volgroup VolGroup00 --pesize=32768 pv.2
+logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536
+logvol / --fstype <xsl:call-template name="rootfs"/> --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
+reboot
+
+user --name=<xsl:value-of select="config/user-login"/> --password=<xsl:value-of select="config/user-password"/>
+
+<xsl:if test="os/version &lt; 17">
+repo --name=fedora
+repo --name=update
+</xsl:if>
+
+%packages
+ base
+ core
+ hardware-support
+ base-x
+ gnome-desktop
+ graphical-internet
+ sound-and-video
+
+# QXL driver and SPICE vdagent
+xorg-x11-drv-qxl
+spice-vdagent
+
+%end
+
+%post --erroronfail
+
+# Add user to admin group
+usermod -a -G wheel <xsl:value-of select="config/user-login"/>
+
+# Set user avatar
+mkdir /mnt/unattended-media
+mount /dev/sda /mnt/unattended-media
+cp /mnt/unattended-media/<xsl:value-of select="config/user-login"/> /var/lib/AccountsService/icons/
+umount /mnt/unattended-media
+echo "
+[User]
+Language=
+XSession=
+Icon=/var/lib/AccountsService/icons/<xsl:value-of select="config/user-login"/>
+" >> /var/lib/AccountsService/users/<xsl:value-of select="config/user-login"/>
+
+# Enable autologin
+echo "[daemon]
+AutomaticLoginEnable=true
+AutomaticLogin=<xsl:value-of select="config/user-login"/>
+
+[security]
+
+[xdmcp]
+
+[greeter]
+
+[chooser]
+
+[debug]
+" > /etc/gdm/custom.conf
+
+%end
+	</xsl:template>
+      </xsl:stylesheet>
+    </template>
+  </install-script>
+
+
+</libosinfo>
diff --git a/data/oses/fedora.xml b/data/oses/fedora.xml
index 786cbde..87af194 100644
--- a/data/oses/fedora.xml
+++ b/data/oses/fedora.xml
@@ -1111,6 +1111,7 @@
 
     <installer>
       <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+      <script id='http://fedoraproject.org/scripts/fedora/desktop'/>
     </installer>
   </os>
 
@@ -1198,6 +1199,7 @@
 
     <installer>
       <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+      <script id='http://fedoraproject.org/scripts/fedora/desktop'/>
     </installer>
   </os>
 
-- 
1.7.10.2


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