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
47 noinst_DATA = test.iso
49 # This is 'check_DATA' because we don't need it until 'make check'
50 # time and we need the tools we have built in order to make it.
51 check_DATA = debian.img fedora.img ubuntu.img
55 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \
59 $(srcdir)/helloworld.tar \
60 $(srcdir)/helloworld.tar.gz \
61 $(srcdir)/helloworld.tar.xz \
68 $(srcdir)/bin-i586-dynamic \
69 $(srcdir)/bin-sparc-dynamic \
70 $(srcdir)/bin-win32.exe \
71 $(srcdir)/bin-win64.exe \
72 $(srcdir)/bin-x86_64-dynamic \
73 $(srcdir)/lib-i586.so \
74 $(srcdir)/lib-sparc.so \
75 $(srcdir)/lib-win32.dll \
76 $(srcdir)/lib-win64.dll \
77 $(srcdir)/lib-x86_64.so \
78 $(srcdir)/test-grep.txt
80 images_files_build = \
81 $(builddir)/100kallzeroes \
82 $(builddir)/100kallnewlines \
83 $(builddir)/100kallspaces \
84 $(builddir)/100krandom \
85 $(builddir)/10klines \
86 $(builddir)/abssymlink \
87 $(builddir)/hello.b64 \
89 $(builddir)/initrd-x86_64.img \
90 $(builddir)/initrd-x86_64.img.gz \
91 $(builddir)/test-grep.txt.gz
93 images_files = $(images_files_src) $(images_files_build)
95 test.iso: $(images_files)
98 $(MKISOFS) -J -r -graft-points \
100 $(images_files) /directory=directory
104 $(builddir)/100kallzeroes:
106 dd if=/dev/zero of=$@-t bs=1024 count=100
109 $(builddir)/100kallnewlines: $(builddir)/100kallzeroes
111 tr '\0' '\n' < $< > $@-t
114 $(builddir)/100kallspaces: $(builddir)/100kallzeroes
116 tr '\0' ' ' < $< > $@-t
119 $(builddir)/100krandom:
121 dd if=/dev/urandom of=$@-t bs=1024 count=100
124 $(builddir)/10klines:
127 while [ $$i -lt 10000 ]; do \
128 echo "$${i}abcdefghijklmnopqrstuvwxyz"; \
133 $(builddir)/abssymlink:
136 $(builddir)/hello.b64:
137 echo "hello" | base64 > $@
139 $(builddir)/initrd: empty known-1 known-2 known-3 known-4 known-5
141 for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t
144 # Create a dummy initrd with a single file called 'bin/nash' which
145 # is used to test the Sys::Guestfs::Lib::file_architecture function.
146 $(builddir)/initrd-x86_64.img: bin-x86_64-dynamic
150 echo bin/nash | cpio -o -H newc > $@-t
154 $(builddir)/initrd-x86_64.img.gz: initrd-x86_64.img
156 gzip --best -c $< > $@-t
159 $(builddir)/test-grep.txt.gz: test-grep.txt
161 gzip --best -c $< > $@-t
164 # Make a (dummy) Fedora image.
165 fedora.img: guest-aux/make-fedora-img.sh guest-aux/fedora-name.db
166 LIBGUESTFS_PATH=../appliance \
167 LD_LIBRARY_PATH=../src/.libs \
170 guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
173 # Make a (dummy) Debian image.
174 debian.img: guest-aux/make-debian-img.sh
175 LIBGUESTFS_PATH=../appliance \
176 LD_LIBRARY_PATH=../src/.libs \
179 # Make a (dummy) Ubuntu image.
180 ubuntu.img: guest-aux/make-ubuntu-img.sh
181 LIBGUESTFS_PATH=../appliance \
182 LD_LIBRARY_PATH=../src/.libs \