Re: [vserver] Can't install Centos guest after 5.3 upgrade

From: John A. Sullivan III <jsullivan_at_opensourcedevel.com>
Date: Tue 14 Apr 2009 - 18:21:32 BST
Message-Id: <1239729692.6601.32.camel@jaspav.missionsit.net.missionsit.net>

On Mon, 2009-04-13 at 18:36 -0700, Roderick A. Anderson wrote:
> John Alberts wrote:
> > Just thought I would update everyone on my progress on getting yum
> > working with CentOS 5.3 for vserver.
> > I'm sorry to say, the yum 3.2.4 chroot patch does not work on the yum
> > 3.2.19-18 rpm. I've never attempted to patch a source tarball and I
> > don't know python, but I've spent quite a few hours trying to create a
> > patch that will work. There are quite a few differences between the
> > versions. Although I was able to create a patch and get a newly built
> > rpm installed, I haven't been able to get a working yum. There's
> > always some python errors, so I guess my patching skills really suck.
> > I may work on this a bit more, but for now, unfortunately, I have
> > other things I need to work on.
> >
> > John
>
> I just build yum-3.2.19-18.noarch.rpm.
>
> I don't have a system right now to test it on. If anyone wants to give
> it a whirl let me know. I'll email the RPM or if someone has a good
> drop point.
>
>
> Otherwise here is the process I used.
>
> Following (loosely) the instructions at http://linux-vserver.org/Yum-patch
>
> 1. Downloaded (wget) the src rpm from
>
> ftp://ftp.pbone.net/mirror/ftp.centos.org/5.3/os/SRPMS/yum-3.2.19-18.el5.centos.src.rpm
>
>
> into /usr/src/redhat/SRPMS
>
> 2. rpm -i yum-3.2.19-18.el5.centos.src.rpm
>
> 3. cd /usr/src/SORUCES
>
> 4. Download (wget) the patch from
>
> http://svn.linux-vserver.org/svn/util-vserver/trunk/contrib/yum-3.2.19-chroot.patch
>
> 5. cd /usr/src/redhat/SPEC
>
> 6. vim yum.spec
> and added a line "Patch4: yum-3.2.19-chroot.patch"
> right after "Patch3: yum-ia64-multilib.patch (line 20)
> and a line "%patch4 -p1"
> right after "%patch3 -p1" (line 106)
>
> 7. rpmbuild -ba yum.spec
>
>
> There was one small hitch. To build on my non-Vserver, very yum/repo
> abused, recently updated to CentOS 5.3 workstation I had to install
> intltool to get the build to work.
>
>
> \\||/
> Rod
Thanks to all who worked on this. I took a slightly different approach
probably based upon my ignorance as I don't even remember if I've
repackaged RPMs in the past! I'll post it here in case it is of any
benefit. I was a little disconcerted by the number of warnings and
wondered if they came from using the SRPM from pbone.net instead of the
CentOS repositories (it turns out it didn't matter). So I downloaded
the SRPM from there. Very mindful of Guenther's warnings, I found my
compilation as a non-root user did not seem to read the %{?dist}
variable so I hard set it and gave it a version of 18.1.

Here are the steps I followed (from our internal documentation) and I'll
attach the resultant RPM and SRPM. Thanks, all - John

Retrieve the CentOS yum SRPM
        wget http://mirror.centos.org/centos/5/os/SRPMS/yum-3.2.19-18.el5.centos.src.rpm
Install rpmbuild and related packages (yum install rpm-build redhat-rpm-config intltool)
        su - compuser (NEVER build rpms as root)
        mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
        echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
Still as compuser do:
        rpm -i yum-3.2.19-18.el5.centos.src.rpm
Go to the SOURCES directory and download the appropriate patch:
        cd ~/rpmbuild/SOURCES
        wget http://svn.linux-vserver.org/svn/util-vserver/trunk/contrib/yum-3.2.19-chroot.patch
Go to the SPECS directory and edit the yum.spec file as follows:
        cd ../SPECS
We do not seem to be able to read the %dist variable when compiling as a non-root user so edit the "Release: 18%{?dist}"
line to read "Release: 18.1.el5.centos" (as appropriate - we incremented the version by .1 in this case which may not be a good idea)
Add the line:
Patch4: yum-3.2.19-chroot.patch
after the Patch3: line
Add the line:
%patch4 -p1
after the %patch3 -p1 line
Build the RPM from the SPECS directory (rpmbuild -ba yum.spec)
The RPM will appear in ~/rpmbuild/RPMS/noarch/

-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan@opensourcedevel.com
http://www.spiritualoutreach.com
Making Christianity intelligible to secular society

Received on Tue Apr 14 18:20:42 2009
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 14 Apr 2009 - 18:20:45 BST by hypermail 2.1.8