Makefile: add pickrand
[cmccabe-bin] / mount.qemu
1 #!/usr/bin/env bash
2
3 # check arguments
4 if [ $# -ne 2 ]; then
5         echo "usage: ${0} [image-file] [mount-point]"
6         exit 1
7 fi
8
9 image_file=${1}
10 if [ -f ${image_file} ]; then
11         :
12 else
13         echo "can't find regular file ${image_file}"
14         exit 1
15 fi
16
17 mount_point=${2}
18 if [ -d ${mount_point} ]; then
19         :
20 else
21         echo "can't find directory ${mount_point}"
22         exit 1
23 fi
24
25 # mount raw qemu device
26 mount -o loop,rw,offset=32256 ${image_file} ${mount_point}