~ubuntu-branches/debian/sid/opennebula/sid

« back to all changes in this revision

Viewing changes to src/image_mad/remotes/fs/mkfs

  • Committer: Package Import Robot
  • Author(s): Damien Raude-Morvan
  • Date: 2012-05-11 19:27:43 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120511192743-lnz8gog5uxzmx2f3
Tags: 3.4.1-1
* New upstream release:
  - d/patches/default_conf.diff: Drop, transfert manager is now handled
    on a datasatore basis.
  - d/patches/genisoimage.diff: Merged upstream.
  - d/patches/oneacct-system-wide-installation.patch: Merged upstream.
  - Refresh others patches.
  - Update *.install files.
* Improve OCCI Self-Service UI integration:
  - Install into /usr/share/opennebula/occi/.
  - occi_system_jquery.diff: Use system wide jquery/jqueryui.
  - Add Recommends: libjs-jquery, libjs-jquery-ui for opennebula package.
* Add Suggests: ruby-uuidtools for econe-server.
* Install more manpages from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
# -------------------------------------------------------------------------- #
4
 
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             #
5
 
#                                                                            #
6
 
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
7
 
# not use this file except in compliance with the License. You may obtain    #
8
 
# a copy of the License at                                                   #
9
 
#                                                                            #
10
 
# http://www.apache.org/licenses/LICENSE-2.0                                 #
11
 
#                                                                            #
12
 
# Unless required by applicable law or agreed to in writing, software        #
13
 
# distributed under the License is distributed on an "AS IS" BASIS,          #
14
 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15
 
# See the License for the specific language governing permissions and        #
16
 
# limitations under the License.                                             #
17
 
#--------------------------------------------------------------------------- #
18
 
 
19
 
###############################################################################
20
 
# This script is used to create a VM image (SRC) of size (SIZE) and formatted
21
 
# as (FS)
22
 
###############################################################################
23
 
 
24
 
# ------------ Set up the environment to source common tools ------------
25
 
 
26
 
if [ -z "${ONE_LOCATION}" ]; then
27
 
    LIB_LOCATION=/usr/lib/one
28
 
else
29
 
    LIB_LOCATION=$ONE_LOCATION/lib
30
 
fi
31
 
 
32
 
. $LIB_LOCATION/sh/scripts_common.sh
33
 
source $(dirname $0)/fsrc
34
 
 
35
 
# ------------ Create the image to the repository ------------
36
 
 
37
 
FSTYPE=$1
38
 
SIZE=$2
39
 
ID=$3
40
 
 
41
 
DST=`generate_image_path`
42
 
 
43
 
MKFS_CMD=`mkfs_command $DST $FSTYPE`
44
 
 
45
 
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \
46
 
    "Could not create image $DST"
47
 
exec_and_log "$MKFS_CMD" \
48
 
    "Unable to create filesystem $FSTYPE in $DST"
49
 
exec_and_log "chmod 0660 $DST"
50
 
 
51
 
# ---------------- Get the size of the image ------------
52
 
SIZE=`fs_du $DST`
53
 
 
54
 
echo "$DST $SIZE"