#!/bin/bash # shellcheck disable=SC2181 disable=SC1091 disable=SC2236 source "${TMPDIR}/androot.source" source "${TMPDIR}/androot.env" log_diag "rootfsinstall is now executing, with arguments \"${*}\"" case "${1}" in "--download") log_diag "Using download mode" log_exec "Downloading bootscripts" cd "${LOCATION}/bootscripts"||{ log_error "cd failed";exit 1; } git clone "${DOWNLOADSERVER_BOOTSCRIPTS}" . &>> "${TMPDIR}/androot.log" if [ ! "${?}" == "0" ]; then log_fail exit 1 fi git checkout develop-bootscripts &>> "${TMPDIR}/androot.log" if [ ! "${?}" == "0" ]; then log_fail exit 1 fi log_ok;; "--configure") log_diag "Using configure mode" log_exec "Configuring bootscript scripts" cd "${LOCATION}/bootscripts/"||{ log_error "cd failed";exit 1; } cat << EOF >> "${LOCATION}/bootscripts/config.env" COMMIT=$(git rev-parse HEAD) LOCATION=${LOCATION} IS_ANDROID=${IS_ANDROID} EOF log_ok;; "--download-qemu") log_diag "Using download qemu mode" ### UNIMPLEMENTED log_exec "Downloading qemu-static binaries" log_fail;; ### UNIMPLEMENTED *) log_error "--download or --decompress required" exit 1;; esac