diff --git a/Makefile b/Makefile index 0d543bc..5969bda 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE=a2pi -VERSION=0.9.0 +VERSION=0.1.0 DIST=$(PACKAGE)-$(VERSION) DISTDIR=./$(DIST) diff --git a/debian/a2pi.default b/debian/a2pi.default index 4a3056e..b0ea420 100755 --- a/debian/a2pi.default +++ b/debian/a2pi.default @@ -7,4 +7,6 @@ # # Additional options that are passed to the Daemon. +# If you are not using the default serial port /dev/ttyAMA0, enter it here. +# DAEMON_OPTS="/dev/ttyUSB0" DAEMON_OPTS="" diff --git a/debian/changelog b/debian/changelog index e2406fe..21c7986 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,17 @@ -a2pi (0.9.0-1) unstable; urgency=low +a2pi (0.1.0-3) unstable; urgency=low - * Initial release (Closes: #0901) + * Fix for daemon start + + -- David Schmenk Sun, 22 Sep 2013 13:32:30 -0700 + +a2pi (0.1.0-2) unstable; urgency=low + + * Fix deb package postinst script + + -- David Schmenk Sun, 22 Sep 2013 13:02:32 -0700 + +a2pi (0.1.0-1) unstable; urgency=low + + * Initial release -- David Schmenk Thu, 19 Sep 2013 18:28:32 -0700 diff --git a/debian/init.d b/debian/init.d old mode 100644 new mode 100755 index 2de53d8..3463f7e --- a/debian/init.d +++ b/debian/init.d @@ -18,8 +18,8 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=a2pid # Introduce a short description here NAME=a2pid # Introduce the short server's name here -DAEMON=/usr/sbin/a2pid # Introduce the server's location here -DAEMON_ARGS="--daemon" # Arguments to run the daemon with +DAEMON=/sbin/a2pid # Introduce the server's location here +DAEMON_ARGS="--daemon" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -46,13 +46,11 @@ do_start() # 1 if daemon was already running # 2 if daemon could not be started #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 + #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 + $DAEMON $DAEMON_ARGS $DAEMON_OPTS || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. - wait 1 } # diff --git a/debian/postinst b/debian/postinst old mode 100644 new mode 100755 index 1849ac1..27ee698 --- a/debian/postinst +++ b/debian/postinst @@ -23,8 +23,7 @@ case "$1" in # # Update /boot partition files. # - ttyline=`grep ttyAMA0 /boot/cmdline.txt` - if [ "$ttyline" != "" ] ; then + if [ "$(grep ttyAMA0 /boot/cmdline.txt)" != "" ] ; then mv /boot/cmdline.txt /boot/cmdline.bak echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait" > /boot/cmdline.txt fi @@ -32,8 +31,8 @@ case "$1" in # Disable getty on built-in serial port. # ttyline=`grep ttyAMA0 /etc/inittab` - case "$gettyline" in - T*) + case "$ttyline" in + T0*) mv /etc/inittab /etc/inittab.bak sed 's/^T0*/#T0*/' /etc/inittab.bak > /etc/inittab ;; @@ -46,6 +45,62 @@ case "$1" in if [ -d /usr/share/X11/xorg.conf.d ] ; then cp /usr/share/a2pi/11-joy.conf /usr/share/X11/xorg.conf.d fi + # + # Add schmenk.is-a-geek.com to apt sources + # + if [ "$(grep schmenk /etc/apt/sources.list)" = "" ] ; then + echo "deb http://schmenk.is-a-geek.com/raspbian wheezy contrib extra" >> /etc/apt/sources.list + fi + # + # Remove old install + # + if [ -f /usr/local/bin/a2pid ] ; then + rm /usr/local/bin/a2pid + fi + if [ -f /usr/local/bin/a2serclk ] ; then + rm /usr/local/bin/a2serclk + fi + if [ -f /usr/local/bin/a2mon ] ; then + rm /usr/local/bin/a2mon + fi + if [ -f /usr/local/bin/dskread ] ; then + rm /usr/local/bin/dskread + fi + if [ -f /usr/local/bin/dskwrite ] ; then + rm /usr/local/bin/dskwrite + fi + if [ -f /usr/local/bin/a2term ] ; then + rm /usr/local/bin/a2term + fi + if [ -f /usr/local/bin/fusea2pi ] ; then + rm /usr/local/bin/fusea2pi + fi + if [ -f /usr/local/bin/a2joy ] ; then + rm /usr/local/bin/a2joy + fi + if [ -f /usr/local/bin/a2joymou ] ; then + rm /usr/local/bin/a2joymou + fi + if [ -f /usr/local/bin/a2joypad ] ; then + rm /usr/local/bin/a2joypad + fi + if [ -f /usr/local/bin/a2mount ] ; then + rm /usr/local/bin/a2mount + fi + if [ -f /usr/local/bin/bload ] ; then + rm /usr/local/bin/bload + fi + if [ -f /usr/local/bin/brun ] ; then + rm /usr/local/bin/brun + fi + if [ -f /usr/local/sbin/a2pid ] ; then + rm /usr/local/sbin/a2pid + fi + if [ "$(grep a2pid /etc/rc.local)" != "" ] ; then + mv /etc/rc.local /etc/rc.local.old + sed -e '/^# Start Apple II Pi/d' -e '/a2pid/d' -e '/^wait 1/d' -e '/a2joy/'d /etc/rc.local.old > /etc/rc.local + rm /etc/rc.local.old + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/prerm b/debian/prerm index 9fb8688..5e34fad 100644 --- a/debian/prerm +++ b/debian/prerm @@ -19,19 +19,45 @@ set -e case "$1" in remove|upgrade|deconfigure) - rm /usr/local/bin/a2pid - rm /usr/local/bin/a2mon - rm /usr/local/bin/dskread - rm /usr/local/bin/dskwrite - rm /usr/local/bin/a2term - rm /usr/local/bin/fusea2pi - rm /usr/local/bin/a2joy - rm /usr/local/bin/a2joymou - rm /usr/local/bin/a2joypad - rm /usr/local/bin/a2mount - rm /usr/local/bin/bload - rm /usr/local/bin/brun - rm /usr/local/sbin/a2pid + if [ -f /usr/local/bin/a2pid ] ; then + rm /usr/local/bin/a2pid + fi + if [ -f /usr/local/bin/a2mon ] ; then + rm /usr/local/bin/a2mon + fi + if [ -f /usr/local/bin/dskread ] ; then + rm /usr/local/bin/dskread + fi + if [ -f /usr/local/bin/dskwrite ] ; then + rm /usr/local/bin/dskwrite + fi + if [ -f /usr/local/bin/a2term ] ; then + rm /usr/local/bin/a2term + fi + if [ -f /usr/local/bin/fusea2pi ] ; then + rm /usr/local/bin/fusea2pi + fi + if [ -f /usr/local/bin/a2joy ] ; then + rm /usr/local/bin/a2joy + fi + if [ -f /usr/local/bin/a2joymou ] ; then + rm /usr/local/bin/a2joymou + fi + if [ -f /usr/local/bin/a2joypad ] ; then + rm /usr/local/bin/a2joypad + fi + if [ -f /usr/local/bin/a2mount ] ; then + rm /usr/local/bin/a2mount + fi + if [ -f /usr/local/bin/bload ] ; then + rm /usr/local/bin/bload + fi + if [ -f /usr/local/bin/brun ] ; then + rm /usr/local/bin/brun + fi + if [ -f /usr/local/sbin/a2pid ] ; then + rm /usr/local/sbin/a2pid + fi ;; failed-upgrade)