30MountImage.in 524 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 [ ! -b "$SNF_IMAGE_ROOTDEV" ]; then
    log_error "Device file:\`$SNF_IMAGE_ROOTDEV' is not a block device"
Nikos Skalkotos's avatar
Nikos Skalkotos committed
18
19
fi

20
mount "$SNF_IMAGE_ROOTDEV" "$SNF_IMAGE_TARGET" -o rw
Nikos Skalkotos's avatar
Nikos Skalkotos committed
21
22

exit 0
23

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