View Single Post
Old 04-25-2013, 08:35 AM   #4
rupor
meat popsicle
rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.rupor ought to be getting tired of karma fortunes by now.
 
rupor's Avatar
 
Posts: 237
Karma: 441248
Join Date: Jul 2007
Location: USA
Device: Kindles, Pixels, iPads
You could try "automated" procedure anyway I think - at the beginning of it I take print of partition table, calculate MD5 on it and compare it with MD5 of "pristine" partition tables known to me. If partitions were modified in a way unknown to me - procedure would not do anything. So it should be harmless to try - even for second hand device.

Something like this:

Code:
CHECK=`parted -s /dev/mmcblk2 unit s print | tail -n 11 | head -n 10 | md5sum | awk '{ print $1 }'`
if [ "${CHECK}" != "23d3bacd2772baa47a19379e1f4bc84f" -a "${CHECK}" != "601f19a43444ef303bc0a4b81b557272" ]
then
   echo -e "ERROR: Device has wrong partitioning, exiting immediatly ${CHECK}\n" >> $W_LOG
rupor is offline   Reply With Quote