Howto build Xen 3.4.unstable from the sources ---------------------------------------------- The Xen book says (pp 137) that we need a newer mercurial (V 0.9.5 or newer). Newer than the standard V0.9.1 that is provided via Debian Etch Problem: from where do we get the newer mercurial? mkdir -p /usr/src/XEN_3.4.unstable cd /usr/src/XEN_3.4.unstable wget http://packages.debian.org/etch-backports/all/mercurial-common/download/mercurial-common_1.0.1-5.1~bpo40+1_all.deb wget http://www.backports.org/debian/pool/main/m/mercurial/mercurial_1.0.1-5.1~bpo40+1_amd64.deb dpkg -i ./mercurial-common_1.0.1-5.1~bpo40+1_all.deb dpkg -i ./mercurial_1.0.1-5.1~bpo40+1_amd64.deb ##################### # Download other build tools, see Xen book pp 138 top # Attention: the apt-get will also deinstall packages # Use aptitude instead to see the conflicts etc # The problem is the 'hotplug' # It conflicts with udev, kde and many others. # The xen Readme states that we need hotplug OR udev # --> we stay with udev and its dependent packages # apt-get install iproute bridge-utils hotplug python libz-dev python-dev gawk pciutils-dev # apt-get install graphviz texlive-latex-base texlive-latex-pdfetex transfig # apt-get install build-essential libssl-dev gettext python-dev libncurses5-dev xorg-dev bcc aptitude install iproute aptitude install bridge-utils # !!!! NOT aptitude install hotplug aptitude install python aptitude install libz-dev aptitude install python-dev aptitude install gawk aptitude install pciutils-dev aptitude install graphviz # this install texlive and de-installs our normal tetex! apt-get install tex-common texlive-base texlive-base-bin texlive-common \ texlive-doc-base texlive-doc-de texlive-lang-german \ texlive-latex-base texlive-pdfetex preview-latex-style \ texlive-latex-extra texlive-pictures texlive-fonts-recommended # aptitude install texlive-latex-pdfetex ??? apt-get install texlive-latex-recommended aptitude install texinfo aptitude install transfig aptitude install build-essential aptitude install libssl-dev aptitude install gettext aptitude install python-dev aptitude install libncurses5-dev aptitude install xorg-dev aptitude install bcc aptitude install git-core ############################################ # Get the Xen sources via cloning (unstable) ############################################ ### cleanup: usualy not needed # cd /usr/src # rm -rf xen-unstable.hg # rm -rf linux-2.6.18-xen.hg # Update/Get the Xen sources (unstable) # or unpack the saved repository from /usr/src/XEN_3.4.unstable/xen-unstable.hg.tar.gz # (see below) cd /usr/src ### check for updates if applicable (means already checked out) (cd xen-unstable.hg; hg status -A | grep -v '^C ') # (cd xen-unstable.hg; hg update ) # Fresh checkout # hg clone http://xenbits.xensource.com/xen-unstable.hg # # Save the result of cloning for further tries such that we can get away without new cloning # cd /usr/src tar czf /usr/src/XEN_3.4.unstable/xen-unstable.hg.tar.gz xen-unstable.hg # Update/Get the xen kernel tree # or unpack the saved repository from /usr/src/XEN_3.4.unstable/linux-2.6.18-xen.hg.tar.gz # (see below) cd /usr/src ### check for updates if applicable (means already checked out) (cd linux-2.6.18-xen.hg; hg status -A | grep -v '^C ') # (cd linux-2.6.18-xen.hg; hg update ) # Fresh checkout # hg clone http://xenbits.xensource.com/linux-2.6.18-xen.hg # # Save the result of cloning for further tries such that we can get away without new cloneing # cd /usr/src tar czf /usr/src/XEN_3.4.unstable/linux-2.6.18-xen.hg.tar.gz linux-2.6.18-xen.hg ################################################################################# # # NOTE: subsequent trials could unpack the tarballs # /usr/src/XEN_3.4.unstable/linux-2.6.18-xen.hg.tar.gz # into # /usr/src # instead of doing the 'hg clone' again # # cd /usr/src ### cleanup # rm -rf xen-unstable.hg # rm -rf linux-2.6.18-xen.hg ### unpack saved clones # tar xzf /usr/src/XEN_3.4.unstable/xen-unstable.hg.tar.gz # tar xzf /usr/src/XEN_3.4.unstable/linux-2.6.18-xen.hg.tar.gz ### check for update # (cd xen-unstable.hg; hg status -A | grep -v '^C ') # (cd xen-unstable.hg; hg update ) # (cd linux-2.6.18-xen.hg; hg status -A | grep -v '^C ') # (cd linux-2.6.18-xen.hg; hg update ) # ################################################ ################################################ # Now, let's compile that Xen # # First run: make world # Second run: change kernel config and rebuild/install delta cd /usr/src/xen-unstable.hg # from the Makefile # world: # $(MAKE) clean # $(MAKE) kdelete # $(MAKE) dist #make -j4 KERNELS=linux-2.6-xen world # Results in errors: TODO make KERNELS=linux-2.6-xen world 2>&1 | tee /usr/src/buildlog.xen-unstable.hg # Note: the option 'CONFIGMODE=menuconfig' is meant to be used with other targets (see below) # make linux-2.6-xen-config CONFIGMODE=menuconfig # # As far as I can see we need to run # make KERNELS=linux-2.6-xen world' # make install # once before for the proper setup # #------------------------- # # The unstable flavour does a lot of auto-downloading via git etc. # Therefore we produce a snapshot here after the first successful # build # cd /usr/src cp buildlog.xen-unstable.hg /usr/src/XEN_3.4.unstable/snapshot.`date "+%Y%m%d-%H%M"`.buildlog.xen-unstable.hg tar czf /usr/src/XEN_3.4.unstable/snapshot.`date "+%Y%m%d-%H%M"`.linux-2.6.18-xen.hg.tar.gz linux-2.6.18-xen.hg tar czf /usr/src/XEN_3.4.unstable/snapshot.`date "+%Y%m%d-%H%M"`.xen-unstable.hg.tar.gz xen-unstable.hg #------------------------- make install #------------------------- # # Check /boot # ls -latr /boot # # Do we still get the same kernel images # Important for /boot/grub/menu.lst # -rw-r--r-- 1 root root 7741850 2008-10-27 15:10 xen-syms-3.4-unstable lrwxrwxrwx 1 root root 19 2008-10-27 15:10 xen.gz -> xen-3.4-unstable.gz lrwxrwxrwx 1 root root 19 2008-10-27 15:10 xen-3.gz -> xen-3.4-unstable.gz -rw-r--r-- 1 root root 468307 2008-10-27 15:10 xen-3.4-unstable.gz lrwxrwxrwx 1 root root 19 2008-10-27 15:10 xen-3.4.gz -> xen-3.4-unstable.gz drwxr-xr-x 4 root root 3072 2008-10-27 15:10 . -rw-r--r-- 1 root root 1495008 2008-10-27 15:13 vmlinuz-2.6.18.8-xen -rw-r--r-- 1 root root 960241 2008-10-27 15:13 System.map-2.6.18.8-xen -rw-r--r-- 1 root root 62439 2008-10-27 15:13 config-2.6.18.8-xen unchanged names: vmlinuz-2.6.18.8-xen System.map-2.6.18.8-xen config-2.6.18.8-xen new names: xen-3.4-unstable.gz -> we need to update our menu-lst file We always use the most discriminating name (here xen-3.4-unstable.gz) in the menu.lst #------------------------- # # Second run: refine configuration # cd /usr/src/xen-unstable.hg # backup config cp build-linux-2.6.18-xen_x86_64/.config build-linux-2.6.18-xen_x86_64/config.base make linux-2.6-xen-config CONFIGMODE=menuconfig change XEN->"PCI-device backend driver" from "M" to "*". cp build-linux-2.6.18-xen_x86_64/.config build-linux-2.6.18-xen_x86_64/config.fix_pcibackend make linux-2.6-xen-build make linux-2.6-xen-install depmod 2.6.18.8-xen #------------------------- # Only once # prepare the initrd config ## cp /etc/initramfs-tools/modules /etc/initramfs-tools/modules.orig cat > /etc/initramfs-tools/modules <