Use of dialog to capture user input.
[virt-p2v.git] / README.developers
1 $Id$
2
3 Background reading
4 ----------------------------------------------------------------------
5
6 About Live CDs / livecd-creator tool:
7
8   http://fedoraproject.org/wiki/FedoraLiveCD/LiveCDHowTo
9
10 The files in this directory
11 ----------------------------------------------------------------------
12
13 livecd.ks.in
14
15   Kickstart file which describes how to build the live CD.  This is
16   essentially the configuration file for livecd-creator.  Most
17   importantly it lists the RPMs which are needed on the live CD.
18
19 livecd-post.sh.in
20
21   This is the %post-configuration section of the Kickstart script.  It
22   is a shell script which runs after the RPMs have been installed but
23   before the live CD is turned into an ISO.  The shell script creates
24   any extra files we need on the live CD.
25
26 p2v.init
27
28   This is installed on the live CD as /etc/init.d/p2v, and it causes the
29   live CD to boot into the P2V configuration tool (see next).
30
31 virt-p2v.sh
32
33   This is the virt-p2v.sh P2V configuration tool itself.  It is
34   installed on the live CD as /usr/bin/virt-p2v.sh and runs after the
35   live CD has booted.  All the P2V stuff happens from this script. It
36   uses the 'dialog' program to ask questions.
37
38 General implementation plan
39 ----------------------------------------------------------------------
40
41 User boots the live CD.  The job of the live CD is to:
42
43 (a) Find local disks.
44
45 (b) Copy the disk image(s) over to the Xen host.
46
47 (c) Change certain files (eg. /etc/fstab may contain references to
48 disk devices, which need to be changed when running under Xen).
49
50 (d) BUT, the live CD must be totally non-destructive.  It cannot
51 modify the local disks in any way.
52
53 (e) The above steps are not automatic.  We need to ask the user some
54 questions along the way.
55
56 For (a) there are various methods to detect local devices.  We sniff
57 for devices in /sys/block.
58
59 For (b) we can simply use 'dd' and 'ssh'.  The general plan is to do
60 this:
61
62   dd if=/dev/disk | gzip | ssh xenhost 'cat > /var/lib/xen/images/disk.img'
63
64 If the user doesn't have sshd installed on the Xen host, then they can
65 also opt for a pure TCP transport:
66
67   dd if=/dev/disk | gzip | nc xenhost port
68
69   and on the remote host they do:
70   nc -l -p port > /var/lib/xen/images/disk.img
71
72 For (c) we can use device-mapper snapshots to mount a ramdisk above
73 the disks themselves.  This allows us to make non-destructive changes
74 to files, and still see the "modified" block device (d).  A hairy
75 shell script looks for candidate files to modify.
76
77 Non-generic virt-p2v
78 ----------------------------------------------------------------------
79
80 The above describes the generic virt-p2v, which asks users questions
81 after boot.  It is also possible to build your own live CD, based on
82 virt-p2v which has various settings compiled in, so it runs
83 automatically.