Commit 68b0b963 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Change rc.frisbee and slicefix to set (change) the dom0_mem on the

kernel command line, according to new loadinfo variable returned from
tmcd. This is so we can tailor the amount of memory per node type.
parent 27c4fd96
......@@ -180,6 +180,7 @@ loadone() {
IMAGEID=""
KEEPALIVE=""
CONSOLE=""
DOM0MEM=""
for parm in $_LOADINFO; do
case $parm in
......@@ -198,6 +199,8 @@ loadone() {
VGAONLY=*|\
IMAGEID=*|\
KEEPALIVE=*|\
DOM0MEM=*|\
OSVERSION=*|\
CONSOLE=*)
# XXX need to parse better, eval is dangerous!
eval $parm
......@@ -485,6 +488,7 @@ loadone() {
export SLICEFIX_VGAONLY=$VGAONLY
export SLICEFIX_CONSOLE=$CONSOLE
export SLICEFIX_BIOSDISK=$BIOSDISK
export SLICEFIX_DOM0MEM=$DOM0MEM
$BINDIR/slicefix $PART $DISK
echo "`date`: Image #$_NUM load complete"
return 0
......
......@@ -163,6 +163,8 @@ if [ $CONSOLE = "unknown" ]; then
echo "WARNING: console type not set, assuming \"sio1\""
CONSOLE=sio1
fi
# DOM0MEM is optional
DOM0MEM=$SLICEFIX_DOM0MEM
#
# Handle pseudo-arguments in the filesystem
......@@ -995,6 +997,16 @@ dolinux() {
gdisk=`expr $gdisk + 1`
fi
fi
# For XEN, dom0 mem is hardwired on kernel command line.
if [ -n "$DOM0MEM" ]; then
if grep -q 'dom0_mem=' $tgconf 2>/dev/null; then
echo " setting grub2 dom0_mem to $DOM0MEM"
tstr="dom0_mem=$DOM0MEM"
sed -i '' -e "s;dom0_mem=[A-Za-z0-9]*;$tstr;" $tgconf
fi
fi
# grub's partition numbering is zero-based.
gpart=`expr $part - 1`
......
......@@ -20,8 +20,8 @@ if [ -r $ETCDIR/bossnode ]; then
else
setboss=0
fi
# DOM0MEM is optional.
DOM0MEM=$SLICEFIX_DOM0MEM
#imageroot="$1"
#real_root_dev="$2"
......@@ -333,6 +333,16 @@ if [ $bootloader = GRUB ] && [ -r $imageroot/$grub_config ]; then
echo "Failed to update root in $grub_config" 1>&2
}
# For XEN, dom0 mem is hardwired on kernel command line.
if [ -n "$DOM0MEM" ]; then
if grep -q 'dom0_mem=' $imageroot/$grub_config 2>/dev/null; then
echo "Setting grub dom0_mem to $DOM0MEM"
tstr="dom0_mem=$DOM0MEM"
sed -i -e "s;dom0_mem=[A-Za-z0-9]*;$tstr;" $imageroot/$grub_config || {
echo "Failed to update dom0mem in $grub_config" 1>&2
}
fi
fi
fi
# Remove swap partitions from fstab
......
#!/bin/sh
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -313,6 +313,7 @@ handle_loadinfo()
local MBR=`get_value "$LOADINFO" MBRVERS`
local PREPARE=`get_value "$LOADINFO" PREPARE`
local PTYPE=''
local DOM0MEM=`get_value "$LOADINFO" DOM0MEM`
#
# XXX check for secure diskloading info.
......@@ -419,6 +420,7 @@ handle_loadinfo()
export SLICEFIX_ACPI=$ACPI
export SLICEFIX_ASF=$ASF
export SLICEFIX_NOCLFLUSH=$NOCLFLUSH
export SLICEFIX_DOM0MEM=$DOM0MEM
$BINDIR/slicefix $PARTITION $FREEBSD_DISK
echo "Image load complete at `date`"
}
......
......@@ -135,6 +135,8 @@ if [ -n "$BIOSDISK" ]; then
;;
esac
fi
# DOM0MEM is optional.
DOM0MEM=$SLICEFIX_DOM0MEM
#
# Find out what our console should be:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment