root / snf-image-helper / tasks / 30MountImage.in @ 27acc2e4
History | View | Annotate | Download (689 Bytes)
1 |
#! /bin/bash |
---|---|
2 |
|
3 |
### BEGIN TASK INFO |
4 |
# Provides: MountImage |
5 |
# RunBefore: UmountImage |
6 |
# Short-Description: Mount the partition that hosts the image |
7 |
### END TASK INFO |
8 |
|
9 |
set -e |
10 |
. "@commondir@/common.sh" |
11 |
|
12 |
if [ ! -d "$SNF_IMAGE_TARGET" ]; then |
13 |
log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing" |
14 |
fi |
15 |
|
16 |
if [ -z "$SNF_IMAGE_PROPERTY_ROOT_PARTITION" ]; then |
17 |
log_error "Root Partition image property not defined" |
18 |
fi |
19 |
|
20 |
rootdev="${SNF_IMAGE_DEV}${SNF_IMAGE_PROPERTY_ROOT_PARTITION}" |
21 |
|
22 |
if [ ! -b "$rootdev" ]; then |
23 |
log_error "Image root partition device:\`$rootdev' is not a block device" |
24 |
fi |
25 |
|
26 |
mount "$rootdev" "$SNF_IMAGE_TARGET" -o rw |
27 |
|
28 |
exit 0 |
29 |
|
30 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : |