Dyad/make.project/enter_chroot.sh

36 lines
754 B
Bash
Raw Normal View History

#!/bin/bash
APPNAME="CHROOT VFS SETUP"
T_SYSROOT=${dir_sysroot}
assert_zero() {
if [[ "$1" -eq 0 ]]; then
return
else
exit $1
fi
}
# ISO 8601 variation
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
LOG_DIR="${dir_logs}/${APPNAME}-${TIMESTAMP}"
# the file to log to
LOGFILE="${APPNAME}.log"
logprint() {
mkdir -p "${LOG_DIR}"
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
| tee -a "${LOG_DIR}/${LOGFILE}"
}
2023-03-06 03:06:57 +00:00
# TODO chroot ignores this, and it breaks binutils pass 3
2023-03-05 12:07:03 +00:00
ulimit -n 3000000
/usr/sbin/chroot "${T_SYSROOT}" /usr/bin/env -i \
HOME=/root \
2023-04-02 06:34:59 +00:00
TERM="xterm-256color" \
PS1='\n(dark horse linux) [ \u @ \H ] << \w >>\n\n[- ' \
PATH=/usr/bin:/usr/sbin \
/bin/bash --login
exit $?