1 # Makefile for virt-p2v
3 # Copyright (C) 2007 Red Hat Inc.
4 # Written by Richard W.M. Jones <rjones@redhat.com>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #----------------------------------------------------------------------
23 # General configuration
28 # i386 images also work on x86-64, so best to stick with i386.
33 TIMEZONE := US/Eastern
35 BASEREPO := http://download.fedora.redhat.com/pub/fedora/linux/releases/8/Fedora/$(ARCH)/os/
37 # Select a suitable HTTP proxy.
38 # The default assumes a local squid proxy.
39 #export http_proxy := http://127.0.0.1:3128/
40 #export ftp_proxy := http://127.0.0.1:3128/
42 LABEL := $(PACKAGE)-$(VERSION)
44 #----------------------------------------------------------------------
47 @echo "make build Build the live CD ISO"
48 @echo "make boot [HDA=hda.img] [HDB=hdb.img] [ISO=livecd.iso]"
49 @echo " Boot built/named ISO (uses qemu)"
53 build: checkroot livecd.ks
55 livecd-creator --config=livecd.ks --fslabel=$(LABEL)
58 livecd.ks: livecd.ks.in livecd-post.sh Makefile
61 -e 's|@BASEREPO@|$(BASEREPO)|g' \
62 -e 's|@LANG@|$(LANG)|g' \
63 -e 's|@KEYBOARD@|$(KEYBOARD)|g' \
64 -e 's|@TIMEZONE@|$(TIMEZONE)|g' \
65 < $< | cat - livecd-post.sh > $@
67 livecd-post.sh: livecd-post.sh.in virt-p2v.sh inittab lvm.conf Makefile
70 -e '/@VIRT-P2V.SH@/ r virt-p2v.sh' \
71 -e '/@VIRT-P2V.SH@/ d' \
72 -e '/@INITTAB@/ r inittab' \
74 -e '/@LVM.CONF@/ r lvm.conf' \
78 # Run live CD under qemu.
85 QEMU_ARGS := -m 512 -cdrom $(ISO) -boot d
87 QEMU_ARGS += -hda $(HDA)
90 QEMU_ARGS += -hdb $(HDB)
99 @if [ `id -u` -ne 0 ]; then \
100 echo "You must be root to perform this operation."; \
105 rm -f *~ core livecd.ks livecd-post.sh
110 $(MAKE) check-manifest
111 rm -rf $(PACKAGE)-$(VERSION)
112 mkdir $(PACKAGE)-$(VERSION)
113 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
114 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
115 rm -rf $(PACKAGE)-$(VERSION)
116 ls -l $(PACKAGE)-$(VERSION).tar.gz
119 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
122 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
123 sed -e "s|^|$$b|" -e "s|^\./||"; \
124 done | sort > .check-manifest; \
125 sort MANIFEST > .orig-manifest; \
126 diff -u .orig-manifest .check-manifest; rv=$$?; \
127 rm -f .orig-manifest .check-manifest; \
130 .PHONY: build boot checkroot