3 #----------------------------------------------------------------------
4 # General configuration
8 # i386 images also work on x86-64, so best to stick with i386.
13 TIMEZONE := US/Eastern
15 BASEREPO := http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/$(ARCH)/os/
17 # Select a suitable HTTP proxy.
18 # The default assumes a local squid proxy.
19 export http_proxy := http://127.0.0.1:3128/
20 export ftp_proxy := http://127.0.0.1:3128/
22 LABEL := virt-p2v-$(VERSION)
24 #----------------------------------------------------------------------
27 @echo "make build Build the live CD ISO"
28 @echo "make boot [HDA=hda.img] [HDB=hdb.img] [ISO=livecd.iso]"
29 @echo " Boot built/named ISO (uses qemu)"
33 build: checkroot livecd.ks
35 livecd-creator --config=livecd.ks --fslabel=$(LABEL)
38 livecd.ks: livecd.ks.in livecd-post.sh Makefile
40 -e 's|@BASEREPO@|$(BASEREPO)|g' \
41 -e 's|@LANG@|$(LANG)|g' \
42 -e 's|@KEYBOARD@|$(KEYBOARD)|g' \
43 -e 's|@TIMEZONE@|$(TIMEZONE)|g' \
44 < $< | cat - livecd-post.sh > $@
46 livecd-post.sh: livecd-post.sh.in p2v.init virt-p2v.sh inittab Makefile
48 -e '/@P2V.INIT@/ r p2v.init' \
50 -e '/@VIRT-P2V.SH@/ r virt-p2v.sh' \
51 -e '/@VIRT-P2V.SH@/ d' \
52 -e '/@INITTAB@/ r inittab' \
56 # Run live CD under qemu.
63 QEMU_ARGS := -m 512 -cdrom $(ISO) -boot d
65 QEMU_ARGS += -hda $(HDA)
68 QEMU_ARGS += -hdb $(HDB)
77 @if [ `id -u` -ne 0 ]; then \
78 echo "You must be root to perform this operation."; \
83 rm -f *~ core livecd.ks livecd-post.sh
85 .PHONY: build boot checkroot