Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickfixes #1020

Merged
merged 12 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.2-e02b7305
1.3.3-pre-299e06ef
5 changes: 5 additions & 0 deletions config/report_templates/F02_toolchain-post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

print_output "The shown toolchain details can help in building a working buildchain for building working binaries and libraries."
print_output "Multiple examples of such a build process are collected in the EMBA wiki"
write_link "https://github.com/e-m-b-a/emba/wiki/Toolchain-identification"
24 changes: 0 additions & 24 deletions emba
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,6 @@ sort_modules()
MODULES=( "${SORTED_MODULES[@]}" )
}

check_quest_container() {
local QUEST_CONTAINER="${1:-}"
print_output "[*] Checking Quest container ${QUEST_CONTAINER} dependencies \\n" "no_log"
# wait for quest container to finish network checks
while [[ "$(docker container inspect -f '{{.State.Running}}' "${QUEST_CONTAINER}")" == "true" ]]; do
if docker logs "${QUEST_CONTAINER}" | grep -q 'Elementary'; then
break
fi
sleep 0.1
done
reset
print_output "[*] Quest container ${QUEST_CONTAINER} dependency checks: \\n" "no_log"
docker logs "${QUEST_CONTAINER}"
print_output "[*] Finished Quest container ${QUEST_CONTAINER} dependency checks \\n" "no_log"
reset
}

