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 fish examples images
33 make-initramfs.sh update-initramfs.sh \
34 guestfs.pod guestfs-actions.pod guestfs-structs.pod \
35 guestfish.pod guestfish-actions.pod \
39 # Build the root filesystem.
40 # Currently this is arch-dependent, so it seems like putting it in
41 # $(libdir) is best. When we build cross-architecture filesystems we
42 # should probably move them to $(datadir).
44 fsdir = $(libdir)/guestfs
46 INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
47 VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
49 fs_DATA = $(INITRAMFSIMG) $(VMLINUZ)
51 $(INITRAMFSIMG) $(VMLINUZ): initramfs/fakeroot.log
53 initramfs/fakeroot.log: make-initramfs.sh.in
54 -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
55 -mv $(VMLINUZ) $(VMLINUZ).bak
56 if ! bash $(builddir)/make-initramfs.sh; then rm -f $@; exit 1; fi
58 $(INITRAMFSIMG): initramfs/fakeroot.log daemon/guestfsd
60 bash $(builddir)/update-initramfs.sh
65 CLEANFILES = $(fs_DATA) emptydisk
71 # guestfs-actions.pod and guestfs-structs are autogenerated. There is
72 # no include mechanism for POD, so we have to do it by hand.
74 man_MANS = guestfs.3 guestfish.1
76 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
78 -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
79 -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
83 -c "Virtualization Support" \
85 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
88 guestfish.1: guestfish.pod guestfish-actions.pod
90 -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
94 -c "Virtualization Support" \
96 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
99 # Test-boot the image.
102 qemu-system-$(host_cpu) \
104 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
109 dd if=/dev/zero of=emptydisk bs=1024 count=1440
110 echo 0, | sfdisk -q -C 80 -H 2 -S 18 emptydisk > /dev/null
112 # This is a more realistic test boot command line which better
113 # reflects what the library does.
115 test-boot-realistic: emptydisk
116 qemu-system-$(host_cpu) \
118 -kernel $(VMLINUZ) -initrd $(INITRAMFSIMG) \
120 -append "console=ttyS0 guestfs=10.0.2.4:6666" \
123 -net channel,6666:unix:/tmp/sock,server,nowait \