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/make-ubuntu-img.sh \
46 guest-aux/make-windows-img.sh \
47 guest-aux/windows-software \
48 guest-aux/windows-software.reg \
49 guest-aux/windows-system \
50 guest-aux/windows-system.reg \
51 guest-aux/minimal-hive
53 noinst_DATA = test.iso
55 # This is 'check_DATA' because we don't need it until 'make check'
56 # time and we need the tools we have built in order to make it.
57 check_DATA = debian.img fedora.img ubuntu.img windows.img
61 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
65 $(srcdir)/helloworld.tar \
66 $(srcdir)/helloworld.tar.gz \
67 $(srcdir)/helloworld.tar.xz \
74 $(srcdir)/bin-i586-dynamic \
75 $(srcdir)/bin-sparc-dynamic \
76 $(srcdir)/bin-win32.exe \
77 $(srcdir)/bin-win64.exe \
78 $(srcdir)/bin-x86_64-dynamic \
79 $(srcdir)/lib-i586.so \
80 $(srcdir)/lib-sparc.so \
81 $(srcdir)/lib-win32.dll \
82 $(srcdir)/lib-win64.dll \
83 $(srcdir)/lib-x86_64.so \
84 $(srcdir)/test-grep.txt
86 images_files_build = \
87 $(builddir)/100kallzeroes \
88 $(builddir)/100kallnewlines \
89 $(builddir)/100kallspaces \
90 $(builddir)/100krandom \
91 $(builddir)/10klines \
92 $(builddir)/abssymlink \
93 $(builddir)/hello.b64 \
95 $(builddir)/initrd-x86_64.img \
96 $(builddir)/initrd-x86_64.img.gz \
97 $(builddir)/test-grep.txt.gz
99 images_files = $(images_files_src) $(images_files_build)
101 test.iso: $(images_files)
104 $(MKISOFS) -J -r -graft-points \
106 $(images_files) /directory=directory
110 $(builddir)/100kallzeroes:
112 dd if=/dev/zero of=$@-t bs=1024 count=100
115 $(builddir)/100kallnewlines: $(builddir)/100kallzeroes
117 tr '\0' '\n' < $< > $@-t
120 $(builddir)/100kallspaces: $(builddir)/100kallzeroes
122 tr '\0' ' ' < $< > $@-t
125 $(builddir)/100krandom:
127 dd if=/dev/urandom of=$@-t bs=1024 count=100
130 $(builddir)/10klines:
133 while [ $$i -lt 10000 ]; do \
134 echo "$${i}abcdefghijklmnopqrstuvwxyz"; \
139 $(builddir)/abssymlink:
142 $(builddir)/hello.b64:
143 echo "hello" | base64 > $@
145 $(builddir)/initrd: empty known-1 known-2 known-3 known-4 known-5
147 for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t
150 # Create a dummy initrd with a single file called 'bin/nash' which
151 # is used to test the Sys::Guestfs::Lib::file_architecture function.
152 $(builddir)/initrd-x86_64.img: bin-x86_64-dynamic
156 echo bin/nash | cpio -o -H newc > $@-t
160 $(builddir)/initrd-x86_64.img.gz: initrd-x86_64.img
162 gzip --best -c $< > $@-t
165 $(builddir)/test-grep.txt.gz: test-grep.txt
167 gzip --best -c $< > $@-t
170 # Make a (dummy) Fedora image.
171 fedora.img: guest-aux/make-fedora-img.sh guest-aux/fedora-name.db
172 LIBGUESTFS_PATH=../appliance \
173 LD_LIBRARY_PATH=../src/.libs \
174 TMPDIR=$(top_builddir) \
177 guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
180 # Make a (dummy) Debian image.
181 debian.img: guest-aux/make-debian-img.sh
182 LIBGUESTFS_PATH=$(top_builddir)/appliance \
183 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
184 TMPDIR=$(top_builddir) \
187 # Make a (dummy) Ubuntu image.
188 ubuntu.img: guest-aux/make-ubuntu-img.sh
189 LIBGUESTFS_PATH=$(top_builddir)/appliance \
190 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
191 TMPDIR=$(top_builddir) \
194 # Make a (dummy) Windows image.
195 windows.img: guest-aux/make-windows-img.sh \
196 guest-aux/windows-software guest-aux/windows-system
197 LIBGUESTFS_PATH=$(top_builddir)/appliance \
198 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
199 TMPDIR=$(top_builddir) \
202 # Since users might not have the tools needed to create this, we
203 # also distribute these files.
204 guest-aux/windows-software: guest-aux/windows-software.reg
206 cp guest-aux/minimal-hive $@-t
207 hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SOFTWARE' $<
210 guest-aux/windows-system: guest-aux/windows-system.reg
212 cp guest-aux/minimal-hive $@-t
213 hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $<