DEFAULT_FCDISTRO=f20
DEFAULT_PLDISTRO=lxc
DEFAULT_PERSONALITY=linux64
+DEFAULT_MEMORY=512
##########
# constant
cat <<EOF
<domain type='lxc'>
<name>$lxc</name>
- <memory>524288</memory>
+ <memory>$MEMORY</memory>
<os>
<type arch='$arch2'>exe</type>
<init>/sbin/init</init>
cat <<EOF
<domain type='lxc'>
<name>$lxc</name>
- <memory>524288</memory>
+ <memory>$MEMORY</memory>
<os>
<type arch='$arch2'>exe</type>
<init>/sbin/init</init>
echo " -P pkgs_file - defines a set of extra packages to install in guest"
echo " by default we use devel.pkgs (build mode) or runtime.pkgs (test mode)"
echo " -i image - the location of the rootfs"
+ echo " -m memory - the amount of allocated memory in MB - defaults to $DEFAULT_MEMORY MB"
echo " -v be verbose"
exit 1
}
exit 1
fi
- while getopts "n:f:d:p:r:P:i:v" opt ; do
+ while getopts "n:f:d:p:r:P:i:m:v" opt ; do
case $opt in
n) GUEST_HOSTNAME=$OPTARG;;
f) fcdistro=$OPTARG;;
r) REPO_URL=$OPTARG;;
P) PREINSTALLED=$OPTARG;;
i) IMAGE=$OPTARG;;
+ m) MEMORY=$OPTARG;;
v) VERBOSE=true; set -x;;
*) usage ;;
esac
[ -z "$fcdistro" ] && fcdistro=$DEFAULT_FCDISTRO
[ -z "$pldistro" ] && pldistro=$DEFAULT_PLDISTRO
[ -z "$personality" ] && personality=$DEFAULT_PERSONALITY
+ [ -z "$MEMORY" ] && MEMORY=$DEFAULT_MEMORY
+
+ # set memory in KB
+ MEMORY=$(($MEMORY * 1024))
# the set of preinstalled packages - depends on mode
if [ -z "$PREINSTALLED"] ; then