notes/Mount IMG file with multipule Partitions PengPod-ZBg2R1Xd.sh
#!/bin/bash
wget “http://pengpod.com/dl/images/pengpod700-linaro-latest.img.tar.gz”
tar -xzf pengpod700-linaro-latest.img.tar.gz
#get offset for partition 1
p1=”$(sudo parted pengpod700-linaro-latest.img -ms unit B p|grep "^1:" |cut -d\: -f2|cut -d\B -f1)”
#get offset for partition 2
p2=”$(sudo parted pengpod700-linaro-latest.img -ms unit B p|grep "^2:" |cut -d\: -f2|cut -d\B -f1)”
mkdir part1 part2
sudo mount -o loop,offset=$p1 pengpod700-linaro-latest.img part1
sudo mount -o loop,offset=$p2 pengpod700-linaro-latest.img part2
syntax highlighted by Code2HTML, v. 0.9.1