Rebuilding Fedora DVD

I am going home to San Diego tomorrow. One of the things I do every Christmas is upgrade my Dad’s computer to the newest version of Fedora. However, FC4 has been out for six months so there is a whole pile of updates. Instead of downloading all the updates after the upgrade, I wanted to write them to a DVD. Even better, I made a bootable install DVD with the new packages.

First, I prepared the directory with a copy of the original DVD, and copied the update rpms. The repomanage utility in the yum-utils package helped remove the duplicates.

cp 4/i386/os/* rebuild/i386
cp updates/4/i386/* rebuild/i386/Fedora/RPMS
repomanage --old rebuild/i396/Fedora/RPMS | xargs rm

Then, it was time to rebuild the installer. This needs the anaconda and anaconda-runtime packages. The genhdlist creates the hdlist files in the Fedora/base directory. The buildinstall builds all the boot and installer images.

export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
export FCBASE=`pwd`
date=$(date +%Y-%m-%d)

genhdlist --productpath=Fedora $FCBASE/i386

pkgorder $FCBASE/i386 i386 Fedora | tee $FCBASE/pkgfile.$date
sudo buildinstall --comp dist-4.1 --pkgorder $FCBASE/pkgfile.$date \
--version 4 --product 'Fedora Core' --release 'Fedora Core 4' \
--prodpath Fedora $FCBASE/i386

genhdlist --withnumbers --productpath Fedora \
--fileorder $FCBASE/pkgfile.2005-12-23 $FCBASE/i386

Finally, write the DVD ISO image.

mkisofs -R -J -T -no-emul-boot -boot-load-size 4 -boot-info-table \
    -V "FC 4.3 i386 DVD" \
    -A "Fedora Core 4.3 Update $date i386 DVD" \
    -P "Ian Burrell " \
    -p "Ian Burrell " \
    -b isolinux/isolinux.bin -c isolinux/ -x lost+found \
    -o FC-4.3-i386-DVD.iso i386