$ cd .. (因为刚才我们还在xen的目录中,先退出来)
$ tar vxjf linux-2.6.31.8.tar.bz2
$ mkdir xenpatch-2.6.31.8
$ cd xenpatch-2.6.31.8
$ tar vxjf ../xen-patch-2.6.31-10.tar.bz2
$ cd ../linux-2.6.31.8
$ for i in `ls ../xenpatch-2.6.31.8`; \
do patch -p1 < ../xenpatch-2.6.31.8/"$i"; done
下面我们来配置内核,这部非常关键,小心操作。首先,我们直接把Ubuntu正在使用的内核配置信息弄过来,这样我们只需要对Xen的部分进行简单的配置即可完成配置工作。
$ cp /boot/config-2.6.32-21-server .config
然后进入配置界面,加入xen的配置:
$ make menuconfig
Processor type and features --->
[*] Enable Xen compatible kernel
Networking support --->
Networking options --->
<*> 802.1d Ethernet Bridging
Device Drivers --->
XEN --->
[*] Privileged Guest (domain 0)
<*> Backend driver support
<*> Block-device backend driver
<*> Block-device tap backend driver
<*> Block-device tap backend driver 2
<*> Network-device backend driver
<*> PCI-device backend driver
<*> SCSI backend driver
<*> USB backend driver
<*> Block-device frontend driver
<*> Network-device frontend driver
<*> SCSI frontend driver
<*> USB frontend driver
<*> Framebuffer-device frontend driver
<*> Keyboard-device frontend driver
[*] Disable serial port drivers
<*> Export Xen attributes in sysfs
Xen version compatibility (3.3.0 and later) --->
3.3.0 and later
配置好后,退出,保存,然后开始编译内核,注意,这是一个漫长的过程:
$ make
$ sudo make install
$ sudo make modules_install
$ sudo update-initramfs -c -k 2.6.31.8
$ sudo depmod 2.6.31.8
至此,内核也已经准备就绪,下面就是要让grub明白应该如何启动Xen以及Dom0