1 # libguestfs test images
2 # Copyright (C) 2009-2010 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 include $(top_srcdir)/subdir-rules.mk
20 # Old RHEL 5 autoconf doesn't have builddir.
21 builddir ?= $(top_builddir)/images
27 mbr-ext2-empty.img.gz \
28 empty known-1 known-2 known-3 known-4 known-5 \
40 guest-aux/make-debian-img.sh \
41 guest-aux/debian-packages \
42 guest-aux/make-fedora-img.sh \
43 guest-aux/fedora-name.db.txt \
44 guest-aux/fedora-name.db \
45 guest-aux/fedora-packages.db.txt \
46 guest-aux/fedora-packages.db \
47 guest-aux/make-ubuntu-img.sh \
48 guest-aux/make-windows-img.sh \
49 guest-aux/windows-software \
50 guest-aux/windows-software.reg \
51 guest-aux/windows-system \
52 guest-aux/windows-system.reg \
53 guest-aux/minimal-hive
55 noinst_DATA = test.iso
57 # This is 'check_DATA' because we don't need it until 'make check'
58 # time and we need the tools we have built in order to make it.
59 check_DATA = debian.img fedora.img ubuntu.img windows.img
63 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
67 $(srcdir)/helloworld.tar \
68 $(srcdir)/helloworld.tar.gz \
69 $(srcdir)/helloworld.tar.xz \
76 $(srcdir)/bin-i586-dynamic \
77 $(srcdir)/bin-sparc-dynamic \
78 $(srcdir)/bin-win32.exe \
79 $(srcdir)/bin-win64.exe \
80 $(srcdir)/bin-x86_64-dynamic \
81 $(srcdir)/lib-i586.so \
82 $(srcdir)/lib-sparc.so \
83 $(srcdir)/lib-win32.dll \
84 $(srcdir)/lib-win64.dll \
85 $(srcdir)/lib-x86_64.so \
86 $(srcdir)/test-grep.txt
88 images_files_build = \
89 $(builddir)/100kallzeroes \
90 $(builddir)/100kallnewlines \
91 $(builddir)/100kallspaces \
92 $(builddir)/100krandom \
93 $(builddir)/10klines \
94 $(builddir)/abssymlink \
95 $(builddir)/hello.b64 \
97 $(builddir)/initrd-x86_64.img \
98 $(builddir)/initrd-x86_64.img.gz \
99 $(builddir)/test-grep.txt.gz
101 images_files = $(images_files_src) $(images_files_build)
103 test.iso: $(images_files)
106 $(GENISOIMAGE) -J -r -graft-points \
108 $(images_files) /directory=directory
112 $(builddir)/100kallzeroes:
114 dd if=/dev/zero of=$@-t bs=1024 count=100
117 $(builddir)/100kallnewlines: $(builddir)/100kallzeroes
119 tr '\0' '\n' < $< > $@-t
122 $(builddir)/100kallspaces: $(builddir)/100kallzeroes
124 tr '\0' ' ' < $< > $@-t
127 $(builddir)/100krandom:
129 dd if=/dev/urandom of=$@-t bs=1024 count=100
132 $(builddir)/10klines:
135 while [ $$i -lt 10000 ]; do \
136 echo "$${i}abcdefghijklmnopqrstuvwxyz"; \
141 $(builddir)/abssymlink:
144 $(builddir)/hello.b64:
145 echo "hello" | base64 > $@
147 $(builddir)/initrd: empty known-1 known-2 known-3 known-4 known-5
149 for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t
152 # Create a dummy initrd with a single file called 'bin/nash' which
153 # is used to test the Sys::Guestfs::Lib::file_architecture function.
154 $(builddir)/initrd-x86_64.img: bin-x86_64-dynamic
158 echo bin/nash | cpio -o -H newc > $@-t
162 $(builddir)/initrd-x86_64.img.gz: initrd-x86_64.img
164 gzip --best -c $< > $@-t
167 $(builddir)/test-grep.txt.gz: test-grep.txt
169 gzip --best -c $< > $@-t
172 # Make a (dummy) Fedora image.
173 fedora.img: guest-aux/make-fedora-img.sh \
174 guest-aux/fedora-name.db \
175 guest-aux/fedora-packages.db
176 LIBGUESTFS_PATH=../appliance \
177 LD_LIBRARY_PATH=../src/.libs \
180 guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
185 guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt
190 # Make a (dummy) Debian image.
191 debian.img: guest-aux/make-debian-img.sh
192 LIBGUESTFS_PATH=../appliance \
193 LD_LIBRARY_PATH=../src/.libs \
196 # Make a (dummy) Ubuntu image.
197 ubuntu.img: guest-aux/make-ubuntu-img.sh
198 LIBGUESTFS_PATH=../appliance \
199 LD_LIBRARY_PATH=../src/.libs \
202 # Make a (dummy) Windows image.
203 windows.img: guest-aux/make-windows-img.sh \
204 guest-aux/windows-software guest-aux/windows-system
205 LIBGUESTFS_PATH=../appliance \
206 LD_LIBRARY_PATH=../src/.libs \
209 # Since users might not have the tools needed to create this, we
210 # also distribute these files.
211 guest-aux/windows-software: guest-aux/windows-software.reg
213 cp guest-aux/minimal-hive $@-t
214 hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SOFTWARE' $<
217 guest-aux/windows-system: guest-aux/windows-system.reg
219 cp guest-aux/minimal-hive $@-t
220 hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $<