From e2e0be97aba6c179a338dca77b0e2fcc43eed8dc Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sat, 22 Jun 2019 00:07:40 -0400 Subject: [PATCH 1/4] Save hardwaretype in preferences.json Store hardwaretype so that it can be used elsewhere. --- bin/oref0-setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 3d304ce90..8876a46c9 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -807,6 +807,7 @@ if prompt_yn "" N; then set_pref_string .myopenaps_path "$directory" set_pref_string .pump_serial "$serial" set_pref_string .radio_locale "$radio_locale" + set_pref_string .hardwaretype "$hardwaretype" if [[ ! -z "$BT_PEB" ]]; then set_pref_string .bt_peb "$BT_PEB" fi From 3566e7b6c10517cefa853310e719c5a408bee85f Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 24 Jun 2019 11:37:08 -0400 Subject: [PATCH 2/4] Install node v8 Make sure nodesource repo is used to install nodejs and npm. --- bin/oref0-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 8876a46c9..684d55e62 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -684,11 +684,11 @@ if prompt_yn "" N; then # install/upgrade to latest node 8 if neither node 8 nor node 10+ LTS are installed if ! nodejs --version | grep -e 'v8\.' -e 'v1[02468]\.' ; then - echo Upgrading to node 8 + echo Installing node 8 # Use nodesource setup script to add nodesource repository to sources.list.d sudo bash -c "curl -sL https://deb.nodesource.com/setup_8.x | bash -" || die "Couldn't setup node 8" # Install nodejs and npm from nodesource - sudo apt-get install -y nodejs || die "Couldn't install nodejs" + sudo apt-get install -y nodejs=8.* || die "Couldn't install nodejs" fi # Attempting to remove git to make install --nogit by default for existing users From 1ff036788126b954ab618ee679e4ec09ff1de672 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 24 Jun 2019 13:38:13 -0400 Subject: [PATCH 3/4] Install node v8 Make sure nodesource repo is used to install nodejs and npm, except on armv6... --- bin/openaps-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/openaps-packages.sh b/bin/openaps-packages.sh index 5e4d89500..f605d56c8 100755 --- a/bin/openaps-packages.sh +++ b/bin/openaps-packages.sh @@ -24,7 +24,7 @@ if ! nodejs --version | grep -e 'v8\.' -e 'v1[02468]\.' &> /dev/null ; then # nodesource doesn't support armv6 if ! arch | grep -e 'armv6' &> /dev/null ; then sudo bash -c "curl -sL https://deb.nodesource.com/setup_8.x | bash -" || die "Couldn't setup node 8" - sudo apt-get install -y nodejs || die "Couldn't install nodejs" + sudo apt-get install -y nodejs=8.* || die "Couldn't install nodejs" else sudo apt-get install -y nodejs npm || die "Couldn't install nodejs and npm" npm install npm@latest -g || die "Couldn't update npm" From 744cd701b08730204f403e91df5e38f935261023 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 24 Jun 2019 16:55:50 -0400 Subject: [PATCH 4/4] Switch Radiofruit openaps-menu back to main repo --- bin/oref0-setup.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 684d55e62..12a3e4eeb 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -1259,18 +1259,14 @@ if prompt_yn "" N; then echo "Make and install pi-buttons..." cd pi-buttons cd src && make && sudo make install && sudo make install_service + # Radiofruit buttons are on different GPIOs than the Explorer HAT if [[ "$hardwaretype" =~ "radiofruit" ]]; then sed -i 's/17,27/5,6/g' /etc/pi-buttons.conf fi systemctl enable pi-buttons && systemctl restart pi-buttons echo "Installing openaps-menu..." - if [[ "$hardwaretype" =~ "radiofruit" ]]; then - #Once we have a radiofruit branch in openaps-menu, we can change the repo... - cd $HOME/src && git clone git://github.com/cluckj/openaps-menu.git && git checkout radiofruit || (cd openaps-menu && git checkout radiofruit && git pull) - else - cd $HOME/src && git clone git://github.com/openaps/openaps-menu.git || (cd openaps-menu && git checkout master && git pull) - fi - cd $HOME/src/openaps-menu && sudo npm install + cd $HOME/src && git clone git://github.com/openaps/openaps-menu.git || (cd openaps-menu && git checkout master && git pull) + cd $HOME/src/openaps-menu && sudo npm install cp $HOME/src/openaps-menu/openaps-menu.service /etc/systemd/system/ && systemctl enable openaps-menu fi