#! /bin/bash # Copyright (C) 2011 GRNET S.A. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. ### BEGIN TASK INFO # Provides: MountImage # RunBefore: UmountImage # Short-Description: Mount the partition that hosts the image ### END TASK INFO set -e . "@commondir@/common.sh" if [ ! -d "$SNF_IMAGE_TARGET" ]; then log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing" fi if [ -z "$SNF_IMAGE_PROPERTY_ROOT_PARTITION" ]; then log_error "Root Partition image property not defined" fi rootdev="${SNF_IMAGE_DEV}${SNF_IMAGE_PROPERTY_ROOT_PARTITION}" if [ ! -b "$rootdev" ]; then log_error "Image root partition device:\`$rootdev' is not a block device" fi mount "$rootdev" "$SNF_IMAGE_TARGET" -o rw exit 0 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :