diff --git a/README-UBUNTU-16.txt b/README-UBUNTU-16.txt new file mode 100644 index 0000000..56285ae --- /dev/null +++ b/README-UBUNTU-16.txt @@ -0,0 +1,47 @@ +jet@allartburns.org +3 Dec 2017 + + +Two options + +1) just install Ubuntu-16 on a fresh SD card and run the install script + +2) run the wrong way in traffic and upgrade your existing build + +Part the First, Update Ubuntu via SSH (not for the faint of heart) +These are the steps I took. When I tried a similar set of steps on my +dev machine they failed for all sorts of wobbly reasons. On my "real" +lasersaur it just worked: + +apt-get update +apt-get upgrade +apt-get dist-upgrade # probalby not needed +apt-get install update-manager-core +screen -S upgrade +# +# IMPORTANT: It's possible you have too many packages installed +# and don't have room for the upgrader to download the next release. +# Be ready to apt remove a lot of stuff you can reinstall after the +# upgrade. I had to remove emacs, gcc, g++, x11 (how did that get +# installed?) then do autoclean to make room for the upgrade. +# +do-release-upgrade +# now ssh in to the new port from another terminal and reattach to +# the screen service to maintain the conneciton after the stock +# sshd is restarted +screen -x upgrade +# then when it's all done: +shutdown -r now + + +Part the Second, Update driveboardapp: + +switch to my repo: +https://github.com/allartburns/driveboardapp +checkout branch "ubuntu-16" +then re-install + +cd /root/driveboardapp/scripts +./upgrade_to_driveboardapp.sh +shutdown -r now + diff --git a/scripts/downgrade_to_lasaurapp.sh b/scripts/downgrade_to_lasaurapp.sh index 2c2c2f3..49683b5 100755 --- a/scripts/downgrade_to_lasaurapp.sh +++ b/scripts/downgrade_to_lasaurapp.sh @@ -1,8 +1,11 @@ - +#!/bin/sh echo "Switching from DriveboardApp to LasaurApp ..." update-rc.d -f driveboardapp.sh remove + +cp /root/driveboardapp/scripts/lasaurapp.sh /etc/init.d/lasaurapp.sh +chmod 755 /etc/init.d/lasaurapp.sh update-rc.d lasaurapp.sh defaults echo "Done!" diff --git a/scripts/driveboardapp.sh b/scripts/driveboardapp.sh index 336a9e0..c5c99f4 100644 --- a/scripts/driveboardapp.sh +++ b/scripts/driveboardapp.sh @@ -1,10 +1,34 @@ -#!/bin/bash +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: Driveboardapp +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: current Lasersaur software +# Description: version 17.04 +# +### END INIT INFO + +# Author: Stefan Hechenberger +# +# Please remove the "Author" lines above and replace them +# with your own name if you copy and modify this script. + +DESC="Lasersaur Server" +DAEMON="/root/driveboardapp/backend/app.py" + + +# original documentation # place in: /etc/init.d/driveboardapp.sh # make executable: sudo chmod 755 /etc/init.d/driveboardapp.sh # activate with: sudo update-rc.d driveboardapp.sh defaults # deactivate with: sudo update-rc.d -f driveboardapp.sh remove -LASAURAPP="/root/driveboardapp/backend/app.py" LASAURPROC="driveboardapp\/backend\/app\.py" case "$1" in @@ -12,7 +36,7 @@ case "$1" in echo "Starting driveboardapp ..." echo -n "at " date - /usr/bin/python $LASAURAPP + /usr/bin/python $DAEMON ;; stop) @@ -25,7 +49,7 @@ case "$1" in echo "Stopping driveboardapp ..." ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }' echo "Starting driveboardapp ..." - /usr/bin/python $LASAURAPP + /usr/bin/python $DAEMON ;; debug) @@ -33,7 +57,7 @@ case "$1" in echo "Stopping driveboardapp ..." ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }' echo "Starting driveboardapp with --debug ..." - /usr/bin/python $LASAURAPP --debug + /usr/bin/python $DAEMON --debug ;; *) diff --git a/scripts/install_packages.sh b/scripts/install_packages.sh index b182bf3..1730063 100755 --- a/scripts/install_packages.sh +++ b/scripts/install_packages.sh @@ -6,4 +6,8 @@ mv /etc/apt/sources.list /etc/apt/sources.list.old cp /root/driveboardapp/scripts/sources.list /etc/apt/sources.list apt-get update apt-get install python-imaging + +echo "installing dxfgrabber" +pip install dxfgrabber + echo "Done!" diff --git a/scripts/lasaurapp.sh b/scripts/lasaurapp.sh index f80e634..e743531 100644 --- a/scripts/lasaurapp.sh +++ b/scripts/lasaurapp.sh @@ -1,11 +1,64 @@ -#!/bin/bash +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: LasaurApp +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: original Lasersaur software, deprecated +# Description: Control the lasersaur software through version +# 15.00 +### END INIT INFO + +# Author: Stefan Hechenberger +# +# Please remove the "Author" lines above and replace them +# with your own name if you copy and modify this script. + +DESC="LasaurApp Server" +DAEMON="/usr/bin/python /root/LasaurApp/backend/app.py -p --beaglebone" + +# original documentation # place in: /etc/init.d/lasaurapp.sh # make executable: sudo chmod 755 /etc/init.d/lasaurapp.sh # activate with: sudo update-rc.d lasaurapp.sh defaults # deactivate with: sudo update-rc.d -f lasaurapp.sh remove -if test "$1" = "start" -then +LASAURAPP="/root/LasaurApp/backend/app.py" +LASAURPROC="LasaurApp\/backend\/app\.py" + +case "$1" in + start) echo "Starting LasaurApp ..." - /usr/bin/python /root/LasaurApp/backend/app.py -p --beaglebone -fi + /usr/bin/python $LASAURAPP -p --beaglebone + ;; + + stop) + echo "Stopping LasaurApp ..." + ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }' + ;; + + restart) + echo "Restarting LasaurApp ..." + echo "Stopping LasaurApp ..." + ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }' + echo "Starting LasaurApp ..." + /usr/bin/python $LASAURAPP -p --beaglebone + ;; + + debug) + echo "Restarting LasaurApp in debug mode..." + echo "Stopping LasaurApp ..." + ps ax | awk "/$LASAURPROC/ "'{ system("kill " $1) }' + echo "Starting LasaurApp ..." + /usr/bin/python $LASAURAPP -p --beaglebone --debug + ;; + + *) + echo "Usage: /etc/init.d/lasersaur {start|stop|restart|debug}" >&2 + exit 1 +esac diff --git a/scripts/upgrade_to_driveboardapp.sh b/scripts/upgrade_to_driveboardapp.sh index 0f8f2d2..f9ab0f0 100755 --- a/scripts/upgrade_to_driveboardapp.sh +++ b/scripts/upgrade_to_driveboardapp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh echo "Switching from LasaurApp to DriveboardApp ..."