From 858d75d3911c9715bf62c3e8088cce3e991fb0fc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 16 Nov 2010 16:17:33 +0000 Subject: [PATCH] images: Make a phony Debian image for testing. --- .gitignore | 1 + images/Makefile.am | 12 ++++- images/guest-aux/debian-packages | 48 +++++++++++++++++++ images/guest-aux/make-debian-img.sh | 92 +++++++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 images/guest-aux/debian-packages create mode 100755 images/guest-aux/make-debian-img.sh diff --git a/.gitignore b/.gitignore index 9fe53f0..d8bcffa 100644 --- a/.gitignore +++ b/.gitignore @@ -124,6 +124,7 @@ images/100kallzeroes images/100krandom images/10klines images/abssymlink +images/debian.img images/fedora.img images/guest-aux/fedora-name.db images/hello.b64 diff --git a/images/Makefile.am b/images/Makefile.am index a2eb199..8fd3ba4 100644 --- a/images/Makefile.am +++ b/images/Makefile.am @@ -37,6 +37,8 @@ EXTRA_DIST = \ lib-win64.dll \ lib-x86_64.so \ test-grep.txt \ + guest-aux/make-debian-img.sh \ + guest-aux/debian-packages \ guest-aux/make-fedora-img.sh \ guest-aux/fedora-name.db.txt \ guest-aux/fedora-name.db @@ -45,12 +47,12 @@ 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 = fedora.img +check_DATA = debian.img fedora.img CLEANFILES = \ test.iso test.sqsh \ 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \ - initrd fedora.img + initrd $(check_DATA) images_files_src = \ $(srcdir)/helloworld.tar \ @@ -166,3 +168,9 @@ fedora.img: guest-aux/make-fedora-img.sh guest-aux/fedora-name.db guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt db_load $@ < $< + +# Make a (dummy) Debian image. +debian.img: guest-aux/make-debian-img.sh + LIBGUESTFS_PATH=../appliance \ + LD_LIBRARY_PATH=../src/.libs \ + bash $< diff --git a/images/guest-aux/debian-packages b/images/guest-aux/debian-packages new file mode 100644 index 0000000..38afc97 --- /dev/null +++ b/images/guest-aux/debian-packages @@ -0,0 +1,48 @@ +Package: test1 +Status: installed ok +Priority: optional +Section: libs +Installed-Size: 123 +Architecture: amd64 +Source: test +Version: 1.2.3-1 +Config-Version: 1.2.3-1 +Depends: libc6 (>= 2.3) +Description: this is a test package + This is a test package. + . + Don't confuse it with a real package. +Homepage: http://libguestfs.org/ + +Package: test2 +Status: installed ok +Priority: optional +Section: libs +Installed-Size: 123 +Architecture: amd64 +Source: test +Version: 1.2.3-1 +Config-Version: 1.2.3-1 +Depends: libc6 (>= 2.3) +Description: this is a test package + This is a test package. + . + Don't confuse it with a real package. +Homepage: http://libguestfs.org/ + +Package: test3 +Status: installed ok +Priority: optional +Section: libs +Installed-Size: 123 +Architecture: amd64 +Source: test +Version: 1.2.3-1 +Config-Version: 1.2.3-1 +Depends: libc6 (>= 2.3) +Description: this is a test package + This is a test package. + . + Don't confuse it with a real package. +Homepage: http://libguestfs.org/ + diff --git a/images/guest-aux/make-debian-img.sh b/images/guest-aux/make-debian-img.sh new file mode 100755 index 0000000..bb34672 --- /dev/null +++ b/images/guest-aux/make-debian-img.sh @@ -0,0 +1,92 @@ +#!/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 Debian image which is enough to fool the inspection heuristics. + +export LANG=C +set -e + +# fstab file. +cat > fstab.tmp <