From fd127ccd12c392bbce81d95aa87a2f4a38fc35c7 Mon Sep 17 00:00:00 2001 From: dschmenk Date: Wed, 11 Sep 2013 11:51:05 -0700 Subject: [PATCH] Change connection port to not conflict with GSport --- src/a2lib.c | 2 +- src/a2pid.c | 2 +- src/install.sh | 2 +- src/install.sh~ | 31 +++++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 src/install.sh~ diff --git a/src/a2lib.c b/src/a2lib.c index be81a80..cbf62bc 100755 --- a/src/a2lib.c +++ b/src/a2lib.c @@ -19,7 +19,7 @@ int a2open(char *ipaddr) } memset(&piaddr, 0, sizeof(piaddr)); piaddr.sin_family = AF_INET; - piaddr.sin_port = htons(6502); + piaddr.sin_port = htons(6551); res = inet_pton(AF_INET, ipaddr, &piaddr.sin_addr); if (res < 0) { diff --git a/src/a2pid.c b/src/a2pid.c index 25c8fce..0076beb 100755 --- a/src/a2pid.c +++ b/src/a2pid.c @@ -757,7 +757,7 @@ void main(int argc, char **argv) prlog("a2pid: Open server socket\n"); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; - servaddr.sin_port = htons(6502); + servaddr.sin_port = htons(6551); servaddr.sin_addr.s_addr = htonl(INADDR_ANY); srvfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (srvfd < 0) diff --git a/src/install.sh b/src/install.sh index 52c1dd4..5a42815 100755 --- a/src/install.sh +++ b/src/install.sh @@ -21,7 +21,7 @@ fi if [ -f /etc/rc.local ] ; then if ! grep a2pid /etc/rc.local > /dev/null ; then mv /etc/rc.local /etc/rc.local.bak - sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/bin/a2serclk' -e '/^exit/i\/usr/local/bin/a2pid --daemon' /etc/rc.local.bak > /etc/rc.local + sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/bin/a2serclk' -e '/^exit/i\/usr/local/bin/a2pid --daemon' -e '/^exit/i\wait 1' -e '/^exit/i\/usr/local/bin/a2joy' /etc/rc.local.bak > /etc/rc.local chmod +x /etc/rc.local fi fi diff --git a/src/install.sh~ b/src/install.sh~ new file mode 100755 index 0000000..52c1dd4 --- /dev/null +++ b/src/install.sh~ @@ -0,0 +1,31 @@ +#!/bin/bash + +# +# Update /boot partition files. +# +if [ ! -f /boot/cmdline.bak ] ; 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 +# +# Disable getty on built-in serial port. +# +gettyline=`grep ttyAMA0 /etc/inittab` +if [ -n "$gettyline" -a ${gettyline:0:1} = T ] ; then + mv /etc/inittab /etc/inittab.bak + sed 's/^T0*/#T0*/' /etc/inittab.bak > /etc/inittab +fi +# +# Add a2serclk and a2pid to rc.local +# +if [ -f /etc/rc.local ] ; then + if ! grep a2pid /etc/rc.local > /dev/null ; then + mv /etc/rc.local /etc/rc.local.bak + sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/bin/a2serclk' -e '/^exit/i\/usr/local/bin/a2pid --daemon' /etc/rc.local.bak > /etc/rc.local + chmod +x /etc/rc.local + fi +fi +# +# Disable joystick as a mouse in X +# +cp 11-joy.conf /usr/share/X11/xorg.conf.d