Merge branch 'asoc-5.3' into asoc-linus
[sfrench/cifs-2.6.git] / Documentation / ia64 / xen.rst
1 ********************************************************
2 Recipe for getting/building/running Xen/ia64 with pv_ops
3 ********************************************************
4 This recipe describes how to get xen-ia64 source and build it,
5 and run domU with pv_ops.
6
7 Requirements
8 ============
9
10   - python
11   - mercurial
12     it (aka "hg") is an open-source source code
13     management software. See the below.
14     http://www.selenic.com/mercurial/wiki/
15   - git
16   - bridge-utils
17
18 Getting and Building Xen and Dom0
19 =================================
20
21   My environment is:
22
23     - Machine  : Tiger4
24     - Domain0 OS  : RHEL5
25     - DomainU OS  : RHEL5
26
27  1. Download source::
28
29         # hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
30         # cd xen-unstable.hg
31         # hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
32
33  2. # make world
34
35  3. # make install-tools
36
37  4. copy kernels and xen::
38
39         # cp xen/xen.gz /boot/efi/efi/redhat/
40         # cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
41         /boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
42
43  5. make initrd for Dom0/DomU::
44
45         # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
46           O=$(pwd)/build-linux-2.6.18-xen_ia64
47         # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
48           2.6.18.8-xen --builtin mptspi --builtin mptbase \
49           --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
50           --builtin ehci-hcd
51
52 Making a disk image for guest OS
53 ================================
54
55  1. make file::
56
57       # dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
58       # mke2fs -F -j /root/rhel5.img
59       # mount -o loop /root/rhel5.img /mnt
60       # cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
61       # mkdir /mnt/{root,proc,sys,home,tmp}
62
63       Note: You may miss some device files. If so, please create them
64       with mknod. Or you can use tar instead of cp.
65
66  2. modify DomU's fstab::
67
68       # vi /mnt/etc/fstab
69          /dev/xvda1  /            ext3    defaults        1 1
70          none        /dev/pts     devpts  gid=5,mode=620  0 0
71          none        /dev/shm     tmpfs   defaults        0 0
72          none        /proc        proc    defaults        0 0
73          none        /sys         sysfs   defaults        0 0
74
75  3. modify inittab
76
77     set runlevel to 3 to avoid X trying to start::
78
79       # vi /mnt/etc/inittab
80          id:3:initdefault:
81
82     Start a getty on the hvc0 console::
83
84        X0:2345:respawn:/sbin/mingetty hvc0
85
86     tty1-6 mingetty can be commented out
87
88  4. add hvc0 into /etc/securetty::
89
90       # vi /mnt/etc/securetty (add hvc0)
91
92  5. umount::
93
94       # umount /mnt
95
96 FYI, virt-manager can also make a disk image for guest OS.
97 It's GUI tools and easy to make it.
98
99 Boot Xen & Domain0
100 ==================
101
102  1. replace elilo
103     elilo of RHEL5 can boot Xen and Dom0.
104     If you use old elilo (e.g RHEL4), please download from the below
105     http://elilo.sourceforge.net/cgi-bin/blosxom
106     and copy into /boot/efi/efi/redhat/::
107
108       # cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
109
110  2. modify elilo.conf (like the below)::
111
112       # vi /boot/efi/efi/redhat/elilo.conf
113       prompt
114       timeout=20
115       default=xen
116       relocatable
117
118       image=vmlinuz-2.6.18.8-xen
119              label=xen
120              vmm=xen.gz
121              initrd=initrd-2.6.18.8-xen.img
122              read-only
123              append=" -- rhgb root=/dev/sda2"
124
125 The append options before "--" are for xen hypervisor,
126 the options after "--" are for dom0.
127
128 FYI, your machine may need console options like
129 "com1=19200,8n1 console=vga,com1". For example,
130 append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
131 console=ttyS0 root=/dev/sda2"
132
133 Getting and Building domU with pv_ops
134 =====================================
135
136  1. get pv_ops tree::
137
138       # git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
139
140  2. git branch (if necessary)::
141
142       # cd linux-2.6-xen-ia64/
143       # git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
144
145    Note:
146      The current branch is xen-ia64-domu-minimal-2008may19.
147      But you would find the new branch. You can see with
148      "git branch -r" to get the branch lists.
149
150        http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
151
152      is also available.
153
154      The tree is based on
155
156       git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
157
158  3. copy .config for pv_ops of domU::
159
160       # cp arch/ia64/configs/xen_domu_wip_defconfig .config
161
162  4. make kernel with pv_ops::
163
164       # make oldconfig
165       # make
166
167  5. install the kernel and initrd::
168
169       # cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
170       # make modules_install
171       # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
172         2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
173         --builtin mptbase --builtin mptscsih --builtin uhci-hcd \
174         --builtin ohci-hcd --builtin ehci-hcd
175
176 Boot DomainU with pv_ops
177 ========================
178
179  1. make config of DomU::
180
181      # vi /etc/xen/rhel5
182        kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
183        ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
184        vcpus = 1
185        memory = 512
186        name = "rhel5"
187        disk = [ 'file:/root/rhel5.img,xvda1,w' ]
188        root = "/dev/xvda1 ro"
189        extra= "rhgb console=hvc0"
190
191  2. After boot xen and dom0, start xend::
192
193         # /etc/init.d/xend start
194
195    ( In the debugging case, `# XEND_DEBUG=1 xend trace_start` )
196
197  3. start domU::
198
199         # xm create -c rhel5
200
201 Reference
202 =========
203 - Wiki of Xen/IA64 upstream merge
204   http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
205
206 Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008