diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | images/Makefile.am | 31 | ||||
-rwxr-xr-x | images/guest-aux/make-windows-img.sh | 54 | ||||
-rwxr-xr-x | images/guest-aux/minimal-hive | bin | 0 -> 8192 bytes | |||
-rwxr-xr-x | images/guest-aux/windows-software | bin | 0 -> 12288 bytes | |||
-rw-r--r-- | images/guest-aux/windows-software.reg | 32 | ||||
-rwxr-xr-x | images/guest-aux/windows-system | bin | 0 -> 12288 bytes | |||
-rw-r--r-- | images/guest-aux/windows-system.reg | 8 |
8 files changed, 124 insertions, 2 deletions
@@ -134,6 +134,7 @@ images/initrd-x86_64.img.gz images/test.iso images/test-grep.txt.gz images/ubuntu.img +images/windows.img initramfs initramfs.timestamp inspector/virt-inspector.1 diff --git a/images/Makefile.am b/images/Makefile.am index d97dd458..56880804 100644 --- a/images/Makefile.am +++ b/images/Makefile.am @@ -42,13 +42,19 @@ EXTRA_DIST = \ guest-aux/make-fedora-img.sh \ guest-aux/fedora-name.db.txt \ guest-aux/fedora-name.db \ - guest-aux/make-ubuntu-img.sh + guest-aux/make-ubuntu-img.sh \ + guest-aux/make-windows-img.sh \ + guest-aux/windows-software \ + guest-aux/windows-software.reg \ + guest-aux/windows-system \ + guest-aux/windows-system.reg \ + guest-aux/minimal-hive noinst_DATA = test.iso # This is 'check_DATA' because we don't need it until 'make check' # time and we need the tools we have built in order to make it. -check_DATA = debian.img fedora.img ubuntu.img +check_DATA = debian.img fedora.img ubuntu.img windows.img CLEANFILES = \ test.iso test.sqsh \ @@ -181,3 +187,24 @@ ubuntu.img: guest-aux/make-ubuntu-img.sh LIBGUESTFS_PATH=../appliance \ LD_LIBRARY_PATH=../src/.libs \ bash $< + +# Make a (dummy) Windows image. +windows.img: guest-aux/make-windows-img.sh \ + guest-aux/windows-software guest-aux/windows-system + LIBGUESTFS_PATH=../appliance \ + LD_LIBRARY_PATH=../src/.libs \ + bash $< + +# Since users might not have the tools needed to create this, we +# also distribute these files. +guest-aux/windows-software: guest-aux/windows-software.reg + rm -f $@ $@-t + cp guest-aux/minimal-hive $@-t + hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SOFTWARE' $< + mv $@-t $@ + +guest-aux/windows-system: guest-aux/windows-system.reg + rm -f $@ $@-t + cp guest-aux/minimal-hive $@-t + hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $< + mv $@-t $@ diff --git a/images/guest-aux/make-windows-img.sh b/images/guest-aux/make-windows-img.sh new file mode 100755 index 00000000..5a0cd6de --- /dev/null +++ b/images/guest-aux/make-windows-img.sh @@ -0,0 +1,54 @@ +#!/bin/bash - +# libguestfs +# Copyright (C) 2010 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Make a Windows image which is enough to fool the inspection heuristics. + +export LANG=C +set -e + +# Create a disk image. +../fish/guestfish <<'EOF' +sparse windows.img.tmp 512M +run + +# Format the disk. +part-init /dev/sda mbr +part-add /dev/sda p 64 524287 +part-add /dev/sda p 524288 -64 + +# Phony boot loader filesystem. +mkfs ntfs /dev/sda1 + +# Phony root filesystem. +mkfs ntfs /dev/sda2 + +# Enough to fool inspection API. +mount-options "" /dev/sda2 / +mkdir-p /Windows/System32/Config + +upload guest-aux/windows-software /Windows/System32/Config/SOFTWARE +upload guest-aux/windows-system /Windows/System32/Config/SYSTEM + +upload bin-win32.exe /Windows/System32/cmd.exe + +mkdir "/Program Files" +touch /autoexec.bat + +EOF + +mv windows.img.tmp windows.img diff --git a/images/guest-aux/minimal-hive b/images/guest-aux/minimal-hive Binary files differnew file mode 100755 index 00000000..3f4ee58c --- /dev/null +++ b/images/guest-aux/minimal-hive diff --git a/images/guest-aux/windows-software b/images/guest-aux/windows-software Binary files differnew file mode 100755 index 00000000..1091c13e --- /dev/null +++ b/images/guest-aux/windows-software diff --git a/images/guest-aux/windows-software.reg b/images/guest-aux/windows-software.reg new file mode 100644 index 00000000..984cbe42 --- /dev/null +++ b/images/guest-aux/windows-software.reg @@ -0,0 +1,32 @@ +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion] +"ProductName"=str(1):"Microsoft Windows 7 Phony Edition" +"CurrentVersion"=str(1):"6.1" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test1] +"DisplayName"=str(1):"Test1 is not real software" +"URLInfoAbout"=str(1):"http://libguestfs.org/" +"DisplayVersion"=str(1):"1.2.3" +"VersionMajor"=dword:00000001 +"VersionMinor"=dword:00000002 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test2] +"DisplayName"=str(1):"Test2 is not real software" +"URLInfoAbout"=str(1):"http://libguestfs.org/" +"DisplayVersion"=str(1):"1.2.4" +"Comments"=str(1):"Longer description about phony test2 software" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\test3] +"DisplayName"=str(1):"Test3 is not real software" +"DisplayVersion"=str(1):"1.2.5" +"Publisher"=str(1):"Red Hat Inc." +"InstallLocation"=str(1):"C:\\Program Files\\Red Hat\\test3" diff --git a/images/guest-aux/windows-system b/images/guest-aux/windows-system Binary files differnew file mode 100755 index 00000000..7d935b02 --- /dev/null +++ b/images/guest-aux/windows-system diff --git a/images/guest-aux/windows-system.reg b/images/guest-aux/windows-system.reg new file mode 100644 index 00000000..87ae7796 --- /dev/null +++ b/images/guest-aux/windows-system.reg @@ -0,0 +1,8 @@ +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001] + +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services] + +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip] + +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters] +"Hostname"=str(1):"windows.invalid" |