summaryrefslogtreecommitdiff
path: root/kogaion-live-check
blob: adab0f96fca7e1439cfa282c2eb74d5a1234549a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#
# kogaion_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:"
echo "http://www.kogaion.ro/"