From da7d5cdd4e7494e52b6b960597e4ea7d8c94c20c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 03:57:36 -0700 Subject: [PATCH 1/5] VARA Downloader - Added pup command for HTML procesing --- scripts/install-pup.sh | 39 +++++++++++++++++++++++++++++++++++++++ scripts/install.sh | 3 ++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 scripts/install-pup.sh diff --git a/scripts/install-pup.sh b/scripts/install-pup.sh new file mode 100755 index 0000000..32a1352 --- /dev/null +++ b/scripts/install-pup.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 28 February 2025 +# Purpose : Install pup (HTML processing) + +VERSION="0.4.0" +ZIP_FILE="pup_v${VERSION}_linux_amd64.zip" +INSTALL_DIR="/opt/pup-${VERSION}" +INSTALL_DIR_BIN="${INSTALL_DIR}/bin" +LINK_PATH="/opt/pup" + +et-log "Installing pup (HTML processing tool)..." + +URL="https://github.com/ericchiang/pup/releases/download/v${VERSION}/${ZIP_FILE}" + +et-log "Downloading pup: ${URL}" +curl -s -f -L -o ${ZIP_FILE} ${URL} + +[[ $? -ne 0 ]] && et-log "Error fetching pup" && exit 1 + +mv -v ${ZIP_FILE} ${ET_DIST_DIR} + +CWD_DIR=$(pwd) + +if [[ ! -e "${INSTALL_DIR}" ]]; then + mkdir -v -p ${INSTALL_DIR_BIN} && cd ${INSTALL_DIR_BIN} + unzip ${ET_DIST_DIR}/${ZIP_FILE} +else + et-log "${INSTALL_DIR} already exists." +fi + +chmod 755 ${INSTALL_DIR_BIN}/pup + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt pup -t /usr/local + +cd ${CWD_DIR} diff --git a/scripts/install.sh b/scripts/install.sh index 11c2da8..ece608b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 20 January 2025 +# Updated : 28 February 2025 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -15,6 +15,7 @@ exitIfNotRoot ./install-base.sh ./install-dev-tools.sh +./install-pup.sh ./install-browser.sh ./remove-packages.sh ./install-branding.sh From a127fe7c10fbc41273430196ffe5355f30f44136 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 04:00:58 -0700 Subject: [PATCH 2/5] VARA Downloader - Added test for pup installation --- tests/test-pup.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 tests/test-pup.sh diff --git a/tests/test-pup.sh b/tests/test-pup.sh new file mode 100755 index 0000000..3826c1b --- /dev/null +++ b/tests/test-pup.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 28 February 2025 +# Purpose : Test pup installation + +OUT=$(which pup) +exit $? From 9f21077793a4991fa95dd447c38225d9482429ba Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 04:35:43 -0700 Subject: [PATCH 3/5] VARA Downloader - Added support for a VARA helper script to dynamically find and download VARA applications. (Why do Windows users like spaces in filenames? --- .../etc/skel/add-ons/wine/vara-downloader.sh | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 overlay/etc/skel/add-ons/wine/vara-downloader.sh diff --git a/overlay/etc/skel/add-ons/wine/vara-downloader.sh b/overlay/etc/skel/add-ons/wine/vara-downloader.sh new file mode 100755 index 0000000..9da1221 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/vara-downloader.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 28 February 2025 +# Purpose : Download utility for VARA applications + +BASE_HTML_FILE="vara-index.html" + +cleanup() { + [[ -f "$BASE_HTML_FILE" ]] && rm "${BASE_HTML_FILE}" +} + +trap cleanup EXIT + +function usage() { + echo "Usage: $(basename $0) " + echo " pattern - VARA filename substring pattern to match on" +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +FILENAME_PATTERN="$1" +BASE_URL="https://downloads.winlink.org" +INDEX_URL="${BASE_URL}/VARA%20Products/" + +# 1. Fetch main VARA download page as HTML +curl -s -f -L -o ${BASE_HTML_FILE} ${INDEX_URL} +[[ $? -ne 0 ]] && et-log "Error fetching VARA index page: ${BASE_URL}" && exit 1 + +# 2. Extract all links from index page +VARA_FILE_PATH=$(cat ${BASE_HTML_FILE} | pup 'a attr{href}' | grep "${FILENAME_PATTERN}") +[[ $? -ne 0 ]] && et-log "Error finding VARA file matching specified pattern" && exit 1 + + +#3. Check for multiple matches +if [[ "${VARA_FILE_PATH}" =~ [[:space:]] ]]; then + echo -e "\n${VARA_FILE_PATH}\n" + et-log "Multiple files matched. Try again with a more specific pattern." + exit 1 +fi + +FULL_URL="${BASE_URL}${VARA_FILE_PATH}" +et-log "Found ${VARA_FILE_PATH}" +et-log "Downloading: ${FULL_URL}" + +curl -s -f -L -O "${FULL_URL}" +exit $? From 4ffa8b82314590334826a8a9dea378e97584542b Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 05:04:49 -0700 Subject: [PATCH 4/5] VARA Downloader - Updated VARA HF and FM install scripts to use a more robust application download method --- .../skel/add-ons/wine/02-install-vara-hf.sh | 21 +++++------------- .../skel/add-ons/wine/03-install-vara-fm.sh | 22 +++++-------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh index 7592ddc..2b90f1c 100755 --- a/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh +++ b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh @@ -2,28 +2,19 @@ # # Author : Gaston Gonzalez # Date : 20 January 2025 -# Updated : 1 February 2025 +# Updated : 28 February 2025 # Purpose : Install VARA HF -set -e source ./common-checks.sh -VERSION="4.8.9" -DOWNLOAD_FILE="vara-hf-${VERSION}.zip" -URL="https://downloads.winlink.org/VARA%20Products/VARA%20HF%20v${VERSION}%20setup.zip" VARA_HOME="${HOME}/.wine32/drive_c/VARA" +VARA_PATTERN="VARA%20HF" -et-log "Installing VARA HF..." +./vara-downloader.sh "${VARA_PATTERN}" +[[ $? -ne 0 ]] && et-log "Error downloading VARA HF" && exit 1 -if [ ! -e ${DOWNLOAD_FILE} ]; then - et-log "Downloading VARA HF ${version} from ${URL}" - curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" -fi - -if [ $? -ne 0 ]; then - et-log "Error downloading VARA HF ${VERSION}." - exit 1 -fi +DOWNLOAD_FILE=$(ls *.zip | grep "${VARA_PATTERN}") +[[ ! -e "${DOWNLOAD_FILE}" ]] && et-log "VARA download file not found" && exit 1 unzip -o ${DOWNLOAD_FILE} diff --git a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh index f2d2598..7fb6da1 100755 --- a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh +++ b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh @@ -2,28 +2,18 @@ # # Author : Gaston Gonzalez # Date : 20 January 2025 -# Updated : 1 February 2025 +# Updated : 28 February 2025 # Purpose : Install VARA FM -set -e source ./common-checks.sh -VERSION="4.3.8" -DOWNLOAD_FILE="vara-fm-${VERSION}.zip" -URL="https://downloads.winlink.org/VARA%20Products/VARA%20FM%20v${VERSION}%20setup.zip" -VARA_HOME="${HOME}/.wine32/drive_c/VARA FM" +VARA_PATTERN="VARA%20FM" -et-log "Installing VARA FM..." +./vara-downloader.sh "${VARA_PATTERN}" +[[ $? -ne 0 ]] && et-log "Error downloading VARA FM" && exit 1 -if [ ! -e ${DOWNLOAD_FILE} ]; then - et-log "Downloading VARA FM ${version} from ${URL}" - curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" -fi - -if [ $? -ne 0 ]; then - et-log "Error downloading VARA FM ${VERSION}." - exit 1 -fi +DOWNLOAD_FILE=$(ls *.zip | grep "${VARA_PATTERN}") +[[ ! -e "${DOWNLOAD_FILE}" ]] && et-log "VARA download file not found" && exit 1 unzip -o ${DOWNLOAD_FILE} From 8ce4e53107a6b267dd4650adb4084b3af62ec514 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 05:15:24 -0700 Subject: [PATCH 5/5] VARA - Updated README with details on how to include a full VARA/WINE installation as part of a future image build --- overlay/etc/skel/add-ons/wine/README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/overlay/etc/skel/add-ons/wine/README.md b/overlay/etc/skel/add-ons/wine/README.md index 44fc311..7c20086 100644 --- a/overlay/etc/skel/add-ons/wine/README.md +++ b/overlay/etc/skel/add-ons/wine/README.md @@ -17,7 +17,7 @@ in this directory as your normal user (do not use 'sudo'). ./03-install-vara-fm.sh -4. Run the registery editor. Follow the instructions in the terminal. In +4. Run the registry editor. Follow the instructions in the terminal. In this step we will need to map COM port 10 (COM10) to the EmComm Tools CAT control device (/dev/et-cat). @@ -31,3 +31,25 @@ in this directory as your normal user (do not use 'sudo'). It is important that you do not run any of the VARA programs until after the backup is run in step 5. + +## Including VARA in an ETC ISO image + +If you want to include VARA in a future EmComm Tools Community image build, +perform the following in Cubic after the main install script is finished. + +1. Change into the `/etc/skel` directory. + +2. Copy the WINE backup file created in step 5 using the file copy option + in Cubic (i.e. `etc-wine-backup-HOST-YYYYMMDD.tar.gz`). + +3. Unpack the backup file. This will create `/etc/skel/.wine32`. + +``` +tar -xzf etc-wine-backup-* +``` + +4. Delete the backup file on the Cubic session to save on space. + +``` +rm etc-wine-backup-* +```