Date: Wed, 27 Sep 2000 14:54:07 -0400 From: Bryan -TheBS- Smith <thebs@theseus.com> To: freebsd-questions@freebsd.org Cc: elug-eluglist@elug.org, leaplist@lists.leap.cf.org Subject: Re: cdrecord - WOW! <- mkhybrid tcsh script Message-ID: <0009271505110N.28318@spanky.theseus.com>
next in thread | raw e-mail | index | archive | help
Re: cdrecord - WOW! <- mkisofs tcsh script Bryan Smith wrote: > a complex UNIX tcsh script (with _full_error_checking_, i.e. > input files/directories). Let me know if you want a copy of > the later. On Wed, 27 Sep 2000, (various people) wrote: > Yes | Please | Cool | etc... Okay, the script is below. 4 things: 1. Does not make a bootable CD (but can be modified to do so -- in fact, I'll make a new script that takes an extra argument for doing so). 2. Uses mkhybrid instead of mkisofs. mkhybrid is just a patched version of mkisofs with Apple/Mac support. The script uses _limited_ Apple/Mac extensions (mainly just long filename support, as to not screw up other systems' capability to read it nor hog a lot of space). I believe all that needs to be removed from the option list is "-apple" (as well as the changing of the binary/path). 3. Does not run cdrecord (which would be more drive-specific). This is on purpose as I make it a script for my users to use to make ISO images (who may not have a CD burner). 4. I have used this script with tcsh on Linux, Solaris and FreeBSD (and shouldn't have a problem with any other UNIX). I'm planning to make a bash version so it will run nicely under Cygwin on Win32. -- TheBS #!/bin/tcsh -f # # /usr/local/bin/mkcd.tcsh # Make a CD-R ISO9660 Image with Mac/Windows/UNIX extensions # Written 2000May31 by Bryan J. Smith of Theseus Logic, Inc. # (on personal time) ########################################################## # CONSTANTS (please change for your site) ########################################################## set iso_dir="/home/temp/cdimages" set iso_pub="http://www.theseus.com -- Theseus logic, 3501 Quadrangle Blvd., Orlando, FL 32817" set iso_pre="`whoami`@theseus.com" set bin_path="/usr/local/bin/mkhybrid" set extra_opts="-apple" ########################################################## # SCRIPT ########################################################## # Help #========================================================= if ( $# < 2 || $1 == "--help" || $1 == "-?" || $1 == "-h" || $1 == "-H" ) then echo "" echo "Syntax:" echo " mkcd <label> <path> [<path>...]" echo "" echo "Where:" echo " <label> is the ISO volume label and output filename" echo " (withOUT the .iso extension -- NO SPACES)" echo " <path> is the relative or absolute path to files (recursive)" echo " (you can specify one or more paths -- use '.' to use" echo " the files/subdirectories in the current directory)" echo "" echo "The ISO file created will be '${iso_dir}/<label>.iso'" echo "The LOG of the make will be '${iso_dir}/<label>.log'" echo "" exit 0 endif # Verify an ISO image with the same name does NOT already exist #========================================================= set iso_label=$1 if ( -e ${iso_dir}/${iso_label}.iso ) then echo "" echo "ERROR: ISO Image '${iso_dir}/${iso_label}.iso' ALREADY EXISTS!" echo "Please pick another label." echo "" exit 1 endif # Verify target paths actual exist #========================================================= shift foreach param_path ( $* ) if ( ! -e ${param_path} ) then echo "" echo "ERROR: Path '${param_path}'" echo "is NOT a valid relative or absolute path." echo "" exit 1 endif end # Make ISO image #========================================================= echo "" echo "Making ISO file '${iso_dir}/${iso_label}.iso'" echo "" echo "Running command: ${bin_path} -a -A ${iso_label} -J -log-file ${iso_dir}/${iso_label}.log -o ${iso_dir}/${iso_label}.iso -P '${iso_pub}' -p '${iso_pre}' -R -r -V ${iso_label} -v ${extra_opts} $*" echo "" ${bin_path} -a -A ${iso_label} -J -log-file ${iso_dir}/${iso_label}.log -o ${iso_dir}/${iso_label}.iso -P "${iso_pub}" -p "${iso_pre}" -R -r -V ${iso_label} -v ${extra_opts} $* if ( $status ) then echo "" echo "ERROR in CD creation." echo "See LOG file '${iso_dir}/${iso_label}.log' for details." echo "" exit 1 else echo "" echo "CD ISO Image creation completed successfully." echo "See LOG file '${iso_dir}/${iso_label}.log' for details." echo "" endif exit 0 -- TheBS -- Bryan "TheBS" Smith PERSONAL CONTACT INFO *********************************************************** Chat: thebs413 @ AOL/MSN/Yahoo (see http://Everybuddy.com) Email: mailto:thebs@smithconcepts.com,thebs@theseus.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0009271505110N.28318>