2 # Copyright (C) 2009 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 ACLOCAL_AMFLAGS = -I m4
20 SUBDIRS = src daemon examples
22 EXTRA_DIST = make-initramfs.sh
24 # Build the root filesystem.
25 # Currently this is arch-dependent, so it seems like putting it in
26 # $(libdir) is best. When we build cross-architecture filesystems we
27 # should probably move them to $(datadir).
29 fsdir = $(libdir)/guestfs
31 INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
32 VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
34 fs_DATA = $(INITRAMFSIMG) $(VMLINUZ)
36 $(VMLINUZ) $(INITRAMFSIMG): initramfs.timestamp
38 initramfs.timestamp: make-initramfs.sh.in daemon/guestfsd
40 $(builddir)/make-initramfs.sh
43 .PHONY: daemon/guestfsd
47 CLEANFILES = $(fs_DATA) initramfs.timestamp emptydisk
52 # Test-boot the image.
55 qemu-system-$(host_cpu) \
57 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
62 dd if=/dev/zero of=emptydisk bs=1024 count=1440
63 echo 0, | sfdisk -q -C 80 -H 2 -S 18 emptydisk > /dev/null
65 # This is a more realistic test boot command line which better
66 # reflects what the library does.
68 test-boot-realistic: emptydisk
69 qemu-system-$(host_cpu) \
71 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
73 -append "console=ttyS0 guestfs=10.0.2.4:6666" \
76 -net channel,6666:unix:/tmp/sock,server,nowait \