*.iso
-livecd-test.ks
\ No newline at end of file
+livecd-test.ks
+livecd-post.sh
\ No newline at end of file
export http_proxy := http://127.0.0.1:3128/
export ftp_proxy := http://127.0.0.1:3128/
+LABEL := virt-p2v-$(VERSION)
+
#----------------------------------------------------------------------
all:
@echo "make build Build the live CD ISO"
- @echo "make boot [ISO=foo.iso] Boot the named ISO (uses qemu)"
+ @echo "make boot [ISO=foo.iso] Boot built/named ISO (uses qemu)"
build: livecd-test.ks
+ rm -f $(LABEL).iso
livecd-creator \
--config=$< \
- --fslabel=virt-p2v-$(VERSION)
+ --fslabel=$(LABEL)
ls -lhtr *.iso
-ISO = virt-p2v-$(VERSION).iso
+ISO = $(LABEL).iso
boot:
- qemu -m 512 $(ISO)
+ qemu -m 512 -cdrom $(ISO)
-livecd-test.ks: livecd-test.ks.in Makefile
+livecd-test.ks: livecd-test.ks.in livecd-post.sh Makefile
sed \
-e 's|@BASEREPO@|$(BASEREPO)|g' \
-e 's|@LANG@|$(LANG)|g' \
-e 's|@KEYBOARD@|$(KEYBOARD)|g' \
-e 's|@TIMEZONE@|$(TIMEZONE)|g' \
- < $< > $@
\ No newline at end of file
+ < $< | cat - livecd-post.sh > $@
+
+livecd-post.sh: livecd-post.sh.in p2v.init virt-p2v.sh Makefile
+ sed \
+ -e '/@P2V.INIT@/ r p2v.init' \
+ -e '/@P2V.INIT@/ d' \
+ -e '/@VIRT-P2V.SH@/ r virt-p2v.sh' \
+ -e '/@VIRT-P2V.SH@/ d' \
+ < $< > $@
--- /dev/null
+# This is the post-configuration section of the kickstart
+# installer. It runs inside the live CD chroot while it is
+# being created (after all the packages have been installed)
+# but before we make the ISO.
+
+# Create a 'p2v' init script which runs last thing during the
+# boot.
+
+cat > /etc/init.d/p2v << '__EOF__'
+@P2V.INIT@
+__EOF__
+
+# Make the 'p2v' script run when the live CD boots.
+chmod 0755 /etc/init.d/p2v
+/sbin/restorecon /etc/init.d/p2v
+/sbin/chkconfig --add p2v
+
+cat > /usr/bin/virt-p2v.sh << '__EOF__'
+@VIRT-P2V.SH@
+__EOF__
+
+chmod 0755 /usr/bin/virt-p2v.sh
+/sbin/restorecon /usr/bin/virt-p2v.sh
+
+# Turn off firstboot for livecd boots.
+echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
+
+# Don't start yum-updatesd for livecd boots.
+chkconfig --level 345 yum-updatesd off
+
+# Don't start cron/at as they tend to spawn things which are
+# disk intensive that are painful on a live image.
+chkconfig --level 345 crond off
+chkconfig --level 345 atd off
+chkconfig --level 345 anacron off
+chkconfig --level 345 readahead_early off
+chkconfig --level 345 readahead_later off
+
+# Stopgap fix for RH #217966; should be fixed in HAL instead
+touch /media/.hal-mtab
+# $Id$
+
lang @LANG@
keyboard @KEYBOARD@
timezone @TIMEZONE@
# dd, sleep, sync, etc.
coreutils
-# dmsetup
+
+# For device mapping
device-mapper
-# blockdev, mount, umount
util-linux
-# modprobe
module-init-tools
-# gzip
gzip
-# ssh
+
+# For remote communications
openssh-clients
-# nc
nc
+# For the shell script
+dialog
+grep
+sed
+gawk
+
+# Some other generally useful packages
+which
+perl
+rpm
+
-# EOF
+# The contents of livecd-post.sh are appended to the file after %post.
+%post
--- /dev/null
+#!/bin/bash
+#
+# p2v: Init script which starts the p2v process.
+#
+# chkconfig: 345 99 99
+# description: Init script which starts the p2v process.
+
+. /etc/init.d/functions
+
+# How were we called?
+case "$1" in
+start)
+ # Some modules which we definitely will need.
+ /sbin/modprobe dm_mod
+ /sbin/modprobe dm_snapshot
+
+ # Start the P2V script.
+ /usr/bin/virt-p2v.sh
+
+ ;;
+
+*) ;;
+esac
--- /dev/null
+#!/bin/bash
+#
+# virt-p2v.sh is a shell script which performs a physical to
+# virtual conversion of local disks, interactively.
+#
+# By Richard W.M. Jones <rjones@redhat.com>
+
+
+