From 3bbe6bc6c317c37b4acf1e453b37bd0f0921dd8a Mon Sep 17 00:00:00 2001 From: Colin McCabe Date: Mon, 28 Dec 2009 15:18:10 -0800 Subject: [PATCH] Add mount.qemu script to mount raw qemu images --- mount.qemu | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100755 mount.qemu diff --git a/mount.qemu b/mount.qemu new file mode 100755 index 0000000..d3f3d0f --- /dev/null +++ b/mount.qemu @@ -0,0 +1,26 @@ +#!/bin/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,offset=32256 ${image_file} ${mount_point} -- 1.6.6.rc1.39.g9a42