30MountImage.in 689 Bytes
Newer Older
1
#! /bin/bash
Nikos Skalkotos's avatar
Nikos Skalkotos committed
2
3
4
5
6

### BEGIN TASK INFO
# Provides:		MountImage
# RunBefore:		UmountImage
# Short-Description:	Mount the partition that hosts the image
7
### END TASK INFO
Nikos Skalkotos's avatar
Nikos Skalkotos committed
8
9

set -e
10
. "@commondir@/common.sh"
Nikos Skalkotos's avatar
Nikos Skalkotos committed
11

12
13
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
    log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing"
Nikos Skalkotos's avatar
Nikos Skalkotos committed
14
15
fi

16
17
if [ -z "$SNF_IMAGE_PROPERTY_ROOT_PARTITION" ]; then
    log_error "Root Partition image property not defined"
Nikos Skalkotos's avatar
Nikos Skalkotos committed
18
19
fi

20
21
22
23
24
25
26
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
Nikos Skalkotos's avatar
Nikos Skalkotos committed
27
28

exit 0
29

Nikos Skalkotos's avatar
Nikos Skalkotos committed
30
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :