Skip to content

Commit

Permalink
updated setup script to use optionsSet (no functional changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Jan 11, 2024
1 parent 46d6d4f commit 516a448
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 50 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/latest-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add latest tag to new release
on:
release:
types: [published]
workflow_dispatch:

jobs:
run:
name: Run local action
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Run latest-tag
uses: EndBug/latest-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.8:
updated setup script to use optionsSet (no functional changes)
newOptionsSet was needed to cover a transition which has long since past

v3.7:
fixed: selecting uninstall (u) doesn't work
correct manual install instructions in ReadMe
Expand Down
Empty file added optionsRequired
Empty file.
92 changes: 44 additions & 48 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ source "/data/SetupHelper/CommonResources"

#### end of lines to include SetupHelper

# if this is a install without user interaction, exit if new options not present
if [ $scriptAction == 'INSTALL' ] && [ ! -f "$setupOptionsDir/newOptionsSet" ]; then
logMessage "Error: new configs not present - can't allow reinstall"
logMessage "must run setup script from command line and configure ports"
exit $EXIT_OPTIONS_NOT_SET
fi


deviceVendorId=""
deviceModelId=""
deviceSerialNumber=""
Expand All @@ -65,9 +57,6 @@ configsDir="$setupOptionsDir"
hatConfig="$configsDir/hat.config"


#### skip to ######## script code begins here ########


# reports USB device info
#
# if at least one pareameter is passed, user is prompted to select each
Expand Down Expand Up @@ -1058,46 +1047,53 @@ updatePortCounts ()
fi
}


######## script code begins here ########

# setup enviroment
if [ -f /etc/venus/machine ]; then
# if not set by CommonResources, attempt to get platform here
# this is here for backward compatiblity with SetupHelper prior fo v5.17
# because $machine was only set if a raspberryPi only flag was set for the package
# v5.17 always sets it now
if [ -z $machine ] && [ -f /etc/venus/machine ]; then
machine=$(cat /etc/venus/machine)
case $machine in
raspberrypi*)
builtInPorts=0
hatsOk=true
gxDevice="Raspberry PI"
;;
einstein)
builtInPorts=2
hatsOk=false
gxDevice="Cerbo GX"
;;
cerbosgx)
builtInPorts=1
hatsOk=false
gxDevice="Cerbo GX S"
;;
beaglebone)
builtInPorts=2
hatsOk=false
gxDevice="Venus GX"
;;
ccgx)
builtInPorts=1
hatsOk=false
gxDevice="CCGX"
;;
*)
logMessage "unsupported Venus device type $machine - exiting"
exit $EXIT_INCOMPATIBLE_PLATFOM
;;
esac
else
logMessage "can't determine Venus device type - exiting"
exit $EXIT_INCOMPATIBLE_PLATFOM
fi
# setup enviroment ($machine set in CommonResources)
case $machine in
raspberrypi*)
builtInPorts=0
hatsOk=true
gxDevice="Raspberry PI"
;;
einstein)
builtInPorts=2
hatsOk=false
gxDevice="Cerbo GX"
;;
ekrano)
builtInPorts=2
hatsOk=false
gxDevice="Ekrano GX"
;;
cerbosgx)
builtInPorts=1
hatsOk=false
gxDevice="Cerbo GX S"
;;
beaglebone)
builtInPorts=2
hatsOk=false
gxDevice="Venus GX"
;;
ccgx)
builtInPorts=1
hatsOk=false
gxDevice="CCGX"
;;
*)
logMessage "unsupported platform $machine - exiting"
exit $EXIT_INCOMPATIBLE_PLATFOM
;;
esac

if [ $scriptAction == 'NONE' ] || [ $scriptAction == 'INSTALL' ] ; then
# number of ports is 2 prior to v2.90~18
Expand Down Expand Up @@ -1266,7 +1262,6 @@ if [ $scriptAction == 'NONE' ] ; then
fi
fi
if $changes ; then
touch "$setupOptionsDir/newOptionsSet"
scriptAction='INSTALL'
else
scriptAction='EXIT'
Expand Down Expand Up @@ -1297,6 +1292,7 @@ fi


# handle quit command after reporting status
# not in CommonResources until SetupHelper v6.0
if [ $scriptAction == 'EXIT' ] ; then
exit $EXIT_SUCCESS
fi
Expand Down
1 change: 0 additions & 1 deletion timeStamp

This file was deleted.

2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.7
v3.8

0 comments on commit 516a448

Please sign in to comment.