summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-07-25 09:51:21 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-07-25 10:42:43 +0200
commit0aabd8f6371bbee1cff5de1f4ad8e4dec7522793 (patch)
treec1a81787b84bb16ac59f1c80371a2488862efa97 /tools
parentd87ae89e8f455f0f0f80d8c047fd735eedbe73ef (diff)
boxes: add script to generate boxes unattended driver ISO
The ISO will contain the viostor drivers so that the automatic install can be done on a virtio disk.
Diffstat (limited to 'tools')
-rw-r--r--tools/boxes-unattended-win-drivers/README77
-rwxr-xr-xtools/boxes-unattended-win-drivers/txtsetup.oem18
-rw-r--r--tools/gen-boxes-unattended-win-iso.py22
3 files changed, 117 insertions, 0 deletions
diff --git a/tools/boxes-unattended-win-drivers/README b/tools/boxes-unattended-win-drivers/README
new file mode 100644
index 0000000..49140c1
--- /dev/null
+++ b/tools/boxes-unattended-win-drivers/README
@@ -0,0 +1,77 @@
+This image contains drivers/tools to be used during an automatic Windows
+installation.
+
+
+
+PRE-INSTALLATION
+
+The preinst/ directory contains device drivers that are needed to start the
+Windows installation. For example, the viostor driver is there since it's
+needed to be able to install Windows on a disk using a virtio controller.
+This directory contains one subdirectory per Windows version.
+
+To use these drivers with Windows XP, they need to be copied to the root of
+the floppy disk containing the Winnt.sif file for unattended installation.
+A txtsetup.oem file is needed too for the installer to pick up these
+drivers, but it's provided with the drivers.
+
+Things are easier with Windows 7: a DriverPath entry pointing directly to
+the CD directory can be added to the appropriate step in the
+Autounattend.xml file, and the Windows installer will be able to pick up
+the drivers directly from the CD.
+
+ <settings pass="windowsPE">
+ <component name="Microsoft-Windows-PnpCustomizationsWinPE"
+ processorArchitecture="x86"
+ publicKeyToken="31bf3856ad364e35"
+ language="neutral" versionScope="nonSxS"
+ xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DriverPaths>
+ <PathAndCredentials wcm:keyValue="2" wcm:action="add">
+ <Path>E:\preinst\win7\</Path>
+ </PathAndCredentials>
+ </DriverPaths>
+ </component>
+ </settings>
+
+
+
+
+POST-INSTALLATION
+
+This directory contains programs and commands that must be run after
+Windows installation is complete. This can be used for example to install
+some needed services or drivers on the system. Both Windows XP and Windows
+7 can directly use the files from the CDROM, they only need to be
+told what to run in the Winnt.sif file or Autounattend.xml file.
+
+This directory contains a postinst.cmd file with a list of commands to be
+run after the Windows installation. Any number of binaries can be added to
+this directory and be referenced by the postinst.cmd file.
+
+Commands specific to a given Windows version go to per-version directory.
+Then a postinst.cmd file from this directory is used for commands specific
+to this Windows version. The common commands should still be run even if
+a Windows specific command file is present.
+
+
+ <settings pass="oobeSystem">
+ <component name="Microsoft-Windows-Shell-Setup"
+processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
+language="neutral" versionScope="nonSxS"
+xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <FirstLogonCommands>
+ <SynchronousCommand wcm:action="add">
+ <Order>1</Order>
+ <CommandLine>E:\postinst\postinst.cmd</CommandLine>
+ </SynchronousCommand>
+ </FirstLogonCommands>
+ </component>
+ </settings>
+
+
+[GuiRunOnce]
+E:\postinst\postinst.cmd
+
diff --git a/tools/boxes-unattended-win-drivers/txtsetup.oem b/tools/boxes-unattended-win-drivers/txtsetup.oem
new file mode 100755
index 0000000..6d140ba
--- /dev/null
+++ b/tools/boxes-unattended-win-drivers/txtsetup.oem
@@ -0,0 +1,18 @@
+[Disks]
+disk1 = "VirtIO Drivers Disk 1",\viostor.sys
+
+[Defaults]
+SCSI = viostor
+
+[SCSI]
+viostor = "VirtIO Disk Controller"
+
+[Files.SCSI.viostor]
+driver = disk1,viostor.sys,VIOSTOR
+inf = disk1,viostor.inf
+catalog = disk1,viostor.cat
+
+[HardwareIds.scsi.viostor]
+id = "PCI\VEN_1AF4&DEV_1001&SUBSYS_00000000","viostor"
+id = "PCI\VEN_1AF4&DEV_1001&SUBSYS_00020000","viostor"
+id = "PCI\VEN_1AF4&DEV_1001&SUBSYS_00021AF4","viostor"
diff --git a/tools/gen-boxes-unattended-win-iso.py b/tools/gen-boxes-unattended-win-iso.py
new file mode 100644
index 0000000..3002779
--- /dev/null
+++ b/tools/gen-boxes-unattended-win-iso.py
@@ -0,0 +1,22 @@
+#/usr/bin/python
+
+import iso
+import os
+import shutil
+import virtio
+
+tempdir = "tmp"
+os.makedirs(tempdir)
+mountpoint = os.path.join(tempdir, "mnt")
+base_dest = os.path.join(tempdir, "boxes")
+drivers_dest = os.path.join(base_dest, "preinst")
+output_iso_name = "boxes-unattended-win-drivers.iso"
+
+iso_name = virtio.download_iso(tempdir)
+iso_path = os.path.join(tempdir, iso_name)
+with iso.IsoMounter(iso_path, mountpoint):
+ virtio.copy_drivers(mountpoint, drivers_dest)
+shutil.copy(os.path.join("boxes-unattended-win-drivers", "README"), base_dest)
+shutil.copy(os.path.join("boxes-unattended-win-drivers", "txtsetup.oem"), os.path.join(drivers_dest, "winxp", "x86"))
+iso.geniso(base_dest, output_iso_name)
+print "done"