=====
Build
=====

To build kexec support for IA64 Xen, four separate trees need to
be downloaded, patched, and built.

  * Xen: hypervisor
  * Linux-Xen: domain~0
  * kexec-tools: user-space component of kexec
  * Linux: For kexec this is needed only if you wish to kexec from Xen to Linux
	   For kdump this is required, as kdump's crash kernel needs to be Linux

Build: Xen
==========

REQUIRED

These patches are currently based on the ext/ia64/xen-unstable.hg tree,
version 15883:4c020dd76b18.

  1. Obtain ext/ia64/xen-unstable.hg, version 15883:4c020dd76b18.

     hg clone -r 15883 http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
     cd xen-unstable.hg

  2. Apply patches

     This can be done in many ways, here is one.

     a. initialise hg patch queue

        hg qinit

     b. copy in patches and series file

        cp -p ROOT_OF_DOWNLOADED_PATCHES/xen/*.patch .hg/patches/

     c. apply patches

        hg qpush -a

  3. Build

     For a guide on how to do this see ./README in the root
     of the xen tree.



Build: Linux-Xen
================

REQUIRED

These patches are currently based on the ext/ia64/linux-2.6.18-xen.hg tree,
revision 209:d650f254d544.

  1. Obtain ext/ia64/linux-2.6.18-xen.hg, version 209:d650f254d544.

     hg clone -r 209 http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
     cd xen-ia64-unstable.hg

  2. Apply patches

     This can be done in many ways, here is one.

     a. initialise hg patch queue

        hg qinit

     b. copy in patches and series file

        cp -p ROOT_OF_DOWNLOADED_PATCHES/linux-xen/*.patch .hg/patches/

     c. apply patches

        hg qpush -a

  3. Trim config (optional)

     I highly suggest trimming the kernel config down to what you need to
     get your hardware running. This should greatly reduce both
     built time and the size of the resulting image+modules.

     The important thing for kexec is to have CONFIG_KEXEC set.
     For kdump you will need CONFIG_KEXEC and CONFIG_CRASH_DUMP set.
     As Xen can't opperate as a crash-kernel, you do not need
     CONFIG_PROC_VMCORE.

  4. Build

     For a guide on how to do this see ./README in the root
     of the xen tree.


Build: kexec-tools
==================

REQUIRED

These patchs are based on kexec-tools-testing, version 20070330

   1. Obtain kexec-tools-testing, version 20070330

      There are several ways to do this, here are two:

      a. Download

         wget http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20070330.tar.bz2
	 tar -jxf kexec-tools-testing-20070330.tar.bz2
	 cd kexec-tools-testing-20070330

         Also available from Kernel.Org mirrors, and
	 http://www.vergenet.net/inux/kexec/kexec-tools/

     or

     b. Check out from git

        git clone git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
	cd kexec-tools-testing
	git branch v20070330 v20070330
	git checkout v20070330

   2. Apply patches

      This can be done in many ways, here is one.

      a. Copy patches

	 mkdir patches && \
	 cp -p ROOT_OF_DOWNLOADED_PATCHES/kexec-tools/* patches/

      b. Use quilt to apply these patches

         quilt push -a

   4. Build

      The INSTALL file in the root of the kexec-tools directory has
      instructions on how to do this. But briefly:

      autoconf
      ./configure
      make


Build: Linux Kernel
===================

OPTIONAL:

  For kexec this is needed only if you wish to kexec from xen to Linux
  For kdump this is required, as (at this time?) kdump's crash kernel
  needs to be Linux

These patchs are based on Linux, version v2.6.23-rc3

   1. Obtain Linux, version 2.6.23-rc3

      There are several ways to do this, here are two:

      a. Download

         wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.23-rc3.tar.bz2
	 tar -jxf linux-2.6.23-rc3.tar.bz2
	 cd linux-2.6.23-rc3

         Also available from Kernel.Org mirrors

     or

     b. Check out from git

        git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
	cd kexec-tools-testing
	git branch v2.6.23-rc3 v2.6.23-rc3
	git checkout v2.6.23-rc3

   2. Apply patches

      This can be done in many ways, here is one.

      a. Copy patches

	 mkdir patches && cp -p ROOT_OF_DOWNLOADED_PATCHES/linux/* patches/

      b. Use quilt to apply these patches

         quilt push -a

   4. Build

      The README file in the root of the Linux kernel directory has
      instructions on how to do this.