# $1: module group letter [P, S, L, F, Q]
# $2: 0=single thread 1=multithread
# $3: HTML=1 - generate html file
Expand Down Expand Up @@ -739,13 +722,6 @@ main() {
export QUEST_CONTAINER="${QUEST_CONTAINER_}"
print_output "[+] $(print_date) - Quest container ${QUEST_CONTAINER_} started and detached.\\n" "no_log"

if [[ "${SILENT}" -eq 0 ]]; then
check_quest_container "${QUEST_CONTAINER}" &
QUEST_PID="$!"
store_kill_pids "${QUEST_PID}"
disown "${QUEST_PID}" 2> /dev/null || true
fi

# EMBA startup:
if [[ "${SILENT}" -eq 0 ]]; then
# EMBA container starts in the foreground and we can see all the logs
Expand Down
24 changes: 13 additions & 11 deletions helpers/helpers_emba_internet_access.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ kernel_downloader() {
done
fi

if ! [[ -d "${LOG_DIR}/s24_kernel_bin_identifier" ]]; then
mkdir "${LOG_DIR}/s24_kernel_bin_identifier"
fi
# now we should have a csv log with a kernel version:
if ! [[ -f "${LOG_FILE_KERNEL}" ]]; then
OUTPUTTER="[-] $(print_date) - No Kernel version identified ..."
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
return
fi
local K_VERSIONS=()
Expand All @@ -52,7 +55,7 @@ kernel_downloader() {
for K_VERSION in "${K_VERSIONS[@]}"; do
OUTPUTTER="[*] $(print_date) - Checking download of kernel version ${ORANGE}${K_VERSION}${NC}"
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
local K_VER_DOWNLOAD=""
local K_VER_1st=""
local K_VER_2nd=""
Expand Down Expand Up @@ -81,20 +84,19 @@ kernel_downloader() {
if ! [[ -f "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz ]] || ! gunzip -t "${KERNEL_ARCH_PATH}/linux-${K_VERSION}.tar.gz" > /dev/null; then
OUTPUTTER="[*] $(print_date) - Kernel download for version ${ORANGE}${K_VERSION}${NC}"
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"

if ! [[ -d "${TMP_DIR}" ]]; then
mkdir "${TMP_DIR}"
fi

disable_strict_mode "${STRICT_MODE}" 0
wget --output-file="${TMP_DIR}"/wget.log https://mirrors.edge.kernel.org/pub/linux/kernel/v"${K_VER_DOWNLOAD}"/linux-"${K_VERSION}".tar.gz -O "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz 2>&1
wget -q --output-file="${TMP_DIR}"/wget.log https://mirrors.edge.kernel.org/pub/linux/kernel/v"${K_VER_DOWNLOAD}"/linux-"${K_VERSION}".tar.gz -O "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz
D_RETURN="$?"
enable_strict_mode "${STRICT_MODE}" 0

if [[ -f "${TMP_DIR}"/wget.log ]]; then
print_ln "no_log"
tee -a "${LOG_DIR}/kernel_downloader.log" < "${TMP_DIR}"/wget.log || true
tee -a "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log" < "${TMP_DIR}"/wget.log || true
rm "${TMP_DIR}"/wget.log
fi
# if we have a non zero return something failed and we need to communicate this to the container modules (s26) which
Expand All @@ -103,7 +105,7 @@ kernel_downloader() {
if [[ ${D_RETURN} -ne 0 ]] ; then
OUTPUTTER="[-] $(print_date) - Kernel download for version ${ORANGE}${K_VERSION}${NC} failed"
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"

echo "failed" > "${TMP_DIR}"/linux_download_failed
if [[ -f "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz ]]; then
Expand All @@ -113,23 +115,23 @@ kernel_downloader() {
else
OUTPUTTER="[*] $(print_date) - Kernel sources of version ${ORANGE}${K_VERSION}${NC} already available"
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
fi

if ! [[ -f "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz ]]; then
OUTPUTTER="[-] $(print_date) - Kernel sources not available ..."
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
continue
fi
if ! file "${KERNEL_ARCH_PATH}"/linux-"${K_VERSION}".tar.gz | grep -q "gzip compressed data"; then
OUTPUTTER="[-] $(print_date) - Kernel sources not available ..."
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
continue
fi
OUTPUTTER="[*] $(print_date) - Kernel source for version ${ORANGE}${K_VERSION}${NC} stored in ${ORANGE}${KERNEL_ARCH_PATH}${NC}"
print_output "${OUTPUTTER}" "no_log"
write_log "${OUTPUTTER}" "${LOG_DIR}/kernel_downloader.log"
write_log "${OUTPUTTER}" "${LOG_DIR}/s24_kernel_bin_identifier/kernel_downloader.log"
done
}
9 changes: 8 additions & 1 deletion helpers/helpers_emba_status_bar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ remove_status_bar() {
if ! [[ -v LINES ]] && [[ -f "${TMP_DIR}""/LINES.log" ]]; then
LINES=$(cat "${TMP_DIR}""/LINES.log")
fi
LINE_POS="$(( LINES - 6 ))"

if [[ -f "${STATUS_TMP_PATH:-}" ]] ; then
sed -i "1s/.*/0/" "${STATUS_TMP_PATH}" 2> /dev/null || true
Expand Down Expand Up @@ -425,8 +424,13 @@ remove_status_bar() {
kill_box_pid "${PID_STATUS_2}" &
fi

if ! [[ -v LINES ]] ; then
return
fi

sleep 1
local RM_STR=""
LINE_POS="$(( LINES - 6 ))"
RM_STR="\e[""${LINE_POS}"";1f\e[0J\e[;r\e[""${LINE_POS}"";1f"
printf "%b" "${RM_STR}"
}
Expand Down Expand Up @@ -511,6 +515,9 @@ initial_status_bar() {
shopt -s checkwinsize
# echo "LINES: $LINES" >> "${TMP_DIR}"/shopts.log
# echo "COLUMNS: $COLUMNS" >> "${TMP_DIR}"/shopts.log
if ! [[ -v LINES ]] ; then
return
fi
local LINE_POS="$(( LINES - 6 ))"
printf "\e[%s;1f\e[0J\e[%s;1f" "${LINE_POS}" "${LINE_POS}"
echo "${LINES}" > "${TMP_DIR}""/LINES.log"
Expand Down
2 changes: 1 addition & 1 deletion modules/F02_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ F02_toolchain() {
fi

COMPILE_FILE_NAME=$(basename "${COMPILE_FILE}")
mapfile -t COMPILE_FILE_NAME_GCC_DATE_ARR < <(grep "${COMPILE_FILE_NAME}" "${CONFIG_DIR}"/gcc_libstdc_details.csv | sort -u || true)
mapfile -t COMPILE_FILE_NAME_GCC_DATE_ARR < <(grep ";${COMPILE_FILE_NAME};" "${CONFIG_DIR}"/gcc_libstdc_details.csv | sort -u || true)
for COMPILE_FILE_NAME_GCC_DATE in "${COMPILE_FILE_NAME_GCC_DATE_ARR[@]}"; do
GCC_VERSION=$(echo "${COMPILE_FILE_NAME_GCC_DATE}" | cut -d\; -f1 || true)
GCC_RELEASE_DATE=$(echo "${COMPILE_FILE_NAME_GCC_DATE}" | cut -d\; -f3 || true)
Expand Down