1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Adding initial contextualization script

git-svn-id: http://svn.opennebula.org/one/trunk@418 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Javier Fontán Muiños 2009-03-17 14:13:17 +00:00
parent 22b23a8a9e
commit f96a18ae68
2 changed files with 57 additions and 0 deletions

56
src/tm_mad/nfs/tm_context.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad #
# Complutense de Madrid (dsa-research.org) #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
# Parameters: a b c d e f g h
# SRC: a b c d e f g
# DST: h
while (( "$#" )); do
if [ "$#" == "1" ]; then
DST=$1
else
SRC="$SRC $1"
fi
shift
done
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/usr/lib/one/mads/tm_common.sh
else
TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh
fi
. $TMCOMMON
DST_PATH=`arg_path $DST`
DST_DIR=`dirname $DST_PATH`
ISO_DIR=$DST_DIR/isofiles
exec_and_log "mkdir -p $ISO_DIR"
for f in $SRC; do
exec_and_log "cp -R $f $ISO_DIR"
done
exec_and_log "mkisofs -o $DST_PATH -J -R $ISO_DIR"
exec_and_log "rm -rf $ISO_DIR"

View File

@ -4,3 +4,4 @@ MKSWAP = nfs/tm_mkswap.sh
MKIMAGE = nfs/tm_mkimage.sh
DELETE = nfs/tm_delete.sh
MV = nfs/tm_mv.sh
CONTEXT = nfs/tm_context.sh