Rhel dvd Disc Production Method

Source: Internet
Author: User
Tags ftp site

■ 1. Usage

Convert2dvd. sh dir dvdfilename

① Dir: directory for storing four rhel iso files

② Dvdfilename, such as RHEL4U4_DVD.iso

■ 2. script (convert2dvd. sh)

Please refer to the following link for more information:

#/Bin/bash

# By Chris Kloiber <ckloiber@redhat.com>

# 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 := ~ /Mkrhdvd} = "/"] & 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 TRANS. 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-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! "
Echo ""

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.