I have downloaded xvm-src.tar.bz2 and built my own xen.gz image of the hypervisor. I have done the build by executing "make world". While xen.gz was built successfully, I got an error when building install-tools. The compiler complained that function vasprintf (on line 35 of utils.c) was not defined. I don''t think vasprintf is even used in Solaris, probably just on Linux. So the error is probably due to the fact that xen is meant to be built on Linux. Are there any configuration options that could fix the error? Currently I am using the following command to build the tree: gmake XEN_COMPILE_ARCH=x86_64 verbose=y debug=y debugger=y perfc=y world Thanks! This message posted from opensolaris.org
Hi Sasha, Were you building Xen on Solaris, or Linux? Have you pushed all patches before building? Max Alexandra (Sasha) Fedorova wrote:> I have downloaded xvm-src.tar.bz2 and built my own xen.gz image of the hypervisor. I have done the build by executing "make world". While xen.gz was built successfully, I got an error when building install-tools. The compiler complained that function vasprintf (on line 35 of utils.c) was not defined. I don''t think vasprintf is even used in Solaris, probably just on Linux. So the error is probably due to the fact that xen is meant to be built on Linux. Are there any configuration options that could fix the error? Currently I am using the following command to build the tree: > > gmake XEN_COMPILE_ARCH=x86_64 verbose=y debug=y debugger=y perfc=y world > > Thanks! > > > This message posted from opensolaris.org > _______________________________________________ > xen-discuss mailing list > xen-discuss@opensolaris.org >
> I have downloaded xvm-src.tar.bz2 and built my own > xen.gz image of the hypervisor. I have done the build > by executing "make world". While xen.gz was built > successfully, I got an error when building > install-tools. The compiler complained that function > vasprintf (on line 35 of utils.c) was not defined. I > don''t think vasprintf is even used in Solaris, > probably just on Linux. So the error is probably due > to the fact that xen is meant to be built on Linux.Yep, after you unpack xvm-src.tar.bz2, the xen.hg directory contains the unmodified xen source from xensource.com; and there is a series of patches for opensolaris in xen.hg/.hg/patches that must be applied, by using the command "hg qpush -a". Like this: - Your $HOME/.hgrc must contain at least the following settings: [extensions] hgext.mq - export EMAIL=your.name@foo.bar.com - in xen.hg run: hg qpush -a> Are there any configuration options that could fix > the error? Currently I am using the following command > to build the tree: > > gmake XEN_COMPILE_ARCH=x86_64 verbose=y debug=y debugger=y perfc=y worldFor a full build of the sources, producing installable packages, you would use .../sunos.hg/bin/build-all ; see also the sunos.hg/README file. For building just the hypervisor in xen.hg, I''m using this small script: #!/bin/sh SOLARIS_BUILD_TOOLS=/opt export SOLARIS_BUILD_TOOLS echo XEN_VENDORVERSION = -xvm > .config echo export XEN_VENDORVERSION >> .config #gmake debug=y XEN_COMPILE_ARCH=x86_64 XEN_TARGET_X86_PAE=y DISTDIR=/tmp "$@" gmake debug=y XEN_COMPILE_ARCH=x86_32 XEN_TARGET_X86_PAE=y DISTDIR=/tmp "$@" This message posted from opensolaris.org
Alexandra (Sasha) Fedorova wrote:> Hi Max, > > I am building Xen on Solaris, on an x86 machine. I have downladed the > xvm-src.tar.bz2 from the on gate here > http://dlc.sun.com/osol/on/downloads/b79/, so I assumed I did not need > any patches. If that''s not the case, where can I get the patches?I think you have all the patches. What you need to do is to apply them before building: Go to xen.hg and type ''hg qpush -a''. Thanks, Max> > Thanks! > > -- Sasha > > On Tue, 20 May 2008, Max Zhen wrote: > >> Hi Sasha, >> >> Were you building Xen on Solaris, or Linux? >> Have you pushed all patches before building? >> >> Max >> >> Alexandra (Sasha) Fedorova wrote: >>> I have downloaded xvm-src.tar.bz2 and built my own xen.gz image of >>> the hypervisor. I have done the build by executing "make world". >>> While xen.gz was built successfully, I got an error when building >>> install-tools. The compiler complained that function vasprintf (on >>> line 35 of utils.c) was not defined. I don''t think vasprintf is even >>> used in Solaris, probably just on Linux. So the error is probably >>> due to the fact that xen is meant to be built on Linux. Are there >>> any configuration options that could fix the error? Currently I am >>> using the following command to build the tree: >>> >>> gmake XEN_COMPILE_ARCH=x86_64 verbose=y debug=y debugger=y perfc=y >>> world >>> >>> Thanks! >>> This message posted from opensolaris.org >>> _______________________________________________ >>> xen-discuss mailing list >>> xen-discuss@opensolaris.org >>>
Thanks, everyone for your help. I have successfully built Xen, and I have documented the process. Posting it here for everyone''s reference. 1. Download Xen sources. They must match the build of Solaris that you are using. For example, if you are using on-src-b79 (OpenSolaris build 79), you would get your Xen sources here at the gate http://dlc.sun.com/osol/on/downloads/b79/. For your convenience, the Xen source file xvm-src.tar.bz2 has already been downloaded to the directory /cs/systems/Solaris-source/on-src-b79. 2. Unpack the sources bzip2 -dc xvm-src.tar.bz2 | tar xf - Now you have the source from the original Xen''s Mercurial repository. Since the version of Xen for Solaris xVM is different than the original, you need to apply the patches. The patches are found in the tree source directory that you have downloaded under xen.hg/.hg. 3. Set up the environmental files for the Mercurial repository. Create a ~/.hqrc file with the following contents: [extensions] hgext.mq [paths] default=/home/username/Xen/xen.hg (Substitute the directory with the path to YOUR Xen directory.) 3. Add the following variables to your environment (i.e., in your .cshrc or .bashrc file): setenv EMAIL username@youdomain.com setenv XVM_WS /home/username/Xen/ setenv EDITOR vi setenv SOLARIS_BUILD_TOOLS /opt 4. In xen.hg, run: hg qpush -a This will apply the Solaris-specific patches to the main Xen tree. 5. From xen.hg type ../sunos.hg/bin/build-all. This will build the sources and produce installable packages. xen.gz and xen-syms will be in /home/username/Xen/proto/install/boot (32-bit build) and in /home/username/Xen/proto/install/boot/amd64 (64-bit build). 6. Copy the 32-bit images to the /boot directory on your machine, and 64-bit images to /boot/amd64. (Note, this example is for my build, it is quite possible that you will see a platform-specific directory other than amd64 on your machine). Save the xen.gz and xen-syms under a different name, e.g., xen-myname.gz, so you can always revert to original images if the ones that you built do not boot. 7. Add the entry corresponding to your xen images to /boot/grub/menu.lst -- this should be self-explanatory if you look at menu.lst. Reboot the machine and choose to boot from your images in the grub menu! If Xen complains that the ELF image of the guest domain is incompatible with Xen, you probably didn''t copy your xen.gz to the right directory (e.g., mixed up the 32- and 64- bit builds). I believe that in Xen versions beyond 3.0 this won''t be the problem -- i.e., you''d be able to boot a 32-bit guest over a 64-bit Xen, but I don''t know for sure. 8. I am not yet familiar with the process of installing the entire collection of packages (including tools and libraries). Perhaps someone more knowledgeable could elaborate? This message posted from opensolaris.org
Thanks, everyone for your help. I have successfully built Xen, and I have documented the process. Posting it here for everyone''s reference. 1. Download Xen sources. They must match the build of Solaris that you are using. For example, if you are using on-src-b79 (OpenSolaris build 79), you would get your Xen sources here at the gate http://dlc.sun.com/osol/on/downloads/b79/. For your convenience, the Xen source file xvm-src.tar.bz2 has already been downloaded to the directory /cs/systems/Solaris-source/on-src-b79. 2. Unpack the sources bzip2 -dc xvm-src.tar.bz2 | tar xf - Now you have the source from the original Xen''s Mercurial repository. Since the version of Xen for Solaris xVM is different than the original, you need to apply the patches. The patches are found in the tree source directory that you have downloaded under xen.hg/.hg. 3. Set up the environmental files for the Mercurial repository. Create a ~/.hqrc file with the following contents: [extensions] hgext.mq [paths] default=/home/username/Xen/xen.hg (Substitute the directory with the path to YOUR Xen directory.) 4. Add the following variables to your environment (i.e., in your .cshrc or .bashrc file): setenv EMAIL username at youdomain dot com setenv XVM_WS /home/username/Xen/ setenv EDITOR vi setenv SOLARIS_BUILD_TOOLS /opt 5. In xen.hg, run: hg qpush -a This will apply the Solaris-specific patches to the main Xen tree. 6. From xen.hg type ../sunos.hg/bin/build-all. This will build the sources and produce installable packages. xen.gz and xen-syms will be in /home/username/Xen/proto/install/boot (32-bit build) and in /home/username/Xen/proto/install/boot/amd64 (64-bit build). 7. Copy the 32-bit images to the /boot directory on your machine, and 64-bit images to /boot/amd64. (Note, this example is for my build, it is quite possible that you will see a platform-specific directory other than amd64 on your machine). Save the xen.gz and xen-syms under a different name, e.g., xen-myname.gz, so you can always revert to original images if the ones that you built do not boot. 8. Add the entry corresponding to your xen images to /boot/grub/menu.lst -- this should be self-explanatory if you look at menu.lst. Reboot the machine and choose to boot from your images in the grub menu! If Xen complains that the ELF image of the guest domain is incompatible with Xen, you probably didn''t copy your xen.gz to the right directory (e.g., mixed up the 32- and 64- bit builds). I believe that in Xen versions beyond 3.0 this won''t be the problem -- i.e., you''d be able to boot a 32-bit guest over a 64-bit Xen, but I don''t know for sure. 9. I am not yet familiar with the process of installing the entire collection of packages (including tools and libraries). Perhaps someone more knowledgeable could elaborate? This message posted from opensolaris.org