Makefile: add pickrand
[cmccabe-bin] / mbr_dump.sh
1 #!/bin/sh
2
3 #
4 # Dumps the bytes representing the four primary partitions in an IBM master
5 # boot record
6 #
7 # Colin McCabe
8 #
9 usage() {
10         echo "usage: ${0} <IBM-master-boot-record>"
11         echo "should be 512 bytes in length."
12         exit 1
13 }
14
15 if [ $# -ne 1 ]; then
16         usage
17 fi
18
19 if [ -e ${1} ]; then
20         PART_FILE=${1}
21 else
22         usage
23 fi
24
25 echo "# first partition"
26 od -j 446 -N 16 -t x1 ${1}
27 echo "# second partition"
28 od -j 462 -N 16 -t x1 ${1}
29 echo "# third partition"
30 od -j 478 -N 16 -t x1 ${1}
31 echo "# fourth partition"
32 od -j 494 -N 16 -t x1 ${1}