From 2ce4acb9efd335db4eae8e774bfa7dcbb0f19b04 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sat, 30 Mar 2019 22:48:34 -0400 Subject: [PATCH 1/9] Workarounds for Jubilinux v0.2.0 (Debian Jessie) --- bin/openaps-install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/openaps-install.sh b/bin/openaps-install.sh index e813fc731..fba177110 100755 --- a/bin/openaps-install.sh +++ b/bin/openaps-install.sh @@ -25,6 +25,16 @@ grep "PermitRootLogin yes" /etc/ssh/sshd_config || echo "PermitRootLogin yes" > # set timezone dpkg-reconfigure tzdata +#Workarounds for Jubilinux v0.2.0 (Debian Jessie) migration to LTS +if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then + #Disable validity check for archived Debian repos + echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid + #Replace apt sources.list with new archive.debian.org locations + echo -e "deb http://security.debian.org/ jessie/updates main\n#deb-src http://security.debian.org/ jessie/updates main\n\ndeb http://archive.debian.org/debian/ jessie-backports main\n#deb-src http://archive.debian.org/debian/ jessie-backports main\n\ndeb http://archive.debian.org/debian/ jessie main contrib non-free\n#deb-src http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list + #Use nodesource setup script to Add nodesource repository to sources.list.d + curl -sL https://deb.nodesource.com/setup_8.x | bash - +fi + #dpkg -P nodejs nodejs-dev # TODO: remove the `-o Acquire::ForceIPv4=true` once Debian's mirrors work reliably over IPv6 apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true -y dist-upgrade && apt-get -o Acquire::ForceIPv4=true -y autoremove From edc94de7bcf5997d10304bfa4e493b758a4a29e9 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sat, 30 Mar 2019 22:49:40 -0400 Subject: [PATCH 2/9] Workarounds for Jubilinux v0.2.0 (Debian Jessie) --- bin/openaps-packages.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/openaps-packages.sh b/bin/openaps-packages.sh index a15ee53e2..575fc3f5f 100755 --- a/bin/openaps-packages.sh +++ b/bin/openaps-packages.sh @@ -3,8 +3,7 @@ # TODO: remove the `-o Acquire::ForceIPv4=true` once Debian's mirrors work reliably over IPv6 apt-get -o Acquire::ForceIPv4=true install -y sudo sudo apt-get -o Acquire::ForceIPv4=true update && sudo apt-get -o Acquire::ForceIPv4=true -y upgrade -sudo apt-get -o Acquire::ForceIPv4=true install -y git python python-dev software-properties-common python-numpy python-pip npm watchdog strace tcpdump screen acpid vim locate jq lm-sensors && \ -if getent passwd edison > /dev/null; then sudo apt-get -o Acquire::ForceIPv4=true install -y nodejs-legacy; fi && \ +sudo apt-get -o Acquire::ForceIPv4=true install -y git python python-dev software-properties-common python-numpy python-pip nodejs watchdog strace tcpdump screen acpid vim locate jq lm-sensors && \ sudo pip install -U openaps && \ sudo pip install -U openaps-contrib && \ sudo openaps-install-udev-rules && \ From cc5e7b1a42ffbd2217df4d4b255d471f0df38eb2 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sat, 30 Mar 2019 22:55:48 -0400 Subject: [PATCH 3/9] Workarounds for Jubilinux v0.2.0 (Debian Jessie) In case someone on Jubilinux 0.2.0 is re-running `oref0-setup.sh` (without running `openaps-install.sh`), make sure that their rigs are pointed to the correct repos. --- bin/oref0-setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 5f214e903..86629d85e 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -480,6 +480,18 @@ echocolor-n "Continue? y/[N] " read -r if [[ $REPLY =~ ^[Yy]$ ]]; then + # Workarounds for Jubilinux v0.2.0 (Debian Jessie) migration to LTS + if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then + # Disable validity check for archived Debian repos + echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid + # Replace apt sources.list with new archive.debian.org locations + echo -e "deb http://security.debian.org/ jessie/updates main\n#deb-src http://security.debian.org/ jessie/updates main\n\ndeb http://archive.debian.org/debian/ jessie-backports main\n#deb-src http://archive.debian.org/debian/ jessie-backports main\n\ndeb http://archive.debian.org/debian/ jessie main contrib non-free\n#deb-src http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list + # Use nodesource setup script to Add nodesource repository to sources.list.d + curl -sL https://deb.nodesource.com/setup_8.x | bash - + # Install nodejs and npm from nodesource + apt-get -y install nodejs + fi + # Attempting to remove git to make install --nogit by default for existing users echo Removing any existing git in $directory/.git rm -rf $directory/.git From a7cdfdfc353012bec0bbcb8db5457c4c968cfc90 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 1 Apr 2019 18:13:40 -0400 Subject: [PATCH 4/9] Use nodesource on the Edison --- bin/openaps-install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/openaps-install.sh b/bin/openaps-install.sh index fba177110..f3c818f3a 100755 --- a/bin/openaps-install.sh +++ b/bin/openaps-install.sh @@ -31,7 +31,11 @@ if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /de echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid #Replace apt sources.list with new archive.debian.org locations echo -e "deb http://security.debian.org/ jessie/updates main\n#deb-src http://security.debian.org/ jessie/updates main\n\ndeb http://archive.debian.org/debian/ jessie-backports main\n#deb-src http://archive.debian.org/debian/ jessie-backports main\n\ndeb http://archive.debian.org/debian/ jessie main contrib non-free\n#deb-src http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list - #Use nodesource setup script to Add nodesource repository to sources.list.d +fi + +#Workaround for Jubilinux to install nodejs/npm from nodesource +if getent passwd edison &> /dev/null; then + #Use nodesource setup script to add nodesource repository to sources.list.d curl -sL https://deb.nodesource.com/setup_8.x | bash - fi From 6556429caa88aeff5e51e66ea4f6b34615cbb14c Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 1 Apr 2019 18:15:42 -0400 Subject: [PATCH 5/9] Use nodesource nodejs/npm on the Edison --- bin/oref0-setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 86629d85e..85721b871 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -480,13 +480,17 @@ echocolor-n "Continue? y/[N] " read -r if [[ $REPLY =~ ^[Yy]$ ]]; then - # Workarounds for Jubilinux v0.2.0 (Debian Jessie) migration to LTS + # Workaround for Jubilinux v0.2.0 (Debian Jessie) migration to LTS if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then # Disable validity check for archived Debian repos echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid # Replace apt sources.list with new archive.debian.org locations echo -e "deb http://security.debian.org/ jessie/updates main\n#deb-src http://security.debian.org/ jessie/updates main\n\ndeb http://archive.debian.org/debian/ jessie-backports main\n#deb-src http://archive.debian.org/debian/ jessie-backports main\n\ndeb http://archive.debian.org/debian/ jessie main contrib non-free\n#deb-src http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list - # Use nodesource setup script to Add nodesource repository to sources.list.d + fi + + #Workaround for Jubilinux to install nodejs/npm from nodesource + if getent passwd edison &> /dev/null; then + # Use nodesource setup script to add nodesource repository to sources.list.d curl -sL https://deb.nodesource.com/setup_8.x | bash - # Install nodejs and npm from nodesource apt-get -y install nodejs From 069201193c76fe78f91e4a7381218688142e1183 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 1 Apr 2019 21:34:15 -0400 Subject: [PATCH 6/9] Only use non-packaged bluez if not on stretch... --- bin/oref0-setup.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 85721b871..21c244f96 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -650,12 +650,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then # Install Bluez for BT Tethering echo Checking bluez installation bluetoothdversion=$(bluetoothd --version || 0) - # use packaged bluez with Rapsbian - if getent passwd pi > /dev/null; then - bluetoothdminversion=5.43 - else - bluetoothdminversion=5.48 - fi + # use packaged bluez if on Debian stretch + bluetoothdminversion=5.43 bluetoothdversioncompare=$(awk 'BEGIN{ print "'$bluetoothdversion'"<"'$bluetoothdminversion'" }') if [ "$bluetoothdversioncompare" -eq 1 ]; then cd $HOME/src/ && wget -c4 https://www.kernel.org/pub/linux/bluetooth/bluez-5.48.tar.gz && tar xvfz bluez-5.48.tar.gz || die "Couldn't download bluez" From 9c0a3b39ae2f622952814712081ecf1e9c013c05 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sun, 7 Apr 2019 10:47:23 -0400 Subject: [PATCH 7/9] Install master branch of MRAA The 1.7.0 branch no longer exists --- 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 21c244f96..0222d2a11 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -816,9 +816,9 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then if ! ldconfig -p | grep -q mraa; then # if not installed, install it echo Installing swig etc. sudo apt-get install -y libpcre3-dev git cmake python-dev swig || die "Could not install swig etc." - # TODO: Due to mraa bug https://github.com/intel-iot-devkit/mraa/issues/771 we were not using the master branch of mraa on dev. # TODO: After each oref0 release, check whether there is a new stable MRAA release that is of interest for the OpenAPS community - MRAA_RELEASE="v1.7.0" # GitHub hash 8ddbcde84e2d146bc0f9e38504d6c89c14291480 + # Latest (as of April 2019) master branch of mraa is working + MRAA_RELEASE="master" # GitHub hash 8ddbcde84e2d146bc0f9e38504d6c89c14291480 if [ -d "$HOME/src/mraa/" ]; then echo -n "$HOME/src/mraa/ already exists; " #(echo "Pulling latest master branch" && cd ~/src/mraa && git fetch && git checkout master && git pull) || die "Couldn't pull latest mraa master" # used for oref0 dev From 58f0e2971952aa7bc3eeddaaf102aaf1f5bd6498 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Sun, 7 Apr 2019 10:49:04 -0400 Subject: [PATCH 8/9] Not the right hash anymore... --- bin/oref0-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 0222d2a11..55ed2e08c 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -818,7 +818,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then sudo apt-get install -y libpcre3-dev git cmake python-dev swig || die "Could not install swig etc." # TODO: After each oref0 release, check whether there is a new stable MRAA release that is of interest for the OpenAPS community # Latest (as of April 2019) master branch of mraa is working - MRAA_RELEASE="master" # GitHub hash 8ddbcde84e2d146bc0f9e38504d6c89c14291480 + MRAA_RELEASE="master" if [ -d "$HOME/src/mraa/" ]; then echo -n "$HOME/src/mraa/ already exists; " #(echo "Pulling latest master branch" && cd ~/src/mraa && git fetch && git checkout master && git pull) || die "Couldn't pull latest mraa master" # used for oref0 dev From 4d33c2965686b46c8e30855426998d925d594086 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Fri, 12 Apr 2019 12:54:29 -0400 Subject: [PATCH 9/9] Use MRAA v1.7.0 tarball `master` branch of MRAA is not working, at least on Jubilinux 0.2.0. This will install v1.7.0 from a tarball. --- bin/oref0-setup.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 55ed2e08c..c36d38644 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -818,16 +818,20 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then sudo apt-get install -y libpcre3-dev git cmake python-dev swig || die "Could not install swig etc." # TODO: After each oref0 release, check whether there is a new stable MRAA release that is of interest for the OpenAPS community # Latest (as of April 2019) master branch of mraa is working - MRAA_RELEASE="master" - if [ -d "$HOME/src/mraa/" ]; then - echo -n "$HOME/src/mraa/ already exists; " - #(echo "Pulling latest master branch" && cd ~/src/mraa && git fetch && git checkout master && git pull) || die "Couldn't pull latest mraa master" # used for oref0 dev - (echo "Updating mraa source to stable release ${MRAA_RELEASE}" && cd $HOME/src/mraa && git fetch && git checkout ${MRAA_RELEASE} && git pull) || die "Couldn't pull latest mraa ${MRAA_RELEASE} release" # used for oref0 master - else - echo -n "Cloning mraa " - #(echo -n "master branch. " && cd ~/src && git clone -b master https://github.com/intel-iot-devkit/mraa.git) || die "Couldn't clone mraa master" # used for oref0 dev - (echo -n "stable release ${MRAA_RELEASE}. " && cd $HOME/src && git clone -b ${MRAA_RELEASE} https://github.com/intel-iot-devkit/mraa.git) || die "Couldn't clone mraa release ${MRAA_RELEASE}" # used for oref0 master - fi + #MRAA_RELEASE="master" + #if [ -d "$HOME/src/mraa/" ]; then + # echo -n "$HOME/src/mraa/ already exists; " + # #(echo "Pulling latest master branch" && cd ~/src/mraa && git fetch && git checkout master && git pull) || die "Couldn't pull latest mraa master" # used for oref0 dev + # (echo "Updating mraa source to stable release ${MRAA_RELEASE}" && cd $HOME/src/mraa && git fetch && git checkout ${MRAA_RELEASE} && git pull) || die "Couldn't pull latest mraa ${MRAA_RELEASE} release" # used for oref0 master + #else + # echo -n "Cloning mraa " + # #(echo -n "master branch. " && cd ~/src && git clone -b master https://github.com/intel-iot-devkit/mraa.git) || die "Couldn't clone mraa master" # used for oref0 dev + # (echo -n "stable release ${MRAA_RELEASE}. " && cd $HOME/src && git clone -b ${MRAA_RELEASE} https://github.com/intel-iot-devkit/mraa.git) || die "Couldn't clone mraa release ${MRAA_RELEASE}" # used for oref0 master + #fi + # Force installation of v1.7.0 MRAA, as it is the only version we know works... + cd $HOME/src && rm -rf mraa/ + wget https://github.com/intel-iot-devkit/mraa/archive/v1.7.0.tar.gz || die "Could not download mraa" + tar -xvf v1.7.0.tar.gz && mv mraa-1.7.0/ mraa/ # build mraa from source ( cd $HOME/src/ && mkdir -p mraa/build && cd $_ && cmake .. -DBUILDSWIGNODE=OFF && \ make && sudo make install && echo && touch /tmp/reboot-required && echo mraa installed. Please reboot before using. && echo ) || die "Could not compile mraa"