#!/bin/sh
-# Just a script to run the handful of commands required for a
-# bootable domU image. This is mostly to document the commands
-# required, and is not pretending to be fancy.
-
-STDJ='-j4'
-RUMPSRC=rumpsrc
-
-while getopts '?qs:' opt; do
- case "$opt" in
- 's')
- RUMPSRC=${OPTARG}
- ;;
- 'q')
- BUILDXEN_QUIET=${BUILDXEN_QUIET:=-}q
- ;;
- '?')
- exit 1
- esac
-done
-shift $((${OPTIND} - 1))
-
-# the buildxen.sh is not as forgiving as I am
-set -e
-
-[ ! -f ./buildrump.sh/subr.sh ] && git submodule update --init buildrump.sh
-. ./buildrump.sh/subr.sh
-
-if git submodule status ${RUMPSRC} | grep -q '^-' ; then
- git submodule update --init --recursive ${RUMPSRC}
-fi
-[ "$1" = "justcheckout" ] && { echo ">> $0 done" ; exit 0; }
-
-# build tools
-./buildrump.sh/buildrump.sh ${BUILDXEN_QUIET} ${STDJ} -k \
- -V MKPIC=no -s ${RUMPSRC} -T rumptools -o rumpobj -N \
- -V RUMP_KERNEL_IS_LIBC=1 "$@" tools
-
-# set some special variables.
-cat >> rumptools/mk.conf << EOF
-# maxphys = 32k is a Xen limitation (64k - overhead)
+IFS=' '
+BUILDXENMETAL_MKCONF="# maxphys = 32k is a Xen limitation (64k - overhead)
CPPFLAGS+=-DMAXPHYS=32768
-.if defined(LIB) && \${LIB} == "pthread"
+.if defined(LIB) && \${LIB} == \"pthread\"
.PATH: $(pwd)
PTHREAD_MAKELWP=pthread_makelwp_rumprunxen.c
CPPFLAGS+= -D_PTHREAD_GETTCB_EXT=_lwp_rumpxen_gettcb
-.endif # LIB == pthread
-EOF
-
-RUMPMAKE=$(pwd)/rumptools/rumpmake
-MACHINE=$(${RUMPMAKE} -f /dev/null -V '${MACHINE}')
-[ -z "${MACHINE}" ] && die could not figure out target machine
-
-# build rump kernel
-./buildrump.sh/buildrump.sh ${BUILDXEN_QUIET} ${STDJ} -k \
- -V MKPIC=no -s ${RUMPSRC} -T rumptools -o rumpobj -N \
- -V RUMP_KERNEL_IS_LIBC=1 "$@" build kernelheaders install
+.endif # LIB == pthread"
+unset IFS
-LIBS="$(stdlibs ${RUMPSRC})"
-usermtree rump
-userincludes ${RUMPSRC} ${LIBS}
+export BUILDXENMETAL_MKCONF
+export BUILDXENMETAL_PCI_P=true
-for lib in ${LIBS}; do
- makeuserlib ${lib}
-done
-
-makepci ${RUMPSRC}
+[ ! -f ./buildrump.sh/subr.sh ] && git submodule update --init buildrump.sh
+. ./buildrump.sh/subr.sh
+./buildrump.sh/xenbaremetal.sh "$@" || die xenbaremetal.sh failed
+RUMPMAKE="$(pwd)/rumptools/rumpmake"
makekernlib ()
{
lib=$1