# How To build a XEN Domain-0 linuxkernel with SKAS & sysemu # to run UML and XEN on the same host. # # Nils Toedtmann # # 2005-02-28 # Disclaimer: i have NO clue what the hell i am doing here. # I do not know C nor assembler nor any linux kernel internals. # I just stired up some patches until the result compiled ... # At least some binaries (eg. /bin/ls under FC3) will segfault # within UMLs guests running on such a hostkernel. So if it # eats your data - don't blame me ... # get sources mkdir archive cd archive/ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-2.0.4-src.tgz wget http://www.user-mode-linux.org/~blaisorblade/patches/skas3-2.6/host-skas3-2.6.10-v7.patch cd .. # make self-contained Xen kernel patch tar xzf archive/xen-2.0.4-src.tgz tar xjf archive/linux-2.6.10.tar.bz2 cp -al linux-2.6.10 linux-2.6.10-xen-2.0.4 cd xen-2.0/linux-2.6.10-xen-sparse/ ./mkbuildtree ../../linux-2.6.10-xen-2.0.4/ # produces a lot of symlinks to the xen-tree :-( cd ../.. echo "-xen-2.0.4" > linux-2.6.10-xen-2.0.4/localversion-xen diff -Naur linux-2.6.10 linux-2.6.10-xen-2.0.4 > archive/linux-2.6.10-xen-2.0.4.patch rm -fR linux-2.6.10-xen-2.0.4 xen-2.0 # split up SKAS patch using "patchutils" mkdir archive/host-skas3-2.6.10-v7 cd archive/host-skas3-2.6.10-v7 splitdiff -dap1 ../host-skas3-2.6.10-v7.patch cd ../.. # make a new kernel-tree combining all patches cp -al linux-2.6.10 linux-2.6.10-skas3-v7-xen-2.0.4 cd linux-2.6.10-skas3-v7-xen-2.0.4/ patch -p1 < ../archive/linux-2.6.10-xen-2.0.4.patch patch -p1 < ../archive/host-skas3-2.6.10-v7.patch patch arch/xen/i386/Kconfig < ../archive/host-skas3-2.6.10-v7/arch_i386_Kconfig patch arch/xen/i386/kernel/entry.S < ../archive/host-skas3-2.6.10-v7/arch_i386_kernel_entry.S patch arch/xen/i386/kernel/ldt.c < ../archive/host-skas3-2.6.10-v7/arch_i386_kernel_ldt.c patch include/asm-xen/asm-i386/desc.h < ../archive/host-skas3-2.6.10-v7/include_asm-i386_desc.h patch include/asm-xen/asm-i386/mmu_context.h < ../archive/host-skas3-2.6.10-v7/include_asm-i386_mmu_context.h patch include/asm-xen/asm-i386/ptrace.h < ../archive/host-skas3-2.6.10-v7/include_asm-i386_ptrace.h cd .. # make a combined patch for later use diff -Naur linux-2.6.10 linux-2.6.10-skas3-v7-xen-2.0.4 | bzip2 -c > archive/linux-2.6.10-skas3-v7-xen-2.0.4.patch.bz2 # this combo tree actually compiles (!): mkdir install cd linux-2.6.10-skas3-v7-xen-2.0.4/ cp arch/xen/configs/xen0_defconfig .config ARCH=xen ; INSTALL_PATH=../install ; INSTALL_MOD_PATH=../install export ARCH INSTALL_PATH INSTALL_MOD_PATH make oldconfig /proc/mm support (PROC_MM) [Y/n] (NEW) y make modules make modules_install make install # done. Copy the stuff from ${INSTALL_PATH} to the right places and boot it.