From: Lei Xia Date: Tue, 12 Jan 2010 04:33:45 +0000 (-0600) Subject: Applied patch X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=f58f4acab7737c6f185d6a4e056280869af22c01 Applied patch --- diff --git a/manual/guest_build/Palacios_Guest_Build.tex b/manual/guest_build/Palacios_Guest_Build.tex index 7b75bfb..d772496 100644 --- a/manual/guest_build/Palacios_Guest_Build.tex +++ b/manual/guest_build/Palacios_Guest_Build.tex @@ -25,23 +25,19 @@ \section{Getting the guest image build tools} -In order to build the bootable guest iso image, we need to build a Linux kernel -image from source and an initial file system containing a set of useful binary -files which will be described in the following text. We will use a new directory -for demonstration; the root directory for the following examples is -``\verb+test/+": +In order to build the bootable guest ISO image, we need to build a Linux kernel + from source and an initial ramdisk file system containing a set of useful +tools. We will use a new directory for demonstration; the root directory for the +following examples is ``\verb+test/+": \begin{verbatim} [jdoe@newskysaw ~]$ mkdir test/ -[jdoe@newskysaw ~]$ cd test/ \end{verbatim} -\vspace{10pt} \noindent There are a set of tools and sources that are useful for the guest image -building procedure. You can checkout these resources from our git repositories; -to check them out to your local ``\verb+test/+" directory use the following -commands: +building procedure. You can obtain these resources from our git repositories. +Change to the ``\verb+test/+" directory and clone the resources: \begin{verbatim} [jdoe@newskysaw test]$ git clone http://hornet.cs.northwestern.edu:9005/busybox @@ -60,8 +56,8 @@ or root access to create the device files when you unpack the archive: \end{verbatim} \noindent -If you require a custom initial ramdisk filesystem, in the -``\verb|initrd/initramfs/|" directory, perform the following steps: +If you require a custom initial ramdisk filesystem, change to the +``\verb|initrd/initramfs/|" directory and perform the following steps: \begin{verbatim} [jdoe@newskysaw initramfs]$ mkdir -p proc sys var/log @@ -79,8 +75,8 @@ Edit the ``\verb|init_task|" script and uncomment these lines: \pagebreak \noindent -Create the \verb|console| device. If you have sudo or root access it is possible -to create this device manually: +Create the ``\verb|console|" device. If you have sudo or root access it is +possible to create this device manually: \begin{verbatim} [jdoe@newskysaw initramfs]$ sudo mknod dev/console c 5 1 @@ -89,8 +85,8 @@ to create this device manually: \noindent If you do not have sudo or root access it is still possible to create the -\verb|console| device indirectly through the kernel build. In the -``\verb|initrd/|" directory create a file called ``\verb|root_files|" and add +``\verb|console|" device indirectly through the kernel build. Change to the +``\verb|initrd/|" directory and create a file called ``\verb|root_files|". Add the following line: \begin{verbatim} @@ -98,11 +94,11 @@ nod /dev/console 0600 0 0 c 5 1 \end{verbatim} \noindent -The ``\verb|root_files|" file will be referenced in the section Configuring and -compiling the Linux kernel. Finally, create any additional directories and copy -any additional files that you need. Your initial ramdisk filesystem is prepped -and ready for installation of the BusyBox tools as described in the section -Configuring and installing BusyBox tools. +The ``\verb|root_files|" file is used when building the Linux kernel in the +section Configuring and building the Linux kernel. Finally, create any +additional directories and copy any additional files that you need. Your initial +ramdisk filesystem is prepped and ready for installation of the BusyBox tools as +described in the section Configuring and installing BusyBox tools. @@ -115,7 +111,7 @@ Configuring and installing BusyBox tools. \end{center} \end{figure} -\begin{figure}[h] +\begin{figure}[ht] \begin{center} \colfigsize\epsffile{busyboxConf2.eps} \end{center} @@ -139,7 +135,7 @@ BusyBox visit \url{http://busybox.net}. To configure BusyBox, in the or \begin{verbatim} -[jdoe@newskysaw busybox]$ make xconfig (X version) +[jdoe@newskysaw busybox]$ make xconfig \end{verbatim} \noindent @@ -172,74 +168,159 @@ Install the tools to the guest's initial ramdisk filesystem directory: \end{figure} -\section{Configuring and compiling the Linux kernel} +\section{Configuring and building the Linux kernel} -Change to the \verb|linux-2.6.30.y/| directory (or whatever your Linux kernel -source directory is named) and type the following: +The following procedure demonstrates how to configure and build a 32-bit Linux +kernel. Change to the ``\verb|linux-2.6.30.y/|" directory. There is a custom +configuration file ``\verb|jrl-default-config|" which is configured with minimal +kernel options (all unnecessary options are removed to keep the guest booting +process fast). If you are using the custom configuration file type the +following: \begin{verbatim} -make menuconfig +[jdoe@newskysaw linux-2.6.30.y]$ cp jrl-default-config .config \end{verbatim} -or + +\noindent +Configure the kernel to meet your requirements. For more on configuring and +building Linux kernels, check online. Type the following: + \begin{verbatim} -make xconfig (X version) +[jdoe@newskysaw linux-2.6.30.y]$ make ARCH=i386 menuconfig \end{verbatim} -\vspace{10pt} \noindent -Configure the kernel to meet your requirements. There is a custom configuration -file \verb|jrl-default-config| which is configured with minimal kernel options -(all unnecessary options are removed to keep the guest booting process fast). -For more on configuring and compiling Linux kernel images, check online. +or + +\begin{verbatim} +[jdoe@newskysaw linux-2.6.30.y]$ make ARCH=i386 xconfig +\end{verbatim} -\vspace{5pt} \noindent The kernel must be configured with the initial ramdisk file system directory -(e.g. \verb|initrd/initramfs|): in the ``\verb|General setup|" menu under +(e.g. ``\verb|initrd/initramfs/|"): in the ``\verb|General setup|" menu under option ``\verb|Initial RAM filesystem and RAM disk support|" set the -``\verb|Initramfs source file(s)|" option to the path of your \verb|initramfs| -directory as shown in figure \ref{fig:linuxcf}. When you are finished -configuring the kernel, save your configuration, and type the following: +``\verb|Initramfs source file(s)|" option to the path of the +``\verb|initrd/initramfs/|" directory, as shown in figure \ref{fig:linuxcf}. +Additionally, if you are using the ``\verb|root_files|" file to create devices +files, add the ``\verb|root_files|" file path, separated by a space, after the +initial ramdisk filesystem directory. When you are finished configuring the +kernel, save your configuration, and type the following: + \begin{verbatim} -make +[jdoe@newskysaw linux-2.6.30.y]$ make ARCH=i386 \end{verbatim} -Some blurb about where the kernel image is... +\noindent +The Linux kernel can be found here: ``\verb|arch/x86/boot/bzImage|". The initial +ramdisk filesystem can be found here: ``\verb|usr/initramfs_data.cpio|". The +Linux kernel and initial ramdisk filesystem are used to build the Linux ISO +image in the section Building the Linux ISO image. -\section{Configuring guest devices} -Checkout the updated Palacios repository to \verb|palacios/|. (You can find -instructions for checking out the Palacios and Kitten repositories at -\url{http://www.v3vee.org/palacios/}). To build the guest VM creator tool, -change to the \verb|palacios/utils/guest_creator| directory and type the -following: +\section{Building the Linux ISO image} + +The Linux ISO image is a bootable image containing the Linux kernel, initial +ramdisk filesystem, a boot loader, and a boot loader configuration file. For +this procedure, we'll use the ``\verb|test/iso/|" directory as the Linux ISO +build directory: + +\begin{verbatim} +[jdoe@newskysaw test]$ mkdir iso +\end{verbatim} + +\noindent +Change to the ``\verb|iso/|" directory and copy the required files: + +\begin{verbatim} +[jdoe@newskysaw iso]$ cp ../linux-2.6.30.y/arch/x86/boot/bzImage vmlinuz +[jdoe@newskysaw iso]$ cp ../linux-2.6.30.y/usr/initramfs_data.cpio initramfs +[jdoe@newskysaw iso]$ cp /usr/lib/syslinux/isolinux.bin . +\end{verbatim} + +\noindent +Create a file called ``\verb|isolinux.cfg|" and add the following lines: + +\begin{verbatim} +default linux +prompt 0 + +label linux + kernel vmlinuz + append initrd=initrd +\end{verbatim} + +\noindent +Change back to the ``\verb|test/|" directory and build the Linux ISO image: + +\begin{verbatim} +[jdoe@newskysaw test]$ mkisofs -o linux.iso -b isolinux.bin -no-emul-boot \ +-boot-load-size 4 -boot-info-table -iso-level 2 -input-charset UTF-8 iso/ +\end{verbatim} + +\noindent +The ``\verb|linux.iso|'' file is the Linux ISO image and is used to build the +guest image in the section Configuring and building the guest image: + +\begin{verbatim} +[jdoe@newskysaw test]$ file linux.iso +linux.iso: ISO 9660 CD-ROM filesystem data 'CDROM ' (bootable) +\end{verbatim} + + +\section{Configuring and building the guest image} + +Checkout the updated Palacios repository to the ``\verb|palacios/|" directory. +(You can find instructions for checking out the Palacios repository at +\url{http://www.v3vee.org/palacios/}). The guest creator utility is required for +building the guest image. Change to the ``\verb|palacios/utils/guest_creator|" +directory and build the guest creator utility: \begin{verbatim} -make +[jdoe@newskysaw guest_creator]$ make \end{verbatim} -\vspace{10pt} \noindent -You will get the \verb|build_vm| executable. The guest configuration file uses -XML. A sample configuration file is provided: \verb|default.xml|. +You will get the ``\verb|build_vm|" utility: +\begin{verbatim} +[jdoe@newskysaw guest_creator]$ file build_vm +build_vm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked +(uses shared libs), for GNU/Linux 2.6.9, not stripped +\end{verbatim} -\vspace{5pt} \noindent -***Various information about how to configure the VM.*** +The guest configuration file is written in XML. A sample configuration file is +provided: ``\verb|default.xml|". Make a copy of the default configuration file +named ``\verb|myconfig.xml|" and edit the configuration elements that you are +interested in (if a device is included in the guest configuration file, it +must be configured in the section Configuring and building Palacios or the guest +will not boot). Of particular importance is the ``\verb|files|" element. Comment +out this attribute: + +\begin{verbatim} + +\end{verbatim} -\vspace{5pt} \noindent -Once you have configured the VM, type the following to build the full guest VM -image: +Add an attribute that specifies the location of the Linux ISO image: + \begin{verbatim} -./build_vm myconfig.xml -o guest.iso + \end{verbatim} -where \verb+myconfig.xml+ is your guest configuration file, and \verb+guest.iso+ -is the output image file that will be used to configure kitten in the next -section. +\noindent +When you are finished editing the guest configuration save the configuration +file. The guest image consists of the guest configuration file and the Linux +ISO image. Build the guest image with the guest creator utility: + +\begin{verbatim} +[jdoe@newskysaw guest_creator]$ ./build_vm myconfig.xml -o guest.iso +\end{verbatim} +\noindent +The guest image, ``\verb+guest.iso+", is embedded in Kitten's +``\verb|init_task|" in the section Configuring and building Kitten. \pagebreak @@ -251,7 +332,7 @@ section. \label{fig:kittencf} \end{figure} -\begin{figure}[h] +\begin{figure}[ht] \begin{center} \colfigsize\epsffile{kittenConf2.eps} \end{center} @@ -265,78 +346,79 @@ section. You can find the detailed manual of getting and building Palacios and Kitten from scratch in the Palacios website (\url{http://www.v3vee.org/palacios}). Here -we only give the specific requirements related to the booting guest procedure. -To configure Palacios, in the Palacios root directory (i.e. \verb+palacios/+) -type the following: +we only give the specific requirements related to the procedure of booting the +guest. To configure Palacios, change to the ``\verb|test/palacios/|" directory +and type the following: \begin{verbatim} -make config +[jdoe@newskysaw palacios]$ make menuconfig \end{verbatim} + +\noindent or + \begin{verbatim} -make xconfig +[jdoe@newskysaw palacios]$ make xconfig \end{verbatim} -\vspace{10pt} \noindent -When you have configured the components you want to build into Palacios type -the following: +Don't forget to include the devices that your guest image requires. When you +have configured the components you want to build into Palacios, save the +configuration and close the window. To build Palacios type the following: \begin{verbatim} -make +[jdoe@newskysaw palacios]$ make \end{verbatim} or \begin{verbatim} -make all +[jdoe@newskysaw palacios]$ make all \end{verbatim} -\vspace{10pt} \noindent -Once the Palacios static library has been built you can find the library file -\verb+libv3vee.a+ in the Palacios root directory. +Once the Palacios static library has been built you can find the library file, +``\verb+libv3vee.a+", in the Palacios root directory. \subsection*{Configuring and building Kitten} -To build Kitten, first configure it in as you did Palacios. Change to the -\verb+kitten/+ directory and type the following: +Configure Kitten. Change to the ``\verb+test/kitten/+" directory and type the +following: \begin{verbatim} -make config +[jdoe@newskysaw kitten]$ make menuconfig \end{verbatim} + +\noindent or + \begin{verbatim} -make xconfig +[jdoe@newskysaw kitten]$ make xconfig \end{verbatim} -\vspace{10pt} \noindent Under the ``\verb|Virtualization|" menu select the ``\verb|Include Palacios virtual machine monitor|" option. Set the -``\verb|Path to pre-built Palacios tree|" option to the path of your Palacios -build, and set the ``\verb|Path to guest ISO image|" option to the path -containing the guest image that was built in the Configuring guest devices -section of this manual. - -\vspace{10pt} -\noindent -After configuring Kitten, to build Kitten, type the following: +``\verb|Path to pre-built Palacios tree|" option to the Palacios build tree +path, ``\verb|..\palacios|", as shown in figure \ref{fig:kittencf}. Set the +``\verb|Path to guest OS ISO image|" option to the guest image path,\\ +''\verb|../palacios/utils/guest_creator/guest.iso|'', as shown in figure +\ref{fig:kittencf2}. When you have finished configuring Kitten, save the +configuration and close the window. To build Kitten type the following: \begin{verbatim} -make isoimage +[jdoe@newskysaw kitten]$ make isoimage \end{verbatim} -\vspace{10pt} \noindent -This builds the bootable ISO image file with guest OS, Palacios and Kitten. -The ISO file is located in \verb+kitten/arch/x86_64/boot/image.iso+. +This builds the bootable ISO image file with guest image, Palacios, and Kitten. +The ISO file is located in ``\verb+kitten/arch/x86_64/boot/image.iso+". \pagebreak \noindent -You have successfully created a guest CD image file that can be booted on a -machine. You can boot the file on Qemu using the following sample command: +You have successfully created an ISO image file that can be booted on a machine. +You can boot the file on Qemu using the following sample command: \begin{verbatim} -/opt/vmm-tools/qemu/bin/qemu-system-x86_64 \ +[jdoe@newskysaw test]$ /opt/vmm-tools/qemu/bin/qemu-system-x86_64 \ -smp 1 \ -m 2047 \ -serial file:./serial.out \ @@ -344,7 +426,6 @@ machine. You can boot the file on Qemu using the following sample command: < /dev/null \end{verbatim} -\vspace{10pt} \noindent We have finished the entire procedure for building a guest image and booting it on the Palacios VMM. For more updated details, check the Palacios website