#!/bin/sh # # sabayon_livechk.sh # # Checks the integrity of a LiveCD/DVD by passing the # contents of the image through a md5sum (to be compared # with an documented value elsewhere). # if ( ! isoinfo -d -i /dev/cdrom >>/dev/null 2>/dev/null ); then echo "CDROM/DVD image not found!" exit 1 fi echo -e "Checking image integrity, please allow several minutes...\n" echo "You can check for errors by running 'tail /var/log/messages'" echo "in another console window. If you encounter multiple device" echo "errors with you cdrom, this probably indicates the test is failing." echo "You may type 'Ctrl-c' to abort the check." BLOCK_SIZE=`isoinfo -d -i /dev/cdrom | grep "Logical block size is" | cut -d: -f2 | sed 's/^[ ]//g'` VOL_SIZE=`isoinfo -d -i /dev/cdrom | grep "Volume size is" | cut -d: -f2 | sed 's/^[ ]//g'` dd if=/dev/cdrom bs=$BLOCK_SIZE count=$VOL_SIZE conv=notrunc,noerror | md5sum echo "Compare the above value with the value supplied in" echo "the release notes for this version at:"