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

[virt-tools-list] [PATCH libosinfo 6/7] Add data files for Fedora & Windows unattended installs



From: "Daniel P. Berrange" <berrange redhat com>

For Fedora this adds a kickstart file template which self-adapts
to all Fedora versions 1-> 16

For Windows this adds two file templates, one using the legacy
SIF .ini file format for Win2k3 or earlier, and the other using
the modern unattended XML format for Win2k8 or newer
---
 configure.ac                              |    1 +
 data/Makefile.am                          |    2 +-
 data/install-scripts/Makefile.am          |    9 ++
 data/install-scripts/fedora.xml           |   97 ++++++++++++++++++
 data/install-scripts/windows-sif.xml      |   59 +++++++++++
 data/install-scripts/windows-unattend.xml |  156 +++++++++++++++++++++++++++++
 data/oses/fedora.xml                      |   64 ++++++++++++-
 data/oses/windows.xml                     |   28 +++++
 8 files changed, 414 insertions(+), 2 deletions(-)
 create mode 100644 data/install-scripts/Makefile.am
 create mode 100644 data/install-scripts/fedora.xml
 create mode 100644 data/install-scripts/windows-sif.xml
 create mode 100644 data/install-scripts/windows-unattend.xml

diff --git a/configure.ac b/configure.ac
index 2e3d4d2..8d26d25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,7 @@ AC_CONFIG_FILES([
 	data/devices/Makefile
 	data/hypervisors/Makefile
 	data/oses/Makefile
+	data/install-scripts/Makefile
 	data/schemas/Makefile
 	tools/Makefile
 	scripts/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index b5547cf..6d2003d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,5 @@
 
-SUBDIRS = devices oses hypervisors schemas
+SUBDIRS = devices oses hypervisors schemas install-scripts
 
 EXTRA_DIST = usb.ids pci.ids 95-osinfo.rules.in
 
diff --git a/data/install-scripts/Makefile.am b/data/install-scripts/Makefile.am
new file mode 100644
index 0000000..eb0173a
--- /dev/null
+++ b/data/install-scripts/Makefile.am
@@ -0,0 +1,9 @@
+
+databasedir = $(pkgdatadir)/data/install-scripts/
+database_DATA =     \
+  fedora.xml        \
+  windows-sif.xml   \
+  windows-unattend.xml \
+  $(NULL)
+
+EXTRA_DIST = $(database_DATA)
diff --git a/data/install-scripts/fedora.xml b/data/install-scripts/fedora.xml
new file mode 100644
index 0000000..a1a59fb
--- /dev/null
+++ b/data/install-scripts/fedora.xml
@@ -0,0 +1,97 @@
+<libosinfo version="0.0.1">
+  <install-script id='http://fedoraproject.org/scripts/fedora/jeos'>
+    <profile>jeos</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
+text
+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>
+skipx
+network --device eth0 --bootproto dhcp
+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"/>
+
+<xsl:if test="os/version &gt; 15">
+part biosboot --fstype=biosboot --size=1
+</xsl:if>
+part /boot --fstype <xsl:call-template name="bootfs"/> --size=200 --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
+
+%packages
+ base
+ core
+<xsl:if test="os/version &gt; 6">
+ hardware-support
+</xsl:if>
+
+%end
+	</xsl:template>
+      </xsl:stylesheet>
+    </template>
+  </install-script>
+
+</libosinfo>
\ No newline at end of file
diff --git a/data/install-scripts/windows-sif.xml b/data/install-scripts/windows-sif.xml
new file mode 100644
index 0000000..29a0eae
--- /dev/null
+++ b/data/install-scripts/windows-sif.xml
@@ -0,0 +1,59 @@
+<libosinfo version="0.0.1">
+  <install-script id='http://microsoft.com/windows/sif'>
+    <profile>jeos</profile>
+    <template>
+      <xsl:stylesheet
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+        version="1.0">
+
+        <xsl:output method="text"/>
+
+	<xsl:template match="/install-script-config">
+;SetupMgrTag
+[Data]
+    AutoPartition=1
+    MsDosInitiated=No
+    UnattendedInstall=Yes
+
+[Unattended]
+    UnattendMode=FullUnattended
+    OemSkipEula=Yes
+    OemPreinstall=No
+    TargetPath=\WINDOWS
+    Repartition=Yes
+    WaitForReboot=No
+    UnattendSwitch=Yes
+
+[GuiUnattended]
+    AdminPassword=<xsl:value-of select="config/admin-password"/>
+    EncryptedAdminPassword=NO
+    AutoLogon=No
+    AutoLogonCount=1
+    OEMSkipRegional=1
+    TimeZone=35
+    OemSkipWelcome=1
+
+[UserData]
+    ProductKey=<xsl:value-of select="config/reg-productkey"/>
+    FullName="<xsl:value-of select="config/user-realname"/>"
+    ComputerName=
+
+[Display]
+    BitsPerPel=16
+    Xresolution=640
+    YResolution=480
+    Vrefresh=60
+
+[RegionalSettings]
+    LanguageGroup=1
+
+[Identification]
+    JoinWorkgroup=WORKGROUP
+
+[Networking]
+    InstallDefaultComponents=Yes
+	</xsl:template>
+      </xsl:stylesheet>
+    </template>
+  </install-script>
+</libosinfo>
diff --git a/data/install-scripts/windows-unattend.xml b/data/install-scripts/windows-unattend.xml
new file mode 100644
index 0000000..5b61e73
--- /dev/null
+++ b/data/install-scripts/windows-unattend.xml
@@ -0,0 +1,156 @@
+<libosinfo version="0.0.1">
+  <install-script id='http://microsoft.com/windows/unattend'>
+    <profile>jeos</profile>
+    <template>
+      <xsl:stylesheet
+        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+        version="1.0">
+
+        <xsl:output method="xml"/>
+
+	<xsl:template name="arch">
+	  <xsl:choose>
+	    <xsl:when test="count(config/hardware-arch) &gt; 0">
+	      <xsl:value-of select="config/hardware-arch"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:text>x86</xsl:text>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="/install-script-config">
+	  <unattend xmlns="urn:schemas-microsoft-com:unattend">
+	    <settings pass="windowsPE">
+	      <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+		<xsl:attribute name="processorArchitecture">
+		  <xsl:call-template name="arch"/>
+		</xsl:attribute>
+		<DiskConfiguration>
+		  <WillShowUI>OnError</WillShowUI>
+		  <Disk>
+		    <CreatePartitions>
+		      <CreatePartition>
+			<Order>1</Order>
+			<Size>1</Size>
+			<Type>Primary</Type>
+		      </CreatePartition>
+		    </CreatePartitions>
+		    <DiskID>0</DiskID>
+		    <WillWipeDisk>true</WillWipeDisk>
+		    <ModifyPartitions>
+		      <ModifyPartition>
+			<Active>true</Active>
+			<Extend>true</Extend>
+			<Format>NTFS</Format>
+			<Label>C drive</Label>
+			<Letter>C</Letter>
+			<Order>1</Order>
+			<PartitionID>1</PartitionID>
+		      </ModifyPartition>
+		    </ModifyPartitions>
+		  </Disk>
+		</DiskConfiguration>
+		<ImageInstall>
+		  <OSImage>
+		    <InstallFrom>
+		      <MetaData wcm:action="add">
+			<Key>/IMAGE/INDEX</Key>
+			<Value>1</Value>
+		      </MetaData>
+		    </InstallFrom>
+		    <InstallTo>
+		      <DiskID>0</DiskID>
+		      <PartitionID>1</PartitionID>
+		    </InstallTo>
+		    <WillShowUI>OnError</WillShowUI>
+		  </OSImage>
+		</ImageInstall>
+		<UserData>
+		  <AcceptEula>true</AcceptEula>
+		</UserData>
+	      </component>
+	      <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+		<xsl:attribute name="processorArchitecture">
+		  <xsl:call-template name="arch"/>
+		</xsl:attribute>
+		<SetupUILanguage>
+		  <UILanguage><xsl:value-of select="config/l10n-language"/></UILanguage>
+		</SetupUILanguage>
+		<SystemLocale><xsl:value-of select="config/l10n-language"/></SystemLocale>
+		<UILanguage><xsl:value-of select="config/l10n-language"/></UILanguage>
+		<UserLocale><xsl:value-of select="config/l10n-language"/></UserLocale>
+	      </component>
+	    </settings>
+	    <settings pass="oobeSystem">
+	      <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+		<xsl:attribute name="processorArchitecture">
+		  <xsl:call-template name="arch"/>
+		</xsl:attribute>
+		<UserAccounts>
+		  <AdministratorPassword>
+		    <Value><xsl:value-of select="config/admin-password"/></Value>
+		    <PlainText>true</PlainText>
+		  </AdministratorPassword>
+
+		  <xsl:if test="count(config/user-login) &gt; 0">
+		    <LocalAccounts>
+		      <LocalAccount wcm:action="add">
+			<Password>
+			  <Value><xsl:value-of select="config/user-password"/></Value>
+			  <PlainText>false</PlainText>
+			</Password>
+			<Name><xsl:value-of select="config/user-login"/></Name>
+			<DisplayName><xsl:value-of select="config/user-realname"/></DisplayName>
+			<Group>users</Group>
+		      </LocalAccount>
+		    </LocalAccounts>
+		  </xsl:if>
+		</UserAccounts>
+		<xsl:if test="count(config/user-login) &gt; 0">
+		  <AutoLogon>
+		    <Password>
+		      <Value><xsl:value-of select="config/user-password"/></Value>
+		      <PlainText>true</PlainText>
+		    </Password>
+		    <Enabled>true</Enabled>
+		    <LogonCount>5</LogonCount>
+		    <Username><xsl:value-of select="config/user-login"/></Username>
+		  </AutoLogon>
+		</xsl:if>
+		<OOBE>
+		  <NetworkLocation>Work</NetworkLocation>
+		  <HideEULAPage>true</HideEULAPage>
+		  <ProtectYourPC>3</ProtectYourPC>
+		  <SkipMachineOOBE>true</SkipMachineOOBE>
+		  <SkipUserOOBE>true</SkipUserOOBE>
+		</OOBE>
+		<FirstLogonCommands>
+		  <SynchronousCommand wcm:action="add">
+		    <Order>1</Order>
+		    <Description>Turn Off Network Selection pop-up</Description>
+		    <CommandLine>cmd /c reg add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine>
+		  </SynchronousCommand>
+		  <SynchronousCommand wcm:action="add">
+		    <Order>2</Order>
+		    <Description>Shutting down Windows</Description>
+		    <CommandLine>cmd /C shutdown /s /t 0</CommandLine>
+		  </SynchronousCommand>
+		</FirstLogonCommands>
+	      </component>
+	    </settings>
+	    <settings pass="specialize">
+	      <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+		<xsl:attribute name="processorArchitecture">
+		  <xsl:call-template name="arch"/>
+		</xsl:attribute>
+
+		<ProductKey><xsl:value-of select="config/reg-product-key"/></ProductKey>
+	      </component>
+	    </settings>
+	  </unattend>
+	</xsl:template>
+      </xsl:stylesheet>
+    </template>
+  </install-script>
+</libosinfo>
\ No newline at end of file
diff --git a/data/oses/fedora.xml b/data/oses/fedora.xml
index 841349c..39edfb5 100644
--- a/data/oses/fedora.xml
+++ b/data/oses/fedora.xml
@@ -51,6 +51,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/2";>
@@ -97,6 +101,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/3";>
@@ -143,6 +151,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/4";>
@@ -198,6 +210,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/5";>
@@ -253,6 +269,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/6";>
@@ -308,6 +328,10 @@
       <initrd>images/pxeboot/initrd.img</initrd>
       <boot-iso>images/boot.iso</boot-iso>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/7";>
@@ -386,6 +410,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/8";>
@@ -473,6 +501,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/9";>
@@ -559,6 +591,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/10";>
@@ -642,6 +678,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/11";>
@@ -725,6 +765,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/12";>
@@ -803,6 +847,10 @@
 	<arch>x86_64</arch>
       </treeinfo>
     </tree>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/13";>
@@ -873,6 +921,9 @@
       </treeinfo>
     </tree>
 
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/14";>
@@ -956,6 +1007,10 @@
         <storage>9663676416</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/15";>
@@ -1038,6 +1093,10 @@
         <storage>9663676416</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
   </os>
 
   <os id="http://fedoraproject.org/fedora/16";>
@@ -1120,7 +1179,10 @@
         <storage>9663676416</storage>
       </recommended>
     </resources>
-  </os>
 
+    <installer>
+      <script id='http://fedoraproject.org/scripts/fedora/jeos'/>
+    </installer>
+  </os>
 
 </libosinfo>
diff --git a/data/oses/windows.xml b/data/oses/windows.xml
index 69dec27..37b2afa 100644
--- a/data/oses/windows.xml
+++ b/data/oses/windows.xml
@@ -155,6 +155,10 @@
         <storage>1610612736</storage>
       </minimum>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/sif'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/win2k3";>
@@ -205,6 +209,10 @@
         <storage>8589934592</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/sif'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/win2k3r2";>
@@ -256,6 +264,10 @@
         <storage>8589934592</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/sif'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/win2k8";>
@@ -309,6 +321,10 @@
         <storage>42949672960</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/unattend'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/win2k8r2";>
@@ -341,6 +357,10 @@
         <storage>42949672960</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/unattend'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/vista";>
@@ -379,6 +399,10 @@
         <storage>42949672960</storage>
       </recommended>
     </resources>
+
+    <installer>
+      <script id='http://microsoft.com/windows/unattend'/>
+    </installer>
   </os>
 
   <os id="http://microsoft.com/win7";>
@@ -424,6 +448,10 @@
     <devices>
       <device id="http://pciids.sourceforge.net/v2.2/pci.ids/8086/2668"/> <!-- ICH6 -->
     </devices>
+
+    <installer>
+      <script id='http://microsoft.com/windows/unattend'/>
+    </installer>
   </os>
 
 </libosinfo>
-- 
1.7.7.6


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