From 1aec1b3b39eee5203b677f49c3301433ef37c353 Mon Sep 17 00:00:00 2001 From: Jason Striegel Date: Wed, 18 Feb 2015 00:33:30 -0500 Subject: [PATCH 1/5] Fixing zip and gpio issues. --- .../stock_raspbian/scripts/02_coder_dependencies.sh | 12 +++++++++++- raspbian-addons/etc/udev/rules.d/10-gpio.rules | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 raspbian-addons/etc/udev/rules.d/10-gpio.rules diff --git a/installer/stock_raspbian/scripts/02_coder_dependencies.sh b/installer/stock_raspbian/scripts/02_coder_dependencies.sh index ff8145d5..0923299d 100755 --- a/installer/stock_raspbian/scripts/02_coder_dependencies.sh +++ b/installer/stock_raspbian/scripts/02_coder_dependencies.sh @@ -1,9 +1,19 @@ #!/bin/bash -echo "### Add coder user to [spi, gpio, audio] groups (device access that coder needs)." +echo "### Install I2C Tools." +apt-get -y install i2c-tools +echo "### Let gpio group access gpio." +cp -v ../../../raspbian-addons/etc/udev/rules.d/10-gpio.rules /etc/udev/rules.d/10-gpio.rules + +echo "### Install Zip." +apt-get -y install zip + +echo "### Add coder user to [spi, gpio, audio, video, i2c] groups (device access that coder needs)." adduser coder spi adduser coder gpio adduser coder audio +adduser coder video +adduser coder i2c echo "" echo "### Install redis." diff --git a/raspbian-addons/etc/udev/rules.d/10-gpio.rules b/raspbian-addons/etc/udev/rules.d/10-gpio.rules new file mode 100644 index 00000000..fea8859d --- /dev/null +++ b/raspbian-addons/etc/udev/rules.d/10-gpio.rules @@ -0,0 +1,5 @@ +# Give the GPIO group access to /sys/class/gpio* + +SUBSYSTEM=="gpio", KERNEL!="gpio[0-9]*", ACTION=="add", PROGRAM="/bin/bash -c 'chown -R root:gpio $sys/class/gpio ; chmod 220 $sys/class/gpio/{export,unexport}'" + +SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/bash -c 'chmod -f 755 $sys$devpath ; chmod -f 660 $sys$devpath/{active_low,direction,edge,uevent,value} ; chown -Rf root:gpio $sys/$devpath'" From 069ff34da00e1e69baf280e0c121e651892e7085 Mon Sep 17 00:00:00 2001 From: Jason Striegel Date: Thu, 19 Feb 2015 04:08:45 +0000 Subject: [PATCH 2/5] Using customized gpio library. --- raspbian-addons/home/coder/coder-dist/coder-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raspbian-addons/home/coder/coder-dist/coder-base/package.json b/raspbian-addons/home/coder/coder-dist/coder-base/package.json index 2041f0a3..80ae62b8 100644 --- a/raspbian-addons/home/coder/coder-dist/coder-base/package.json +++ b/raspbian-addons/home/coder/coder-dist/coder-base/package.json @@ -13,7 +13,7 @@ "bcrypt": "0.7.4", "connect": "2.14.3", "cookie": "0.1.1", - "gpio": "*", + "gpio": "git://github.com/jmstriegel/GpiO.git", "i2c": "*", "pi-spi": "*" } From 24ec044aa1678ba41fa1274df2265d8279f8e1ed Mon Sep 17 00:00:00 2001 From: Jason Striegel Date: Sat, 21 Feb 2015 01:25:13 -0500 Subject: [PATCH 3/5] adding vim to default install --- installer/stock_raspbian/scripts/01_headless_basics.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installer/stock_raspbian/scripts/01_headless_basics.sh b/installer/stock_raspbian/scripts/01_headless_basics.sh index d0d3dc62..62c47c38 100755 --- a/installer/stock_raspbian/scripts/01_headless_basics.sh +++ b/installer/stock_raspbian/scripts/01_headless_basics.sh @@ -5,6 +5,10 @@ insserv ssh update-rc.d ssh enable echo "" +echo "### Install vim." +apt-get -y install vim +echo "" + echo "### Install avahi daemon (enables mDNS/DNS-SD so you can connect to coder.local)." apt-get -y install avahi-daemon echo "" From baced2edd806c65475e8a2c8c01a6e5e61a8e23d Mon Sep 17 00:00:00 2001 From: Jason Striegel Date: Sat, 21 Feb 2015 06:24:48 -0500 Subject: [PATCH 4/5] Avahi extras. --- .../scripts/01_headless_basics.sh | 4 +- raspbian-addons/etc/avahi/avahi-daemon.conf | 68 +++++++++++++++++++ .../etc/avahi/services/coder.service | 12 ++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 raspbian-addons/etc/avahi/avahi-daemon.conf create mode 100644 raspbian-addons/etc/avahi/services/coder.service diff --git a/installer/stock_raspbian/scripts/01_headless_basics.sh b/installer/stock_raspbian/scripts/01_headless_basics.sh index 62c47c38..b8050fcb 100755 --- a/installer/stock_raspbian/scripts/01_headless_basics.sh +++ b/installer/stock_raspbian/scripts/01_headless_basics.sh @@ -10,7 +10,9 @@ apt-get -y install vim echo "" echo "### Install avahi daemon (enables mDNS/DNS-SD so you can connect to coder.local)." -apt-get -y install avahi-daemon +apt-get -y install avahi-daemon avahi-utils +cp ../../../raspbian-addons/etc/avahi/avahi-daemon.conf /etc/avahi/avahi-daemon.conf +cp ../../../raspbian-addons/etc/avahi/services/coder.service /etc/avahi/services/ echo "" echo "### Install dhcpd daemon (will be used to give addresses when in ad-hoc hotspot mode)." diff --git a/raspbian-addons/etc/avahi/avahi-daemon.conf b/raspbian-addons/etc/avahi/avahi-daemon.conf new file mode 100644 index 00000000..b7a2963e --- /dev/null +++ b/raspbian-addons/etc/avahi/avahi-daemon.conf @@ -0,0 +1,68 @@ +# This file is part of avahi. +# +# avahi is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# avahi is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with avahi; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. + +# See avahi-daemon.conf(5) for more information on this configuration +# file! + +[server] +#host-name=foo +#domain-name=local +#browse-domains=0pointer.de, zeroconf.org +use-ipv4=yes +use-ipv6=no +allow-interfaces=eth0,eth1,wlan0 +#deny-interfaces=eth1 +#check-response-ttl=no +#use-iff-running=no +#enable-dbus=yes +#disallow-other-stacks=no +#allow-point-to-point=no +#cache-entries-max=4096 +#clients-max=4096 +#objects-per-client-max=1024 +#entries-per-entry-group-max=32 +ratelimit-interval-usec=1000000 +ratelimit-burst=1000 + +[wide-area] +enable-wide-area=yes + +[publish] +#disable-publishing=no +#disable-user-service-publishing=no +#add-service-cookie=no +#publish-addresses=yes +#publish-hinfo=yes +#publish-workstation=yes +#publish-domain=yes +#publish-dns-servers=192.168.50.1, 192.168.50.2 +#publish-resolv-conf-dns-servers=yes +#publish-aaaa-on-ipv4=yes +#publish-a-on-ipv6=no + +[reflector] +#enable-reflector=no +#reflect-ipv=no + +[rlimits] +#rlimit-as= +rlimit-core=0 +rlimit-data=4194304 +rlimit-fsize=0 +rlimit-nofile=768 +rlimit-stack=4194304 +rlimit-nproc=3 diff --git a/raspbian-addons/etc/avahi/services/coder.service b/raspbian-addons/etc/avahi/services/coder.service new file mode 100644 index 00000000..ccca99b6 --- /dev/null +++ b/raspbian-addons/etc/avahi/services/coder.service @@ -0,0 +1,12 @@ + + + + + + Coder Server at %h.local + + + _http._tcp + 80 + + From 8b5d7fd36ffbe875ffaa8bd428c64f619196e4db Mon Sep 17 00:00:00 2001 From: Jason Striegel Date: Sun, 22 Feb 2015 17:48:04 -0500 Subject: [PATCH 5/5] handling paths with spaces. --- installer/macosx/CoderSetup.py | 2 +- installer/macosx/formatsdcard.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/macosx/CoderSetup.py b/installer/macosx/CoderSetup.py index c49684cc..73535888 100644 --- a/installer/macosx/CoderSetup.py +++ b/installer/macosx/CoderSetup.py @@ -323,7 +323,7 @@ def formatSDDevice(): pythonexe = os.path.dirname(sys.argv[0]) + "/../MacOS/python" open( logfile, 'w' ).close() - command = "osascript -e 'do shell script \"" + pythonexe + " -u formatsdcard.py really " + str( sdCardDev ) + " > " + logfile + " \" with administrator privileges'" + command = "osascript -e 'do shell script \"\\\"" + pythonexe + "\\\" -u formatsdcard.py really " + str( sdCardDev ) + " > " + logfile + " \" with administrator privileges'" print( "SYSTEM: " + command ) #os.system( command ) diff --git a/installer/macosx/formatsdcard.py b/installer/macosx/formatsdcard.py index 9706d2de..a0a03e36 100644 --- a/installer/macosx/formatsdcard.py +++ b/installer/macosx/formatsdcard.py @@ -50,7 +50,7 @@ filesize = os.path.getsize( filepath ) progresssize = 0 - command = 'dd bs=2m if=' + filepath + ' of=/dev/rdisk' + str( sdCardDev ) + command = 'dd bs=2m if="' + filepath + '" of=/dev/rdisk' + str( sdCardDev ) print( "FORMATTING: " + command ) proc = subprocess.Popen( command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE )