Skip to content

Commit

Permalink
Update install.sh: only install python3-full for Bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Oct 28, 2023
1 parent 5a44f71 commit 2635f47
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ SUGGESTED_NEW_HOST_NAME="allsky" # Suggested new host name
NEW_HOST_NAME="" # User-specified host name
BRANCH="${GITHUB_MAIN_BRANCH}" # default branch

# Allsky versions
ALLSKY_VERSION="$( get_version )" # version we're installing
# Allsky versions. ${ALLSKY_VERSION} is set in variables.sh
ALLSKY_BASE_VERSION="${ALLSKY_VERSION:0:11}" # without point release
# Base of first version with combined configuration files # TODO: UPDATE xxxx
#xxxxxxx COMBINED_BASE_VERSION="v2023.90.90"
Expand Down Expand Up @@ -383,8 +382,8 @@ check_for_raspistill()
{
STATUS_VARIABLES+=("check_for_raspistill='true'\n")

if W="$( which raspistill )" && [[ ${OS} != "buster" ]]; then
echo display_msg --longonly info "Renaming 'raspistill' on ${OS}."
if W="$( which raspistill )" && [[ ${PI_OS} != "buster" ]]; then
echo display_msg --longonly info "Renaming 'raspistill' on ${PI_OS}."
echo sudo mv "${W}" "${W}-OLD"
fi
}
Expand Down Expand Up @@ -795,7 +794,7 @@ check_success()
MSG="The full log file is in ${LOG}"
MSG="${MSG}\nThe end of the file is:"
display_msg --log info "${MSG}"
tail "${LOG}"
indent "$( tail "${LOG}" )"

return 1
fi
Expand Down Expand Up @@ -2562,11 +2561,11 @@ install_overlay()
# Doing all the python dependencies at once can run /tmp out of space, so do one at a time.
# This also allows us to display progress messages.
M=" for ${OS^}"
R="-${OS}"
if [[ ${OS} == "buster" ]]; then
R="-${PI_OS}"
if [[ ${PI_OS} == "buster" ]]; then
# Force pip upgrade, without this installations on Buster fail
pip3 install --upgrade pip > /dev/null 2>&1
elif [[ ${OS} != "bullseye" && ${OS} != "bookworm" ]]; then
elif [[ ${PI_OS} != "bullseye" && ${PI_OS} != "bookworm" ]]; then
# TODO: is this an error? Unknown OS?
M=""
R=""
Expand All @@ -2587,10 +2586,8 @@ install_overlay()
fi

if [[ -f ${REQUIREMENTS_FILE} ]]; then
display_msg --logonly info "${REQUIREMENTS_FILE} - File found"
break
else
display_msg --logonly info "${REQUIREMENTS_FILE} - File not found"
display_msg --logonly info "Using '${REQUIREMENTS_FILE}'"
break
fi
done

Expand All @@ -2603,16 +2600,18 @@ install_overlay()
${installed_Python_dependencies} == "true" ]]; then
display_msg --logonly info "Skipping: ${NAME} - all packages already installed"
else
local N="python3-full"
display_msg --log progress "Installing ${N} and related packages."
local TMP="${ALLSKY_INSTALLATION_LOGS}/${N}.log"
sudo apt-get --assume-yes install ${N} libgfortran5 libopenblas0-pthread > "${TMP}" 2>&1
check_success $? "${N} install failed" "${TMP}" "${DEBUG}"
[[ $? -ne 0 ]] && exit_with_image 1 "${STATUS_ERROR}" "${N} install failed."

python3 -m venv "${ALLSKY_HOME}/venv"
#shellcheck disable=SC1090,SC1091
source "${ALLSKY_HOME}/venv/bin/activate"
if [[ ${PI_OS} == "bookworm" ]]; then
local PKGs="python3-full libgfortran5 libopenblas0-pthread"
display_msg --log progress "Installing ${PKGs}."
local TMP="${ALLSKY_INSTALLATION_LOGS}/python3-full.log"
sudo apt-get --assume-yes install ${PKGs} > "${TMP}" 2>&1
check_success $? "${PKGs} install failed" "${TMP}" "${DEBUG}"
[[ $? -ne 0 ]] && exit_with_image 1 "${STATUS_ERROR}" "${PKGs} install failed."

python3 -m venv "${ALLSKY_HOME}/venv"
#shellcheck disable=SC1090,SC1091
source "${ALLSKY_HOME}/venv/bin/activate"
fi

local TMP="${ALLSKY_INSTALLATION_LOGS}/${NAME}"
display_msg --log progress "Installing ${NAME}${M}:"
Expand Down Expand Up @@ -2713,20 +2712,21 @@ check_if_buster()
{
STATUS_VARIABLES+=("check_if_buster='true'\n")

if [[ ${OS} == "buster" ]]; then
MSG="${MSG}\nYou are running the older Buster operating system which will"
MSG="${MSG} no longer be supported in the next major Allsky release."
MSG="${MSG}\n\nWe recommend doing a fresh install of Bookworm on a clean SD card."
if [[ ${PRIOR_CAMERA_TYPE} == "RPi" ]]; then
MSG="${MSG}\n\n>>> RPi cameras on Bookworm have more features than on Buster."
fi
MSG="${MSG}\n\nDo you want to continue anyhow?"
if ! whiptail --title "${TITLE}" --yesno --defaultno "${MSG}" 20 "${WT_WIDTH}" 3>&1 1>&2 2>&3; then
display_msg --logonly info "User running Buster and elected not to continue."
exit_installation 0 "${STATUS_NOT_CONTINUE}" "After Buster check."
fi
display_msg --logonly info "User running Buster and elected to continue."
[[ ${PI_OS} != "buster" ]] && return

MSG="${MSG}\nYou are running the older Buster operating system."
MSG="${MSG}\nIt will not be supported in the next major Allsky release."
MSG="${MSG}\nWe recommend doing a fresh install of Bookworm on a clean SD card now."
if [[ ${PRIOR_CAMERA_TYPE} == "RPi" ]]; then
MSG="${MSG}\nRPi cameras have more features on newer operating systems.\n"

fi
MSG="${MSG}\n\nDo you want to continue anyhow?"
if ! whiptail --title "${TITLE}" --yesno --defaultno "${MSG}" 20 "${WT_WIDTH}" 3>&1 1>&2 2>&3; then
display_msg --logonly info "User running Buster and elected not to continue."
exit_installation 0 "${STATUS_NOT_CONTINUE}" "After Buster check."
fi
display_msg --logonly info "User running Buster and elected to continue."
}


Expand Down Expand Up @@ -2915,7 +2915,13 @@ exit_installation()
if [[ ${STATUS_CODE} == "${STATUS_CLEAR}" ]]; then
clear_status
else
[[ -n ${MORE_STATUS} ]] && MORE_STATUS="; MORE_STATUS='${MORE_STATUS}'"
if [[ -n ${MORE_STATUS} ]]; then
if [[ ${MORE_STATUS} == "${STATUS_CODE}" ]]; then
MORE_STATUS=""
else
MORE_STATUS="; MORE_STATUS='${MORE_STATUS}'"
fi
fi
echo -e "STATUS_INSTALLATION='${STATUS_CODE}'${MORE_STATUS}" > "${STATUS_FILE}"
update_status_from_temp_file
echo -e "${STATUS_VARIABLES[@]}" >> "${STATUS_FILE}"
Expand Down Expand Up @@ -3080,7 +3086,7 @@ if [[ -z ${FUNCTION} && -s ${STATUS_FILE} ]]; then
MSG="${MSG}\n\nDo you want to continue where you left off?"
if whiptail --title "${TITLE}" --yesno "${MSG}" 15 "${WT_WIDTH}" 3>&1 1>&2 2>&3; then
MSG="Continuing installation. Steps already performed will be skipped."
MSG="${MSG}\nThe last status was: ${STATUS_INSTALLATION}${MORE_STATUS}"
MSG="${MSG}\n The last status was: ${STATUS_INSTALLATION}${MORE_STATUS}"
display_msg --log progress "${MSG}"

#shellcheck disable=SC1090 # file doesn't exist in GitHub
Expand Down

0 comments on commit 2635f47

Please sign in to comment.