2015-07-07 08:16:29 -04:00
|
|
|
function chroot_wrapper () {
|
2015-07-15 03:26:34 -04:00
|
|
|
|
|
|
|
FUNCNAME="chroot_wrapper"
|
|
|
|
|
2015-07-07 08:16:29 -04:00
|
|
|
local ARCHSUFFIX="${1}"
|
|
|
|
if [[ "${1}" == "64" ]];
|
|
|
|
then
|
|
|
|
local CHROOTDIR="${CHROOTDIR}root.x86_64"
|
|
|
|
local BUILDDIR="${BUILDDIR}64"
|
|
|
|
elif [[ "${1}" == "32" ]];
|
|
|
|
then
|
|
|
|
local CHROOTDIR="${CHROOTDIR}root.i686"
|
|
|
|
local BUILDDIR="${BUILDDIR}32"
|
|
|
|
else
|
|
|
|
echo "WHOOPS. We hit an error that makes no logical sense."
|
|
|
|
echo 'Dying.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "/usr/bin/systemd-nspawn" ];
|
|
|
|
then
|
|
|
|
CHROOTCMD="systemd-nspawn -D ${CHROOTDIR}"
|
|
|
|
else
|
|
|
|
CHROOTCMD="facehugger ${ARCHSUFFIX}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "NOW ENTERING ${CHROOTDIR}...."
|
|
|
|
echo "_____________________________"
|
|
|
|
${CHROOTCMD}
|
|
|
|
CHROOTDIR="${CHROOTDIR_GLOB}"
|
|
|
|
BUILDDIR="${BUILDDIR_GLOB}"
|
|
|
|
}
|