Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions README-UBUNTU-16.txt
Original file line number Diff line number Diff line change
@@ -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

5 changes: 4 additions & 1 deletion scripts/downgrade_to_lasaurapp.sh
Original file line number Diff line number Diff line change
@@ -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!"
34 changes: 29 additions & 5 deletions scripts/driveboardapp.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
#!/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 <stefan@nortd.com>
#
# 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
start)
echo "Starting driveboardapp ..."
echo -n "at "
date
/usr/bin/python $LASAURAPP
/usr/bin/python $DAEMON
;;

stop)
Expand All @@ -25,15 +49,15 @@ 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)
echo "Restarting driveboardapp in debug mode..."
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
;;

*)
Expand Down
4 changes: 4 additions & 0 deletions scripts/install_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
63 changes: 58 additions & 5 deletions scripts/lasaurapp.sh
Original file line number Diff line number Diff line change
@@ -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 <stefan@nortd.com>
#
# 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
2 changes: 1 addition & 1 deletion scripts/upgrade_to_driveboardapp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

echo "Switching from LasaurApp to DriveboardApp ..."

Expand Down