» Wednesday, March 10, 2010 Register  «  Login  «
    Search

Quick and dirty build instructions for Virtual lron VSTools

These are not official and use a non VI build file, use at your risk!  No warranty is given or implied, you are using this text or the RPM here at you own risk.

Build and test on a Virtual Machine. Make a backup of the virtual disk before installing so if it goes wrong you have a clean virtual disk to boot from.

Watch out for bad line breaks!!

Login as a normal user

Make sure we are home:
cd $HOME
Set the rpmbuild root:
echo %_topdir $HOME/tmp/rpmbuild > .rpmmacros

Make our temporary building site:
mkdir $HOME/tmp
cd $HOME/tmp

Get the kernel sources:
wget
http://www.mirrorservice.org/sites/mirror.centos.org/4.5/updates/i386/RPMS/kernel-smp-devel-2.6.9-55.0.2.EL.i686.rpm
Expand the sources:
rpm2cpio kernel-smp-devel-2.6.9-55.0.2.EL.i686.rpm |cpio -div

Get the tools sources:
wget
http://s3.amazonaws.com/VIDownloads/domu-sources374.tar.gz
Expand the sources:
tar -zxvf domu-sources374.tar.gz

Get the hacked rpmbuild spec file:
wget
http://theinternet.org.uk/downloads/vstools.2.6.9-55.0.2.ELsmp.spec.txt

cd $HOME/tmp/domu/build

edit env.mak and add the following for release 5 before the PATH := line at the bottome of the file.

 

ifeq ($(TOOL_BASE),RHEL4-U5-32)
# RedHat EL4 Update 5 tools
        BASE_TOOLS_RPMS := $(GOS_TOOLS)/rhel4-u5.32bit/rpms
        BASE_TOOLS      := $(GOS_TOOLS)/rhel4-u5.32bit/tools
        BASE_TOOLS_PATH := $(BASE_TOOLS)/bin:$(BASE_TOOLS)/usr/bin
# Needed for binutils
        LD_LIBRARY_PATH := $(BASE_TOOLS)/usr/lib

        KERNEL_BASE_SRC := $(BASE_TOOLS_RPMS)/rhel4-u5.kernels.32bit.tar.bz2
        KERNEL_BASE_DIR := $(BASE_TOOLS)/usr/src/kernels
        ARCH=i386
endif

 

Change to the VSTools drives folder and build the toolswith the tool base added above:

cd $HOME/tmp/domu/drivers/linux
make KERNEL_BASE_DIR=$HOME/tmp/usr/src/kernels/2.6.9-55.0.2.EL-smp-i686/ TOOL_BASE=RHEL4-U5-32 ARCH=i386

# optional to build vi_os_stats and use no use prebuilt. Why would I want to do that??
cd $HOME/tmp/domu/drivers/common/os_stats
make

Make the environment for building the rpm of the tools:

cd $HOME/tmp

mkdir $HOME/tmp/rpmbuild
mkdir $HOME/tmp/rpmbuild/BUILD
mkdir $HOME/tmp/rpmbuild/SOURCES
mkdir $HOME/tmp/rpmbuild/SPECS
mkdir $HOME/tmp/rpmbuild/SRPMS
mkdir $HOME/tmp/rpmbuild/RPMS
mkdir $HOME/tmp/rpmbuild/RPMS/i386

Move the hacked spec in to place:
mv $HOME/tmp/vstools.2.6.9-55.0.2.ELsmp.spec.txt $HOME/tmp/rpmbuild/SPECS/vstools.2.6.9-55.0.2.ELsmp.spec

Make the directory for the tools:
mkdir $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29

Copy stuff:

cp $HOME/tmp/domu/drivers/common/os_stats/prebuilt/vi_os_stats $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29

# optional vi_os_stats built above instead of prebuilt.
#cp $HOME/tmp/domu/drivers/common/os_stats/vi_os_stats $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29

cp $HOME/tmp/domu/drivers/linux/tools/*.sh $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29
cp $HOME/tmp/domu/drivers/linux/RHEL4-U5-32.modules/2.6.9-55.0.2.ELsmp/*.ko $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29

Makle executable:
chmod 755 $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29/*.ko

See what we got:
ls $HOME/tmp/rpmbuild/SOURCES/2.6.9-55.0.2.ELsmp-3.7.4.29

They're all there, build them:
rpmbuild -bb $HOME/tmp/rpmbuild/SPECS/vstools.2.6.9-55.0.2.ELsmp.spec

View the rpm:
rpm -qlp $HOME/tmp/rpmbuild/RPMS/i386/virtualiron-2.6.9-55.0.2.ELsmp.i386.rpm

Install as root ;-)

If disater strikes, remove as normal:

For manual removal:
Drivers are in /lib/modules/2.6.9-55.0.2.ELsmp/virtualiron/
vi_blkfront.ko   vi_dcmsrv.ko   vi_events.ko   vi_evtchn.ko   vi_gnttab.ko   vi_ha.ko   vi_netfront.ko
vi_nexbus.ko   vi_stats.ko   vi_xendcm.ko   vi_xen.ko

/usr/lib/virtualiron/vi_grubedit.sh -u will return your grub.conf to the pre-install version.

Scripts are in /usr/lib/virtualiron/
grub.conf.orig  vi_getstats.sh  vi_insmod.sh     vi_mkinitrd.sh
grub.default    vi_grubedit.sh  vi_killstats.sh  vi_os_stats

Delete the initial ram disk: /boot/initrd-2.6.9-55.0.2.ELsmp-virtualiron

Reboot and you should be back to where you started, a part from the time difference!
x.gif

. .
Copyright 1997 - 2009 by TheInternet.Org.UK & Arrowhead Systems Ltd