[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Debian MD5 Digests

After 4 failed attempts at installing Debian Linux from CDs
that were burned from downloaded  .iso  files, I've finally come to
the conclusion that my CD Burner is not working properly .... 

Three of the  .iso  files I tried for a Sarge install were versions 
of the Debian net-install and one built from  .jigdo  .... 

    o net-install 
       Current .... 2004-07-23
       Current .... 2004-07-25

    o .jigdo ....... 2004-07-25

The md5 digests of all downloaded  .iso  files has checked out OK 
in each case  PRIOR  to burning them to CD and in each case
the burned CDs always boot and begin the Debian install proc
which ultimately fails due to md5 errors ..... 

I was just too dense to consider CD burning problems at the time
and so it took 4 install failures to finally get it through my thick skull 
that something on  THIS  particular machine was fouled ....

The Debian installer doesn't present the user
with the opportunity to check CD-ROM integrity
until  after the failures during the initial install proc
have occurred, which seems a bit late ....  

It would probably be cool if the installer would
present the menu with the option to check the CD
before anything else starts .... 

I wrote a small Python script to check md5s of the burned CD files
against those in the supplied  md5sum.txt  file on sarge-i386-1, 
but since the burned CD I have is corrupted, 
testing the script  is somewhat tedious and fails 
at different points in processing which I  think/hope 
will go away when I get a good CD burn .... 

However, I would like to hear from someone 
who has a Debian CD with the  md5sum.txt  file
on it that would test the script and see if it 
actually runs all the way to completion .... 

Although I tested the script against sarge-i386-1,
probably any of the  md5sum.txt  files that contain data
in the form of   md5_value path   should work ....

Are all the files that are listed in the  md5sum.txt  file
always included on the CD ???? 

I added a check for this after seeing  file not found  errors 
while running the script .... 

# ------------------------------------------------------------------------------------------
# deb_md5.py

import md5 , os ,  sys

if len( sys.argv ) < 2 : 
    print '    Usage .......... python deb_md5.py base_path_to_CD'
    sys.exit( -1 )

base_path = sys.argv[ 1 ]

if not os.path.exists( base_path ) : 
    print '    ****  Base Path NOT Found  ****'
    sys.exit( -2 )

os.chdir( base_path )                        

file_in  = file( 'md5sum.txt' , 'r' )

def md5_digest( xPath ) : 
    xFile = file( xPath , 'rb' ).read()
    m = md5.new()
    m.update( xFile )
    return m.hexdigest()     

rec_num = 0

for this_line in file_in : 

    this_list = this_line.split()

    this_md5 = this_list[ 0 ]
    this_path = this_list[ 1 ]

    rec_num += 1

    if os.path.exists( this_path ) :

        that_md5 = md5_digest( this_path )

        if this_md5 != that_md5 : 
            print '%4d * MD5 Error * %s ' % ( rec_num , this_path )

        else : 
            print '%4d %s' % ( rec_num , this_path )

    else : 
        print '%4d * Not Found * %s' % ( rec_num , this_path )


Cousin Stanley
Human Being
Phoenix, Arizona

Reply to: