Docs/SysAdmin/Config/MakeDVD
From Mandriva Community Wiki
If you have a local copy of the Mandriva Repository, it is very easy to use that local copy to roll your own version of the Mandriva Bootable DVD which can be used to install the Mandriva Linux Operating System. One of the major advantages to rolling your own copy of the DVD is that, as updates are put out and replace existing copies of the RPM's, you can create an updated copy that can be used to install an up to date copy of the Operating System to save you the effort required to install updates after installing the OS.
I will go through each of the required steps here as necessary.
1. First, you will need to copy the repository that you want to burn to CD into a separate directory. This is necessary because you must edit the files to remove references to repositories that are too big to be included on a single bootable DVD. For instance, the Mandriva Linux 10.1 Community Edition RC1 includes about 8GB of files including the contrib repository. This is too big to fit on a 4.6 GB DVD Blank. So, you need to create a copy that you can edit and then remove the contrib repository before burning the ISO image and then burning that onto a DVD.
2. Once you have copied the entire repository, you will need to remove extraneous repositories from the mix. For the 10.1 CE, I would suggest removing the contrib repository since it will result in a DVD ISO image of about 3.6GB which will fit onto a single DVD Blank. To remove this repository, simply cd into the media directory where you have copied the files and rm -rf contrib. This will remove the RPM files. Next, you will need to enter into the media_info directory and remove the links and pointers to the contrib files. These should be listed as: hdlist2.cz, hdlist2.src.cz, hdlist_contrib.cz, hdlist-contrib.src.cz, pubkey2, pubkey_contrib, synthesis.hdlist2.cz, synthesis.hdlist2.src.cz, synthesis.hdlist_contrib.cz synthesis.hdlist_contrib.srz.cz. Once these files have been removed from the directory, you should be ready to begin building the iso image.
- Note: you should also delete the lines mentioning those files from the file hdlists in that folder. Otherwise the installation will stall at the "looking for available packages" stage.
3. You need to issue a command to build the ISO file that will be burned to the dvd. You will need to use the path where you copied the files and then provide a target directory for building the ISO image. You will need at least 4GB of space for the ISO image wherever you intend to build it. You can use the following command to build the ISO:
mkisofs -J -R -v -T -o /path/to/target/Mandrake.iso -b i586/isolinux/isolinux.bin \ -c i586/isolinux/boot.cat -no-emul-boot -boot-load-size 8 -boot-info-table /path/to/files
(all on one line)
- Comment: mkisofs requires paths for -b and -c options to be relative to the source directory. So do not prefix with /path/to/files/i586, and path at the end should include i586.
You should see the ISO file building at this point and when done, check the size and it should be at least close to 3.6 GB.
4. Now, you need only write the image to a DVD. For instructions, see Writing CD and DVD images. When done, you should have a bootable DVD that can be used to do the install without any disk swapping. If you like you can use the same technique to create a second disk that contains the contrib repository, simply be following the same steps but removing all but the contrib files and pointers.
[edit] Building DVD from ISO Images
It is also possible to build an Installation DVD by using the ISO images that are downloaded. The process involves mounting the ISO's as a loopback device, copying the files into a temporary directory, for each ISO, and then building a DVD image as I describe above. There is a script that will automate this process. However, the original script mkdvdiso.sh was built for the Red Hat Linux distribution and so may need to be altered to make it work correctly for Mandriva Linux. Below, I have attached a copy of this script that I have altered to work for Mandriva and have used, however, some things need to be done to use this.
- You need to create temporary directories in the /var directory, namely, /var/local/mkmandvd, in order to use this script
- Or, you will need to edit the script to use an alternate directory for temporary files where you have at least 4GB of space
#/bin/bash # by Chris Kloiber # A quick hack that will create a bootable DVD iso of a Red Hat Linux # Distribution. Feed it either a directory containing the downloaded # iso files of a distribution, or point it at a directory containing # the "RedHat", "isolinux", and "images" directories. # This version only works with "isolinux" based Red Hat Linux versions. # Lots of disk space required to work, 3X the distribution size at least. # GPL version 2 applies. No warranties, yadda, yadda. Have fun. if [ $# -lt 2 ]; then echo "Usage: `basename $0` source /destination/DVD.iso" echo "" echo " The 'source' can be either a directory containing a single" echo " set of isos, or an exploded tree like an ftp site." exit 1 fi cleanup() { [ ${LOOP:=/tmp/loop} = "/" ] && echo "LOOP mount point = \/, dying!" && exit [ -d $LOOP ] && rm -rf $LOOP [ ${DVD:=/var/local/mkmandvd} = "/" ] && echo "DVD data location is \/, dying!" && exit [ -d $DVD ] && rm -rf $DVD } cleanup mkdir -p $LOOP mkdir -p $DVD if [ !`ls $1/*.iso 2>&1>/dev/null ; echo $?` ]; then echo "Found ISO CD images..." CDS=`expr 0` DISKS="1" for f in `ls $1/*.iso`; do mount -o loop $f $LOOP cp -av $LOOP/* $DVD if [ -f $LOOP/.discinfo ]; then cp -av $LOOP/.discinfo $DVD CDS=`expr $CDS + 1` if [ $CDS != 1 ] ; then DISKS=`echo ${DISKS},${CDS}` fi fi umount $LOOP done if [ -e $DVD/.discinfo ]; then awk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo > $DVD/.discinfo.new mv $DVD/.discinfo.new $DVD/.discinfo fi else echo "Found FTP-like tree..." #rsync -avP --exclude SRPMS $1/* $DVD cp -av $1/* $DVD [ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD fi rm -rf $DVD/isolinux/boot.cat find $DVD -name TBL | xargs rm -f # My thanks to Mubashir Cheema for suggesting this fix. # cd $DVD mkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 8 -boot-info-table $DVD #/usr/lib/anaconda-runtime/implantisomd5 --force $2 # Don't like forced mediacheck? Try this instead. # /usr/lib/anaconda-runtime/implantisomd5 --supported-iso --force $2 cleanup echo "" echo "Process Complete!"