From: Richard Jones Date: Wed, 1 Apr 2009 11:57:45 +0000 (+0100) Subject: Various fixes to the build system, add 'make test-boot-image' target. X-Git-Tag: 0.4~53 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=6ed48042e4a8b009b5e38efbf4766a2676a33935 Various fixes to the build system, add 'make test-boot-image' target. --- diff --git a/Makefile.am b/Makefile.am index cbc4c59..154347f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = src daemon examples EXTRA_DIST = make-initramfs.sh @@ -26,16 +28,35 @@ EXTRA_DIST = make-initramfs.sh fsdir = $(libdir)/guestfs -fs_DATA = initramfs.$(REPO).$(host_cpu).img vmlinuz.$(REPO).$(host_cpu) +INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img +VMLINUZ = vmlinuz.$(REPO).$(host_cpu) + +fs_DATA = $(INITRAMFSIMG) $(VMLINUZ) -$(fs_DATA): make-initramfs.sh.in daemon/guestfsd +$(VMLINUZ) $(INITRAMFSIMG): initramfs.timestamp + +initramfs.timestamp: make-initramfs.sh.in daemon/guestfsd + rm -f $@ $(builddir)/make-initramfs.sh + touch $@ .PHONY: daemon/guestfsd # Make clean. -CLEANFILES = $(fs_DATA) +CLEANFILES = $(fs_DATA) initramfs.timestamp clean-local: rm -rf initramfs + +# Test-boot the image. + +test-boot-image: + rm -f emptydisk + dd if=/dev/zero of=emptydisk bs=1024 count=1440 + echo 0, | sfdisk -C 80 -H 2 -S 18 emptydisk + qemu-system-$(host_cpu) \ + -m 384 \ + -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \ + -hda emptydisk -boot c + rm -f emptydisk diff --git a/README b/README index a017249..369295c 100644 --- a/README +++ b/README @@ -63,6 +63,7 @@ these commands as root: make install + Notes on cross-architecture support ---------------------------------------------------------------------- @@ -72,12 +73,27 @@ operations and NFS export will work fine, but running commands in guests may not be possible. To enable this requires work for cross-architecture and 32-on-64 -support in febootstrap. +support in febootstrap, fakeroot and fakechroot. The daemon/ directory contains its own configure script. This is so that in future we will be able to cross-compile the daemon. +Mirroring tip +---------------------------------------------------------------------- + +Having a local Fedora mirror makes a massive difference to the time it +takes to build and rebuild initramfs images. + +Failing that, use squid to cache yum downloads, but read this first: +https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html +(In brief, because yum chooses random mirrors each time, squid doesn't +work very well with default yum configuration. To get around this, +choose a Fedora mirror which is close to you, set this with +'./configure --with-mirror=[...]', and then proxy the whole lot +through squid by setting http_proxy environment variable). + + Copyright and license information ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 297ae99..4e71dde 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,9 @@ AC_INIT([libguestfs],[0.2]) AM_INIT_AUTOMAKE + +AC_CONFIG_MACRO_DIR([m4]) + AC_PROG_LIBTOOL dnl Check for basic C environment. diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 686f4b6..a5c1637 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -14,3 +14,5 @@ # 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. + +ACLOCAL_AMFLAGS = -I m4 \ No newline at end of file diff --git a/daemon/configure.ac b/daemon/configure.ac index 59ed51e..af0a78a 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -18,6 +18,8 @@ AC_INIT([libguestfs-daemon],[0.2]) AM_INIT_AUTOMAKE +AC_CONFIG_MACRO_DIR([m4]) + dnl If the user specified --enable-32bit, then force the C compiler dnl to build 32 bit binaries (gcc -m32). AC_ARG_ENABLE([32bit],