#!/usr/bin/env bash # check arguments if [ $# -ne 2 ]; then echo "usage: ${0} [image-file] [mount-point]" exit 1 fi image_file=${1} if [ -f ${image_file} ]; then : else echo "can't find regular file ${image_file}" exit 1 fi mount_point=${2} if [ -d ${mount_point} ]; then : else echo "can't find directory ${mount_point}" exit 1 fi # mount raw qemu device mount -o loop,rw,offset=32256 ${image_file} ${mount_point}