|
(转两篇不错的文章)
Rob Garth 的网站是 http://www.users.on.net/~rgarth/weblog/fedora/
http://www.users.on.net/~rgarth/weblog/fedora/patch_cd.autumn
http://www.users.on.net/~rgarth/weblog/fedora/patch_repo.html
01/May/2006
Building an updated Fedora Core 5 DVD
One of the things which has always ticked me off is making a clean fedora install, and then having hundreds of megs of patches to download the first time "yum update" is run. However, building a patched install dvd is actually pretty simple.
In FC5 the install uses yum which makes this even easier. You could do this any number of ways, but I use novi, an iso of the FC5 DVD, and local mirror of the Fedora updates from: http://download.fedora.redhat.co ... core/updates/5/i386, which needs to be available to your local machine.
Create the directory where you will build your patched install, any directory is fine, below is simply the example I use (FC5_year.month):
# mkdir -p /opt/FC_2006.4/i386
# cd /opt/FC_2006.4
Mount the ISO image:
# mount -o loop /full/path/FC-5-i386-DVD.iso /mnt
Copy all files on the DVD except the actual RPMs to the build directory:
# rsync --archive --exclude 'Fedora/RPMS/*.rpm' /mnt/ i386
novi will list which packages should be in the build tree, the following shell hack will copy the required files to the build tree, you can ignore any errors raised.
for fn in `novi path/to/updates /mnt/Fedora/RPMS/ | awk '{print $2}'`; do
cp $fn i386/Fedora/RPMS/
done
If you were planning to add custom rpm files, you could do that now. If you were going to split the tree into cd size images, or create a source cd then there would be more steps involved, but as this is simply updating packages, the comps.xml is up to date and the DVD almost ready
Update the repo files:
# cd i386
# createrepo -u "media://1142397575.182477#1" -g Fedora/base/comps.xml .
# cd ..
I am not sure what the baseurl (-u) setting does. I know it is required, but if anyone knows please email.
Now we just need to make the ISO image, and embed the md5sum into it so it can be integrity checked on install
# mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 5 (Patched.0406)" -b isolinux/isolinux.bin \
-c isolinux/boot.cat -x "lost+found" -o FC5-i386-dvd-patched.iso i386
# /usr/lib/anaconda-runtime/implantisomd5 FC5-i386-dvd-patched.iso
Done. The new ISO is ready to burn and use.
Some people have commented that this solution is, in fact, not particularly simple. Granted, for a home user who does not have a local copy of all the patches, this isn't going to make a lot of sense. I am, however, happy to make the iso images available monthly. Please check here for iso images. If anyone wants to mirror these, please feel free.
08/May/2006
Updated FC5 Network Install
Creating a yum repo for installing FC5, prepatched, via the network, is also fairly simple. And makes a lot of sense for anyone supporting a fedora based environment.
I use novi, a local mirror of the fedora install tree:
http://download.fedora.redhat.co ... nux/core/5/i386/os/
and a local mirror of the fedora updates:
http://download.fedora.redhat.co ... ore/updates/5/i386/
Some have suggested that rsync is the proper way to keep these mirrors up to date. Probably true, but it's easier to simply use wget over your favourite existing mirror. These commands work for me:
# wget --mirror -nH ftp://ftp.planetmirror.com/pub/fedora/linux/core/5/i386/os
# wget --mirror -nH ftp://ftp.planetmirror.com/pub/fedora/linux/core/updates/5/i386
This will update or create your local mirror, using the same directory structure as the remote site. This location needs to be available on your local web server. I do all of this on the filesystem of our intranet server, and the files are accessible via: http://intranet.address/pub/fedora/linux/....
You could now perform a network install using your local install tree, however, you would still have to apply patches after the install.
If you have the filespace I recommend leaving the install tree as is and creating a separate patched install tree. Copy the current install tree minus the RPMs to a new location:
# rsync --archive --exclude 'Fedora/RPMS/*.rpm' \
/pub/fedora/linux/core/5/i386/os/ \
/pub/fedora/linux/core/5/i386/os.patched
novi will list which packages should be in the patched tree, the following shell hack will copy the required files to the build tree.
# current=`novi /pub/fedora/linux/core/5/i386/os/Fedora/RPMS \
> /pub/fedora/linux/core/updates/5/i386/ \
> | awk '{print $2}'`
# for fn in $current; do
> cp $fn /pub/fedora/linux/core/5/i386/os.patched/Fedora/RPMS
> done
Then we need to update the repo:
# cd /pub/fedora/linux/core/5/i386/os.patched
# createrepo -g Fedora/base/comps.xml .
All Done! Now when you boot from the install CD or DVD use "linux askmethod".
Server: Your internal web server
Directory: /pub/fedora/linux/core/5/i386/os.patched/ |
|