summaryrefslogtreecommitdiff
path: root/app-misc/rogentoslive-tools/files/2/rogentos-live-check
blob: 5ad3d509e572cbc7089b3947adcca17c677ff3eb (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
#
# rogentos_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.rogentos.org/"