checking a burned CD against an ISO
Sy Ali
sy1234-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Thu May 24 07:05:08 UTC 2007
Thanks to Chris, I did a bit of revising. I'm going to stick the
script over here:
http://jrandomhacker.info/Checking_a_CD_after_it%27s_been_burned
Regarding these two commands:
DISK_MD5=$( md5sum "$DEVICE" )
DISK_MD5=`dd if=$DEVICE | head -c $FILESIZE | md5sum`
They both work fine, and work/fail in the right cases. I'm choosing
the simpler one because "it works for me" but I'm going to note the
earlier one which relies on dd/head in case there is a problem for
some people.
On 5/23/07, Chris F.A. Johnson <cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org> wrote:
> > ISO_FILENAME=pclinuxos-2007.iso
> > MD5_FILENAME=pclinuxos-2007.md5sum
> > DEVICE=/dev/dvd
>
> I'd use command-line parameters:
>
> ISO_FILENAME=$1
> MD5_FILENAME=$2
This wouldn't be appropriate for copying-and-pasting the script. If
this were made to be more 'complete' I'd rather use dialog or
something more advanced to help select the file. It's meant for
newbies. More advanced people could easily peek in and edit the
script.
Even for an inbetween feature, I'd have to detect if the (three)
parameters were filled in and were sane. If not I'd have to spit out
an error or give help, which is a bit more than I want to bother with.
> > SOURCE_MD5=`cat $MD5_FILENAME`
>
> No need for an external command:
>
> read SOURCE_MD5 < $MD5_FILENAME
Awesome. I'm always hesitant about relying on external commands. Not
that I'd consider a system without 'cat' to be particularly complete..
but it's nice to not have to rely on such things.
I guess maybe I'm requiring bash, but that's not so big a leap.
> SOURCE_MD5=${SOURCE_MD5%% *}
Awesome. I hated using sed.
> Only one command is needed:
>
> printf "\n\n\n"
I wondered about this shortly after sending the email. I should have
remembered the bit of C which would have had led me to that answer.
On 5/23/07, John Vetterli <jvetterli-zC6tqtfhjqE at public.gmane.org> wrote:
> I usually just use:
>
> readcd dev=<device> f=- | diff -s - <filename>
>
> where <device> is the scsi "scsibus,target,lun" and <filename> is the iso
> file. Try "man readcd" for more info.
But I wouldn't want people to need to figure out the device info.
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list