Run
vnamespace --new -- vcontext --create --xid 5 -- vattribute --set --flag fakeinit -- vcontext --migrate-self --initpid -- /sbin/init
/vserver/sbin/vnamespace --new -- \
/vserver/sbin/vspace --new -- \
/vserver/sbin/vcontext --create --xid 5 -- \
\
/vserver/sbin/vnamespace --set -- \
/vserver/sbin/vspace --set -- \
\
/vserver/sbin/vattribute --set --flag fakeinit -- \
/vserver/sbin/vcontext --migrate-self --endsetup -- \
/bin/bash
/vserver/sbin/vnamespace --new --
/usr/bin/nice -n 0 --
/vserver/sbin/chbind --silent --secure --nid 40000 --
/vserver/lib/util-vserver/exec-ulimit /vserver/etc/vservers/s1/ulimits --
/vserver/sbin/vtag --create --tag 40000 --silent --
/vserver/sbin/vspace --new --
/vserver/sbin/vcontext --create --silent --xid 40000 --
/vserver/sbin/vnamespace --set --
/vserver/sbin/vspace --set --
/vserver/sbin/vlimit --dir /vserver/etc/vservers/s1/rlimits --missingok --
/vserver/sbin/vsched --xid self --force --
/vserver/lib/util-vserver/vsysctl --xid self --dir /vserver/etc/vservers/s1/sysctl --missingok --
/vserver/sbin/vuname --xid self --dir /vserver/etc/vservers/s1/uts --missingok --
/vserver/sbin/vmemctrl --xid self --set --
/vserver/sbin/vuname --xid self --set -t context=/vserver/etc/vservers/s1 --
/vserver/sbin/vattribute --set --secure --flag default --flag fakeinit --
/vserver/lib/util-vserver/save_ctxinfo /vserver/etc/vservers/s1
/usr/bin/env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin PREVLEVEL=N RUNLEVEL=3
/vserver/sbin/vcontext --migrate-self --endsetup --chroot --silent --
/sbin/init
Build
(
set -x -e -u -o pipefail || exit 1
bundle_version=0.30.215
bundle_url="http://ftp.linux-vserver.org/pub/utils/util-vserver/util-vserver-${bundle_version}.tar.bz2"
bundle_tar_bz2_path="/tmp/util-vserver-${bundle_version}.tar.bz2"
bundle_path="/tmp/util-vserver-${bundle_version}"
test -e "${bundle_path}" || {
test -e "${bundle_tar_bz2_path}" || curl -o "${bundle_tar_bz2_path}" -\# "${bundle_url}"
tar -xjf "${bundle_tar_bz2_path}" -C "/tmp"
find "${bundle_path}" -type f -executable -exec chmod 555 {} \;
find "${bundle_path}" -type f ! -executable -exec chmod 444 {} \;
find "${bundle_path}" -type d -exec chmod 555 {} \;
}
uuid="$( uuidgen )"
workbench="/tmp/util-vserver-${uuid}.workbench"
log="/tmp/util-vserver-${uuid}.log"
outputs="/tmp/util-vserver-${uuid}.outputs"
configure_options=(
--prefix="/vserver"
--datarootdir="/vserver"
--docdir="/vserver/doc"
--enable-apis=v13,net,v21,v22,v23,netv2
--enable-release
--enable-dietlibc
--enable-shared
--enable-static
--enable-internal-headers
--enable-extra-optimizations
--enable-expensive-tests
--with-initscripts=sysv
--with-vrootdir="/vserver/roots"
--with-crypto-api=none
)
mkdir "${workbench}"
mkdir "${outputs}"
cp -l -a -R -T "${bundle_path}" "${workbench}/src"
find "${workbench}/src" -type d -exec chmod 755 {} \;
outcome='succeeded???'
(
exec 2>&1
export PATH="/opt/diet/bin:${PATH}"
cd "${workbench}/src"
set -x
./configure "${configure_options[@]}" || exit 1
nice -n 19 -- make -j 16 || exit 1
nice -n 19 -- make install DESTDIR="${outputs}" || exit 1
set +x
mkdir "${outputs}/vserver-bin"
find ./src -maxdepth 1 -type f -executable -exec cp {} "${outputs}/vserver-bin" \;
) | tee "${log}" || outcome=failed
rm -Rf "${workbench}"
echo
echo
echo "========================================"
echo "Outcome: ${outcome}"
echo "Outputs: ${outputs}"
echo "Log: ${log}"
)