umount $BASEDIR/build/tmp 2>/dev/null;
}
-now() {
- date -u "+%s"
-}
-
format_runtime() {
local seconds=${1}
esac
# Setup ccache cache size
- enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}" >/dev/null
+ enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}"
}
enterchroot() {
wait_until_finished() {
local pid=${1}
- local start_time=$(now)
+ local start_time="${SECONDS}"
# Show progress
if ${INTERACTIVE}; then
local runtime
while kill -0 ${pid} 2>/dev/null; do
- print_runtime $(( $(now) - ${start_time} ))
+ print_runtime $(( SECONDS - start_time ))
# Wait a little
sleep 1
local ret=$?
if ! ${INTERACTIVE}; then
- print_runtime $(( $(now) - ${start_time} ))
+ print_runtime $(( SECONDS - start_time ))
fi
return ${ret}
}
qemu_environ() {
- local env
+ local env="QEMU_TARGET_HELPER=${QEMU_TARGET_HELPER}"
# Don't add anything if qemu is not used.
if ! qemu_is_required; then
arm*)
QEMU_CPU="${QEMU_CPU:-cortex-a9}"
+ env="${env} QEMU_CPU=${QEMU_CPU}"
+ ;;
+ riscv64)
+ QEMU_CPU="${QEMU_CPU:-sifive-u54}"
+
env="${env} QEMU_CPU=${QEMU_CPU}"
;;
esac
file_is_static() {
local file="${1}"
- file ${file} 2>/dev/null | grep -q "statically linked"
+ file -L "${file}" 2>/dev/null | grep -q "statically linked"
}
update_language_list() {
lfsmake2 python3-pytz
lfsmake2 python3-click
lfsmake2 python3-arrow
+ lfsmake2 python3-terminaltables
lfsmake2 aws-cli
lfsmake2 oci-python-sdk
lfsmake2 oci-cli
# See what we're supposed to do
case "$1" in
build)
- START_TIME=$(now)
+ START_TIME="${SECONDS}"
# Clear screen
${INTERACTIVE} && clear
tools/checkrootfiles
cd $PWD
- print_build_summary $(( $(now) - ${START_TIME} ))
+ print_build_summary $(( SECONDS - START_TIME ))
;;
shell)
# enter a shell inside LFS chroot