How to update a directory of RPMs for a custom ISO?!?!?!
I have created a custom ISO that I am happy with. I'd like to find a way to keep the RPMs on the ISO updated to the newest versions for when I respin the CD. Just trying to keep from having to download all the updates as soon as the ISO is installed.
It's a CentOS4.4 ISO that installs just the packages I want, and runs some %post install stuff. I keep the entire thing in /ISO and my RPMs (base) are in /ISO/CentOS/RPMS/. I have already whipped up a script to regenerate the hdlist when I make changes in there and have been updating the packages by hand up to this point - I find the new package on a Cent mirror in the updates dir, delete the old version out of my dir and download the new version into it. Once I do this for all the packages I regen the hdlist and respin the ISO. I just know there has to be an easier way to accomplish this.
I've seen some webpages on this, but they're all geared towards RH7/8/9 or FC1/2 and seem a little dated.
Can someone point me towards a link or some tips that might help me along?
Thanks in advance.
I assume "spin" the ISO means burn it to a CD.
I don't do rpm's (deb's instead), but I've done a lot of scripting. Perhaps if you'd put the commands for the key steps in a code block, I could suggest ways to automate them.
When you do it by hand, how to you know which packages need updating?
When I do it by hand, I look at a Cent mirror's "update" dir, and then check to see if any of the programs in there match what I've included in the ISO. Here's a link to one of the update dirs:
In my ISO dir, I check to see if the version is the same or if there is a newer version on the Cent mirror. Here's a sample snippet of my dir:
-rw-r--r-- 1 root root 32819 Feb 28 11:29 ypbind-1.17.2-8.i386.rpm
-rw-r--r-- 1 root root 64352 Feb 28 11:29 yp-tools-2.8-7.i386.rpm
-rw-r--r-- 1 root root 393768 Feb 28 11:29 yum-2.4.3-1.c4.noarch.rpm
-rw-r--r-- 1 root root 116262 Feb 28 11:29 zip-2.3-27.i386.rpm
-rw-r--r-- 1 root root 44560 Feb 28 11:29 zlib-220.127.116.11-1.2.i386.rpm
-rw-r--r-- 1 root root 91272 Feb 28 11:29 zlib-devel-18.104.22.168-1.2.i386.rpm
If there's a newer version on the mirror, I delete the old version out of my dir, and then wget the new version into it. I do this for any of the RPMs that have updates. Once that's done I run a little script I threw together that runs the genhdlist commands I need to rebuild the hdlist.
I'm imaging I'll have to get a dir listing from the mirror and break the filenames into parts (probably separated by the hyphens) and put them in an array. That seems the easiest way to compare version numbers to me, but I'm sure there's another way to do it.
I count 317 files in the update dir @ Centos, how many files in your ISO dir?
I'm thinking that it might be easier to make a list of your packages & check it against the updates, rather than the other way 'round. It might even be efficient to attempt to wget every package in your dir because it takes so little time for wget to say "tilt" if there is nothing there.
Do your know an easy way to "scrape" the listing of the updates dir?
Also, which portion of the file names are constant & which change w/ updates? Maybe a version independent master list of the contents of your ISO would be helpful, then the script can check for updates & that the ver. is later.
Is there ever file of interest whose name does NOT end in ".rpm"?
I agree that parsing will probably be necessary, but I wouldn't worry if arrays are the best way.
There are 443 files in my RPM dir. I'll use a filename as a constant:
To the best of my knowledge, openssh-server will be constant, RHEL4 will probably be constant, i386.rpm will also probably stay constant.
And my pickle is also on how to get a useable output from the update dir for this as well.
The older stuff I read wasn't very helpful, but they almost all pointed to the fact that I would probably need to mirror the updates dir on my local machine as well. I believe I can just rsync this, and then maybe just compare individual files using the cmp command? If it shows a difference between the 2 file names (assuming I'm reading them 1 at a time) then delete the original one and copy the one from the updates dir into the original dir?
|All times are GMT -5. The time now is 12:46 PM.|