├── .gitignore ├── LICENSE ├── README.md ├── addrepo-pin.sh ├── addrepo.sh ├── docs └── subtrees.md ├── finder.sh ├── install-pin.sh ├── install.sh ├── logo.txt ├── packages ├── Makefile ├── README.md ├── adafruit-ap │ ├── DEBIAN │ │ ├── changelog │ │ ├── control │ │ └── postinst │ ├── etc │ │ └── adafruit-ap │ │ │ ├── adafruit-ap │ │ │ ├── dhcpd.conf │ │ │ ├── hostapd │ │ │ ├── hostapd-replacement │ │ │ ├── interfaces.ap │ │ │ └── isc-dhcp-server │ └── usr │ │ └── share │ │ └── doc │ │ └── adafruit-ap │ │ └── changelog.gz ├── adafruit-io-gif │ ├── DEBIAN │ │ ├── changelog │ │ ├── control │ │ └── postinst │ ├── etc │ │ └── adafruit-io-gif │ │ │ ├── node_source │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ │ └── xinit_script │ └── usr │ │ ├── bin │ │ └── aio_gif │ │ └── share │ │ └── doc │ │ └── adafruit-io-gif │ │ └── changelog.gz ├── adafruit-pi-externalroot-helper │ ├── LICENSE │ ├── README.md │ ├── adafruit-pi-externalroot-helper │ └── debian │ │ ├── adafruit-pi-externalroot-helper.substvars │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── docs │ │ ├── install │ │ ├── rules │ │ └── source │ │ └── format ├── adafruit-pitft-helper_TEMPLATE │ └── debian │ │ ├── adafruit-pitft-helper.substvars │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── docs │ │ ├── install │ │ ├── rules │ │ └── source │ │ └── format ├── occi.md ├── occi │ ├── .gitignore │ ├── DEBIAN │ │ ├── changelog │ │ ├── conffiles │ │ ├── control │ │ └── postinst │ ├── README.md │ ├── etc │ │ └── init.d │ │ │ └── occi │ └── usr │ │ ├── bin │ │ └── occi │ │ └── share │ │ ├── doc │ │ └── occi │ │ │ └── occidentalis_example.txt │ │ └── man │ │ └── man1 │ │ └── .gitkeep └── occidentalis │ ├── DEBIAN │ ├── changelog │ ├── control │ └── postinst │ └── usr │ └── share │ └── doc │ └── occidentalis │ └── README └── repo ├── README.md ├── deploy.sh ├── nginx ├── apt.conf └── apt_ssl.conf └── setup.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | .DS_Store 4 | node_modules 5 | 6 | # debs we build on the fly 7 | packages/build/*.deb 8 | 9 | # temporary directories 10 | packages/adafruit-pitft-helper 11 | 12 | # generated man pages - see packages/Makefile 13 | packages/occi/usr/share/man/man1/*.gz 14 | packages/occidentalis/usr/share/doc/occidentalis/changelog.gz 15 | packages/occi/usr/share/doc/occi/changelog.gz 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Adafruit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **Note:** This repository is for reference purposes only. Adafruit no longer 2 | maintains the Occidentalis package set or the apt.adafruit.com package 3 | repository. Please see [Raspberry-Pi-Installer-Scripts](rpi-scripts) for 4 | currently-supported Raspberry Pi configuration tools, including a standalone 5 | version of the `occi` configuration helper originally developed for this 6 | project. 7 | 8 | # Adafruit Occidentalis 9 | 10 | Occidentalis is a collection of packages intended for use on a Raspberry Pi 11 | running the latest version of the Raspbian distribution. By default, it 12 | installs a collection of development tools and a configuration helper called 13 | `occi`. It also provides a custom kernel build and configuration helpers for 14 | various Adafruit products. 15 | 16 | ## Installing Occidentalis 17 | 18 | ### The Easy Way 19 | 20 | Check out [our Pi Finder][finder], a graphical, cross-platform tool for 21 | locating a Raspberry Pi on your network and configuring it with Occidentalis. 22 | 23 | ### The Easy Way (Command Line Edition) 24 | 25 | On your Raspberry Pi, open a terminal and enter the following: 26 | 27 | ``` 28 | sudo -s 29 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 30 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 31 | apt-get update 32 | apt-get install occidentalis 33 | ``` 34 | 35 | There's also [a handy installation script][install.sh] to do the same thing. You can 36 | inspect it with: 37 | 38 | ``` 39 | curl -SLs https://apt.adafruit.com/install | less 40 | ``` 41 | 42 | And, assuming you trust us, run it with: 43 | 44 | ``` 45 | curl -SLs https://apt.adafruit.com/install | sudo bash 46 | ``` 47 | 48 | [install.sh]: https://github.com/adafruit/Adafruit-Occidentalis/blob/master/install.sh 49 | [finder]: https://github.com/adafruit/Adafruit-Pi-Finder 50 | [rpi-scripts]: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts 51 | -------------------------------------------------------------------------------- /addrepo-pin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat << "EOF" 4 | .` 5 | -dMMs 6 | +MMMMMo 7 | .dMMMMMMN- 8 | +NMMMMMMMMd` 9 | `hMMMMMMMMMMMo 10 | -mMMMMMMMMMMMMN. 11 | dMMMMMMMMMMMMMMo 12 | :hmmmmmmmmmmmmdhs/. `MMMMMMMMMMMMMMMh 13 | sMMMMMMMMMMMMMMMMMMd+NMMMMMMMMMMMMMM+ 14 | /NMMMMMMMMMMMMMMMMMMMMMMMMs+NMMMMMm/+syyyso/-` 15 | `hMMMMMMMMMMMMMMMMMMMMMMo hMMMMMMMMMMMMMMMMMNhs+:. 16 | /NMMMMMMMMMMMNmmNMMMMN. `mMMMMMMMMMMMMMMMMMMMMMMMNh- 17 | .hMMMMMMMMMMh` `-sNMMs-hMMMMMMMMMMMMMMMMMMMMMMMMMM+ 18 | /mMMMMMMMMMNy+-./MMMMMMy:....oMMMMMMMMMMMMMMMNo. 19 | :ymMMMMMMMMMMMMMMMMMNy//oymMMMMMMMMMMMMMNy: 20 | .yMMMMMMMms:oMMNhNMMMMMMMMMMMMMMMMNh/` 21 | .yMMMMMMMN/ .dMMy `sMMMMMMMMMMMNmy/` 22 | /NMMMMMMMM:`-sMMMMM: sMMMMMMs-..` 23 | -NMMMMMMMMMNNMMMMMMMMs./MMMMMMMh` 24 | mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs 25 | sMMMMMMMMMMMMMMMMhMMMMMMMMMMMMMMMN 26 | :MMMMMMMMMMMMMMMN+ hMMMMMMMMMMMMMMN. 27 | `dMMMMMMMMMMMMNh/` `hMMMMMMMMMMMMMN. 28 | /MMMMMMMMmhs+- /dMMMMMMMMMMMN. 29 | .hmdys/- -sNMMMMMMMMN. 30 | `:hNMMMMMN. 31 | `+dMMMN` 32 | ./+- 33 | 34 | adding apt.adafruit.com to /etc/apt/sources.list 35 | 36 | EOF 37 | 38 | sleep 2 39 | 40 | if grep -Fq "adafruit" /etc/apt/sources.list; then 41 | echo "adafruit repo already added to apt sources" 42 | else 43 | # add apt repo to sources.list 44 | if grep -q "8.0" "/etc/debian_version"; then 45 | echo "deb http://apt.adafruit.com/raspbian/ jessie main" >> /etc/apt/sources.list 46 | else 47 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 48 | fi 49 | 50 | # import repo key 51 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 52 | fi 53 | 54 | # pin apt.adafruit.com origin for anything installed there: 55 | if [ ! -f /etc/apt/preferences.d/adafruit ]; then 56 | echo "pinning apt.adafruit.com origin" 57 | echo "edit /etc/apt/preferences.d/adafruit to change" 58 | echo -e "Package: *\nPin: origin \"apt.adafruit.com\"\nPin-Priority: 1001" > /etc/apt/preferences.d/adafruit 59 | else 60 | echo "/etc/apt/preferences.d/adafruit already exists - leaving alone" 61 | fi 62 | 63 | # update package database 64 | apt-get update 65 | -------------------------------------------------------------------------------- /addrepo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat << "EOF" 4 | .` 5 | -dMMs 6 | +MMMMMo 7 | .dMMMMMMN- 8 | +NMMMMMMMMd` 9 | `hMMMMMMMMMMMo 10 | -mMMMMMMMMMMMMN. 11 | dMMMMMMMMMMMMMMo 12 | :hmmmmmmmmmmmmdhs/. `MMMMMMMMMMMMMMMh 13 | sMMMMMMMMMMMMMMMMMMd+NMMMMMMMMMMMMMM+ 14 | /NMMMMMMMMMMMMMMMMMMMMMMMMs+NMMMMMm/+syyyso/-` 15 | `hMMMMMMMMMMMMMMMMMMMMMMo hMMMMMMMMMMMMMMMMMNhs+:. 16 | /NMMMMMMMMMMMNmmNMMMMN. `mMMMMMMMMMMMMMMMMMMMMMMMNh- 17 | .hMMMMMMMMMMh` `-sNMMs-hMMMMMMMMMMMMMMMMMMMMMMMMMM+ 18 | /mMMMMMMMMMNy+-./MMMMMMy:....oMMMMMMMMMMMMMMMNo. 19 | :ymMMMMMMMMMMMMMMMMMNy//oymMMMMMMMMMMMMMNy: 20 | .yMMMMMMMms:oMMNhNMMMMMMMMMMMMMMMMNh/` 21 | .yMMMMMMMN/ .dMMy `sMMMMMMMMMMMNmy/` 22 | /NMMMMMMMM:`-sMMMMM: sMMMMMMs-..` 23 | -NMMMMMMMMMNNMMMMMMMMs./MMMMMMMh` 24 | mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs 25 | sMMMMMMMMMMMMMMMMhMMMMMMMMMMMMMMMN 26 | :MMMMMMMMMMMMMMMN+ hMMMMMMMMMMMMMMN. 27 | `dMMMMMMMMMMMMNh/` `hMMMMMMMMMMMMMN. 28 | /MMMMMMMMmhs+- /dMMMMMMMMMMMN. 29 | .hmdys/- -sNMMMMMMMMN. 30 | `:hNMMMMMN. 31 | `+dMMMN` 32 | ./+- 33 | 34 | adding apt.adafruit.com to /etc/apt/sources.list 35 | 36 | EOF 37 | 38 | sleep 2 39 | 40 | if grep -Fq "adafruit" /etc/apt/sources.list; then 41 | echo "adafruit repo already added to apt sources" 42 | else 43 | # add apt repo to sources.list 44 | if grep -q "8.0" "/etc/debian_version"; then 45 | echo "deb http://apt.adafruit.com/raspbian/ jessie main" >> /etc/apt/sources.list 46 | else 47 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 48 | fi 49 | 50 | # import repo key 51 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 52 | fi 53 | 54 | # update package database 55 | apt-get update 56 | -------------------------------------------------------------------------------- /docs/subtrees.md: -------------------------------------------------------------------------------- 1 | to init 2 | ------- 3 | 4 | git remote add Adafruit-Occi git@github.com:adafruit/Adafruit-Occi.git 5 | git subtree add --prefix=packages/occi/ Adafruit-Occi master 6 | 7 | git remote add Adafruit-Pi-ExternalRoot-Helper git@github.com:adafruit/Adafruit-Pi-ExternalRoot-Helper.git 8 | git subtree add --prefix=packages/adafruit-pi-externalroot-helper/ Adafruit-Pi-ExternalRoot-Helper master 9 | 10 | to update 11 | --------- 12 | 13 | git subtree pull --prefix=packages/adafruit-pi-externalroot-helper/ Adafruit-Pi-ExternalRoot-Helper master 14 | git subtree pull --prefix=packages/occi/ Adafruit-Occi master 15 | -------------------------------------------------------------------------------- /finder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Command line options: See usage below 4 | 5 | 6 | function usage 7 | { 8 | cat <<-EOF 9 | $(basename $0): a simple CLI utility to find a raspberry Pi on the local subnet and do something useful. 10 | 11 | Options: 12 | 13 | -u 14 | supply a username (default is \`pi\`) 15 | 16 | -p 17 | supply an ssh port (default is \`22\`) 18 | 19 | -t 20 | Start an interactive terminal 21 | 22 | -d 23 | Print useful information and exit 24 | 25 | -c 26 | Run some list of commands (place in "") 27 | 28 | -i 29 | Run the Adafruit Occidentalis bootstrap (default behaviour) 30 | 31 | -s 32 | Use a different subnet (assumes netmask 255.255.255.0) . Defaults to the same subnet as this workstation 33 | 34 | -o 35 | Provide a single string to be passed to ssh as parameters e.g. -o "-X -i ~/.ssh/pikey" 36 | 37 | -h 38 | get some simple help (this message) 39 | 40 | EOF 41 | 42 | exit 43 | 44 | } 45 | 46 | 47 | 48 | # we haven't found the IP yet 49 | IP="" 50 | SSH_PORT=22 51 | 52 | 53 | USER_NAME=pi 54 | COMMAND='curl -SLs https://apt.adafruit.com/install | sudo bash' 55 | 56 | printf "This script will attempt to find a Raspberry Pi on your local network, connect to it " 57 | while getopts htdu:p:c:s:o: opt ; do 58 | case $opt in 59 | 60 | t) COMMAND="" # No command provides shell access 61 | printf ",\nprovide a shell prompt" ;; 62 | 63 | d) COMMAND=$'printf "\nHostname: %s\nUptime: %s\n\n%s\n" $(hostname) "$(uptime)" "$(/sbin/ifconfig)"' 64 | printf ",\nand display uptime and network information" ;; 65 | 66 | i) COMMAND='curl -SLs https://apt.adafruit.com/install | sudo bash' 67 | printf ",\nand start the Adafruit bootstrap." ;; 68 | 69 | u) USER_NAME=$OPTARG ;; 70 | 71 | p) SSH_PORT=$OPTARG 72 | printf ",\nuse the ssh port \"$SSH_PORT\"" ;; 73 | 74 | c) COMMAND="$OPTARG" 75 | printf ",\nand run the command list \"$COMMAND\"" ;; 76 | 77 | o) SSH_OPTS="$OPTARG" 78 | printf ",\nssh will use options \"$SSH_OPTS\"\n\n" ;; 79 | 80 | s) LOCAL="$OPTARG" ;; # Subnet 81 | 82 | h) usage ;; 83 | 84 | esac 85 | 86 | done 87 | 88 | printf ",\nUsername is \"$USER_NAME\"" 89 | 90 | 91 | # check if we are using the GNU version of the utils 92 | if date --version >/dev/null 2>&1; then 93 | TYPE="GNU" 94 | else 95 | TYPE="BSD" 96 | fi 97 | 98 | # terminal styles 99 | BOLD=`tput smso` 100 | NORMAL=`tput sgr0` 101 | 102 | if [ -z "$LOCAL" ] ; then 103 | 104 | # get the router address 105 | if [ "$TYPE" == "BSD" ]; then 106 | ROUTER=$(netstat -r -f inet | awk '/^default/ { print $2 }') 107 | else 108 | ROUTER=$(netstat -r --inet | awk '/^default/ { print $2 }') 109 | fi 110 | 111 | # get the first three octets of the local network 112 | LOCAL=$(echo $ROUTER | awk -F. '{print $1,$2,$3}' OFS=".") 113 | 114 | fi 115 | 116 | printf "\n\nNB using a Subnet of \"$LOCAL\"\n\n" 117 | 118 | # deal with the different locations of the arp command 119 | arp_command() { 120 | 121 | if type arp 2>/dev/null; then 122 | arp "$@" 123 | elif type /sbin/arp 2>/dev/null; then 124 | /sbin/arp "$@" 125 | elif type /usr/sbin/arp 2>/dev/null; then 126 | /usr/sbin/arp "$@" 127 | elif type /usr/local/arp 2>/dev/null; then 128 | /usr/local/arp "$@" 129 | else 130 | echo "Could not find the ${BOLD}arp${NORMAL} command on your system" 131 | exit 1 132 | fi 133 | 134 | } 135 | 136 | printf "Searching for a Raspberry Pi on your local network..." 137 | 138 | for i in {1..254}; do 139 | 140 | # break if we have already found an IP 141 | if [[ "$IP" != "" ]]; then 142 | break 143 | fi 144 | 145 | # let the user know we are still here 146 | printf "." 147 | 148 | # ping next IP 149 | if [ "$TYPE" == "BSD" ]; then 150 | ping -c 1 -o -t 1 $LOCAL.$i > /dev/null 2>&1 151 | else 152 | ping -c 1 -W 1 $LOCAL.$i > /dev/null 2>&1 153 | fi 154 | 155 | # grab the IP from any device that matches a Pi's mac address 156 | IP=$(arp_command -a | grep b8:27:eb | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') 157 | 158 | done 159 | 160 | # if the IP is still blank, we couldn't find a Pi 161 | if [[ "$IP" == "" ]]; then 162 | printf "\nCouldn't find a Raspberry Pi on your local network. Please make sure it's plugged in via the Ethernet port.\n" 163 | exit 1 164 | fi 165 | 166 | printf "\nAttempting to connect to the Raspberry Pi found @ $IP\n" 167 | printf "Please enter the password when prompted. The default is ${BOLD}raspberry${NORMAL}\n" 168 | 169 | # try to check if the ssh port is open on the target pi 170 | HAS_SSH=0 171 | if [ "$TYPE" == "BSD" ]; then 172 | # the only downside to this seems to be that if the host is unreachable, 173 | # this is going to hang - hopefully that's not an issue with an address 174 | # we've just pinged 175 | (echo > /dev/tcp/${IP}/${SSH_PORT}) >/dev/null 2>&1 && HAS_SSH=1 176 | else 177 | # timeout is a recent-ish addition to GNU coreutils - this solution cribbed from: 178 | # https://stackoverflow.com/questions/4922943/how-to-test-if-remote-tcp-port-is-opened-from-shell-script 179 | timeout 1 bash -c "cat < /dev/null > /dev/tcp/${IP}/${SSH_PORT}" && HAS_SSH=1 180 | fi 181 | 182 | if [ $HAS_SSH -eq 0 ]; then 183 | printf "\nThe system at ${IP} doesn't seem to be accepting connections on port ${SSH_PORT}." 184 | printf "\nDoes the Raspbery Pi have SSH enabled on port ${SSH_PORT}?\n" 185 | exit 1 186 | fi 187 | 188 | ssh -t -p $SSH_PORT $USER_NAME@$IP $SSH_OPTS "$COMMAND" 189 | -------------------------------------------------------------------------------- /install-pin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat << "EOF" 4 | .` 5 | -dMMs 6 | +MMMMMo 7 | .dMMMMMMN- 8 | +NMMMMMMMMd` 9 | `hMMMMMMMMMMMo 10 | -mMMMMMMMMMMMMN. 11 | dMMMMMMMMMMMMMMo 12 | :hmmmmmmmmmmmmdhs/. `MMMMMMMMMMMMMMMh 13 | sMMMMMMMMMMMMMMMMMMd+NMMMMMMMMMMMMMM+ 14 | /NMMMMMMMMMMMMMMMMMMMMMMMMs+NMMMMMm/+syyyso/-` 15 | `hMMMMMMMMMMMMMMMMMMMMMMo hMMMMMMMMMMMMMMMMMNhs+:. 16 | /NMMMMMMMMMMMNmmNMMMMN. `mMMMMMMMMMMMMMMMMMMMMMMMNh- 17 | .hMMMMMMMMMMh` `-sNMMs-hMMMMMMMMMMMMMMMMMMMMMMMMMM+ 18 | /mMMMMMMMMMNy+-./MMMMMMy:....oMMMMMMMMMMMMMMMNo. 19 | :ymMMMMMMMMMMMMMMMMMNy//oymMMMMMMMMMMMMMNy: 20 | .yMMMMMMMms:oMMNhNMMMMMMMMMMMMMMMMNh/` 21 | .yMMMMMMMN/ .dMMy `sMMMMMMMMMMMNmy/` 22 | /NMMMMMMMM:`-sMMMMM: sMMMMMMs-..` 23 | -NMMMMMMMMMNNMMMMMMMMs./MMMMMMMh` 24 | mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs 25 | sMMMMMMMMMMMMMMMMhMMMMMMMMMMMMMMMN 26 | :MMMMMMMMMMMMMMMN+ hMMMMMMMMMMMMMMN. 27 | `dMMMMMMMMMMMMNh/` `hMMMMMMMMMMMMMN. 28 | /MMMMMMMMmhs+- /dMMMMMMMMMMMN. 29 | .hmdys/- -sNMMMMMMMMN. 30 | `:hNMMMMMN. 31 | `+dMMMN` 32 | ./+- 33 | occidentalis bootstrap 34 | by adafruit 35 | 36 | EOF 37 | 38 | sleep 2 39 | 40 | if grep -Fq "adafruit" /etc/apt/sources.list; then 41 | echo "adafruit repo already added to apt sources" 42 | else 43 | # add apt repo to sources.list 44 | if grep -q "8.0" "/etc/debian_version"; then 45 | echo "deb http://apt.adafruit.com/raspbian/ jessie main" >> /etc/apt/sources.list 46 | else 47 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 48 | fi 49 | 50 | # import repo key 51 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 52 | fi 53 | 54 | # pin apt.adafruit.com origin for anything installed there: 55 | if [ ! -f /etc/apt/preferences.d/adafruit ]; then 56 | echo "pinning apt.adafruit.com origin" 57 | echo "edit /etc/apt/preferences.d/adafruit to change" 58 | echo -e "Package: *\nPin: origin \"apt.adafruit.com\"\nPin-Priority: 1001" > /etc/apt/preferences.d/adafruit 59 | else 60 | echo "/etc/apt/preferences.d/adafruit already exists - leaving alone" 61 | fi 62 | 63 | # update package database 64 | apt-get update 65 | 66 | # stop asking me questions 67 | export DEBIAN_FRONTEND=noninteractive 68 | 69 | uptodate=$(apt-show-versions occidentalis | grep uptodate) 70 | 71 | if [ "$uptodate" = "" ]; then 72 | # install 73 | echo "**** Installing the latest version of occidentalis ****" 74 | apt-get -y install occidentalis 75 | else 76 | # up to date, but rerun postinst 77 | echo "**** Occidentalis is up to date. Reloading configuration ****" 78 | dpkg-reconfigure -f noninteractive occidentalis 79 | fi 80 | 81 | echo "BOOTSTRAP COMPLETE!!!" 82 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat << "EOF" 4 | .` 5 | -dMMs 6 | +MMMMMo 7 | .dMMMMMMN- 8 | +NMMMMMMMMd` 9 | `hMMMMMMMMMMMo 10 | -mMMMMMMMMMMMMN. 11 | dMMMMMMMMMMMMMMo 12 | :hmmmmmmmmmmmmdhs/. `MMMMMMMMMMMMMMMh 13 | sMMMMMMMMMMMMMMMMMMd+NMMMMMMMMMMMMMM+ 14 | /NMMMMMMMMMMMMMMMMMMMMMMMMs+NMMMMMm/+syyyso/-` 15 | `hMMMMMMMMMMMMMMMMMMMMMMo hMMMMMMMMMMMMMMMMMNhs+:. 16 | /NMMMMMMMMMMMNmmNMMMMN. `mMMMMMMMMMMMMMMMMMMMMMMMNh- 17 | .hMMMMMMMMMMh` `-sNMMs-hMMMMMMMMMMMMMMMMMMMMMMMMMM+ 18 | /mMMMMMMMMMNy+-./MMMMMMy:....oMMMMMMMMMMMMMMMNo. 19 | :ymMMMMMMMMMMMMMMMMMNy//oymMMMMMMMMMMMMMNy: 20 | .yMMMMMMMms:oMMNhNMMMMMMMMMMMMMMMMNh/` 21 | .yMMMMMMMN/ .dMMy `sMMMMMMMMMMMNmy/` 22 | /NMMMMMMMM:`-sMMMMM: sMMMMMMs-..` 23 | -NMMMMMMMMMNNMMMMMMMMs./MMMMMMMh` 24 | mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs 25 | sMMMMMMMMMMMMMMMMhMMMMMMMMMMMMMMMN 26 | :MMMMMMMMMMMMMMMN+ hMMMMMMMMMMMMMMN. 27 | `dMMMMMMMMMMMMNh/` `hMMMMMMMMMMMMMN. 28 | /MMMMMMMMmhs+- /dMMMMMMMMMMMN. 29 | .hmdys/- -sNMMMMMMMMN. 30 | `:hNMMMMMN. 31 | `+dMMMN` 32 | ./+- 33 | occidentalis bootstrap 34 | by adafruit 35 | 36 | EOF 37 | 38 | sleep 2 39 | 40 | if grep -Fq "adafruit" /etc/apt/sources.list; then 41 | echo "adafruit repo already added to apt sources" 42 | else 43 | # add apt repo to sources.list 44 | if grep -q "8.0" "/etc/debian_version"; then 45 | echo "deb http://apt.adafruit.com/raspbian/ jessie main" >> /etc/apt/sources.list 46 | else 47 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 48 | fi 49 | 50 | # import repo key 51 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 52 | fi 53 | 54 | # update package database 55 | apt-get update 56 | 57 | # stop asking me questions 58 | export DEBIAN_FRONTEND=noninteractive 59 | 60 | uptodate=$(apt-show-versions occidentalis | grep uptodate) 61 | 62 | if [ "$uptodate" = "" ]; then 63 | # install 64 | echo "**** Installing the latest version of occidentalis ****" 65 | apt-get -y install occidentalis 66 | else 67 | # up to date, but rerun postinst 68 | echo "**** Occidentalis is up to date. Reloading configuration ****" 69 | dpkg-reconfigure -f noninteractive occidentalis 70 | fi 71 | 72 | echo "BOOTSTRAP COMPLETE!!!" 73 | -------------------------------------------------------------------------------- /logo.txt: -------------------------------------------------------------------------------- 1 | ▄▄ 2 | ▄████ 3 | ▄███████ 4 | █████████▌ 5 | ███████████ 6 | ████████████▌ 7 | ███████████████▄ ████████████▌ 8 | █████████████████████▀▀█████ ▄▄▄▄▄▄▄ 9 | ▐██████████████████ █████████████████▄▄ 10 | ▀█████████ ▀▀███ ██████████████████████ 11 | █████████▄▄ ▐████▀ ▐█████████████▀ 12 | ▀▀███████████████▄▄█████████████▀ 13 | ▄███████ ██ ▀████████████▀ 14 | ███████▀ ▄████ ▐█████▄ 15 | █████████████████▄▄██████▄ 16 | ███████████████████████████ 17 | ██████████████ ▐████████████▌ 18 | ▐██████████▀▀ ▀███████████▌ 19 | █████▀▀ ▀█████████▌ 20 | ▀██████ 21 | ▀███ 22 | ------------------------------------------------------------- 23 | - apt.adafruit.com - 24 | - adafruit raspbian repository - 25 | ------------------------------------------------------------- 26 | -------------------------------------------------------------------------------- /packages/Makefile: -------------------------------------------------------------------------------- 1 | occi_stuff = $(shell find occi) 2 | occidentalis_stuff = $(shell find occidentalis) 3 | pitft_stuff = $(shell find adafruit-pitft-helper_TEMPLATE) 4 | externalroot_stuff = $(shell find adafruit-pi-externalroot-helper) 5 | ap_stuff = $(shell find adafruit-ap) 6 | gif_stuff = $(shell find adafruit-io-gif) 7 | 8 | OCCIDENTALIS_VERSION := $(shell head -1 occidentalis/DEBIAN/changelog | sed 's/.*(//;s/).*//;') 9 | OCCI_VERSION := $(shell head -1 occi/DEBIAN/changelog | sed 's/.*(//;s/).*//;') 10 | EXTERNALROOT_VERSION := $(shell head -1 adafruit-pi-externalroot-helper/debian/changelog | sed 's/.*(//;s/).*//;') 11 | AP_VERSION := $(shell head -1 adafruit-ap/DEBIAN/changelog | sed 's/.*(//;s/).*//;') 12 | GIF_VERSION := $(shell head -1 adafruit-io-gif/DEBIAN/changelog | sed 's/.*(//;s/).*//;') 13 | 14 | PITFT_PACKAGE_VERSION := $(shell head -1 adafruit-pitft-helper_TEMPLATE/debian/changelog | sed 's/.*(//;s/).*//;') 15 | # the Perl line just gets the Adafruit-PiTFT-Helper version minus the -whatever 16 | PITFT_VERSION := $(shell head -1 adafruit-pitft-helper_TEMPLATE/debian/changelog | perl -pe 's{ .* \( (.+) [-] \d+ \) .* }{\1}x;') 17 | 18 | all: build/adafruit-ap_${AP_VERSION}_armhf.deb build/occi_${OCCI_VERSION}_armhf.deb build/occidentalis_${OCCIDENTALIS_VERSION}_armhf.deb build/adafruit-pitft-helper_${PITFT_PACKAGE_VERSION}_armhf.deb build/adafruit-io-gif_${GIF_VERSION}_armhf.deb build/adafruit-pi-externalroot-helper_${EXTERNALROOT_VERSION}_armhf.deb 19 | 20 | build/occi_${OCCI_VERSION}_armhf.deb: ${occi_stuff} 21 | gzip occi/DEBIAN/changelog --best -c > occi/usr/share/doc/occi/changelog.gz 22 | pod2man occi/usr/bin/occi | gzip --best -c > occi/usr/share/man/man1/occi.1.gz 23 | fakeroot dpkg-deb -b occi build/occi_${OCCI_VERSION}_armhf.deb 24 | 25 | build/occidentalis_${OCCIDENTALIS_VERSION}_armhf.deb: ${occidentalis_stuff} 26 | gzip occidentalis/DEBIAN/changelog --best -c > occidentalis/usr/share/doc/occidentalis/changelog.gz 27 | fakeroot dpkg-deb -b occidentalis build/occidentalis_${OCCIDENTALIS_VERSION}_armhf.deb 28 | 29 | build/adafruit-ap_${AP_VERSION}_armhf.deb: ${ap_stuff} 30 | gzip adafruit-ap/DEBIAN/changelog --best -c > adafruit-ap/usr/share/doc/adafruit-ap/changelog.gz 31 | fakeroot dpkg-deb -b adafruit-ap build/adafruit-ap_${AP_VERSION}_armhf.deb 32 | 33 | build/adafruit-io-gif_${GIF_VERSION}_armhf.deb: ${gif_stuff} 34 | gzip adafruit-io-gif/DEBIAN/changelog --best -c > adafruit-io-gif/usr/share/doc/adafruit-io-gif/changelog.gz 35 | fakeroot dpkg-deb -b adafruit-io-gif build/adafruit-io-gif_${GIF_VERSION}_armhf.deb 36 | 37 | # I'm sorry 38 | build/adafruit-pitft-helper_${PITFT_PACKAGE_VERSION}_armhf.deb: ${pitft_stuff} 39 | mkdir -p adafruit-pitft-helper 40 | rm -r adafruit-pitft-helper 41 | mkdir adafruit-pitft-helper 42 | cd adafruit-pitft-helper && wget https://github.com/adafruit/Adafruit-PiTFT-Helper/archive/master.tar.gz -O adafruit-pitft-helper_${PITFT_VERSION}.orig.tar.gz 43 | cd adafruit-pitft-helper && tar xvzf adafruit-pitft-helper_${PITFT_VERSION}.orig.tar.gz 44 | cd adafruit-pitft-helper && mv Adafruit-PiTFT-Helper-master adafruit-pitft-helper_${PITFT_VERSION} 45 | cp -r adafruit-pitft-helper_TEMPLATE/debian adafruit-pitft-helper/adafruit-pitft-helper_${PITFT_VERSION}/ 46 | cd adafruit-pitft-helper/adafruit-pitft-helper_${PITFT_VERSION} && debuild -b -aarmhf -uc -us 47 | mv ./adafruit-pitft-helper/*.deb build/ 48 | rm -r adafruit-pitft-helper 49 | 50 | build/adafruit-pi-externalroot-helper_${EXTERNALROOT_VERSION}_armhf.deb: ${externalroot_stuff} 51 | mkdir -p erbuild 52 | rm -r erbuild 53 | mkdir erbuild 54 | cp -r adafruit-pi-externalroot-helper erbuild/adafruit-pi-externalroot-helper_${EXTERNALROOT_VERSION} 55 | cd erbuild/adafruit-pi-externalroot-helper_${EXTERNALROOT_VERSION} && debuild -b -aarmhf -uc -us 56 | mv ./erbuild/*.deb build/ 57 | rm -r erbuild 58 | 59 | clean: 60 | $(RM) build/* 61 | -------------------------------------------------------------------------------- /packages/README.md: -------------------------------------------------------------------------------- 1 | # Debian Packages 2 | 3 | ## Building 4 | 5 | You can build individual packages something like: 6 | 7 | fakeroot dpkg-deb -b occidentalis build/occidentalis_0.3.1_armhf.deb 8 | 9 | (Replace `0.3.1` with the version you are building, and make sure your 10 | build target is in the `build` folder.) 11 | 12 | `fakeroot` is useful because otherwise you wind up with incorrect ownership 13 | of paths in the built package. 14 | 15 | The included `Makefile` should build packages for both the main occidentalis 16 | package and the `occi` configuration helper, though version numbers still have 17 | to be manually tweaked when changed at the moment. 18 | 19 | ## lintian 20 | 21 | You can check built packages with lintian (`sudo apt-get install lintian` if 22 | needed): 23 | 24 | pi@pifoo ~/code/pi_bootstrap/packages $ lintian build/occi_0.1.3_armhf.deb 25 | W: occi: syntax-error-in-debian-changelog line 3 "unrecognised line" 26 | W: occi: syntax-error-in-debian-changelog line 4 "unrecognised line" 27 | W: occi: unknown-control-file changelog 28 | E: occi: no-copyright-file 29 | W: occi: description-starts-with-leading-spaces 30 | W: occi: unknown-section base 31 | E: occi: postrm-does-not-call-updaterc.d-for-init.d-script etc/init.d/occi 32 | E: occi: init.d-script-missing-dependency-on-remote_fs etc/init.d/occi: required-stop 33 | W: occi: binary-without-manpage usr/bin/occi 34 | W: occi: maintainer-script-ignores-errors postinst 35 | 36 | In practice, a lot of this stuff (even the more-severe looking bits) doesn't 37 | seem to break much, but we should nevertheless clean it up. 38 | -------------------------------------------------------------------------------- /packages/adafruit-ap/DEBIAN/changelog: -------------------------------------------------------------------------------- 1 | adafruit-ap (0.1.7-1) unstable; urgency=low 2 | 3 | * restart networking and bring eth0 up 4 | 5 | -- Todd Treece Wed, 11 Mar 2015 21:56:38 +0000 6 | 7 | adafruit-ap (0.1.6-1) unstable; urgency=low 8 | 9 | * drop state from iptables commands 10 | 11 | -- Todd Treece Wed, 11 Mar 2015 19:49:33 +0000 12 | 13 | adafruit-ap (0.1.5-1) unstable; urgency=low 14 | 15 | * Start on boot by default 16 | 17 | -- Todd Treece Wed, 11 Mar 2015 17:15:35 +0000 18 | 19 | adafruit-ap (0.1.4-1) unstable; urgency=low 20 | 21 | * Change iptable commands in init.d script 22 | 23 | -- Todd Treece Wed, 11 Mar 2015 16:43:14 +0000 24 | 25 | adafruit-ap (0.1.3-1) unstable; urgency=low 26 | 27 | * Adds init script 28 | 29 | -- Tue, 10 Mar 2015 15:53:15 +0000 30 | 31 | adafruit-ap (0.1.2-1) unstable; urgency=low 32 | 33 | * Fix dpkg "trying to overwrite" errors 34 | 35 | -- Tue, 10 Mar 2015 15:53:15 +0000 36 | 37 | adafruit-ap (0.1.1-1) unstable; urgency=low 38 | 39 | * Fix dpkg error related to hostapd binary 40 | 41 | -- Todd Treece Tue, 10 Mar 2015 15:42:29 +0000 42 | 43 | adafruit-ap (0.1.0-1) unstable; urgency=low 44 | 45 | * Initial release. 46 | 47 | -- Todd Treece Tue, 10 Mar 2015 15:29:42 +0000 48 | 49 | -------------------------------------------------------------------------------- /packages/adafruit-ap/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: adafruit-ap 2 | Version: 0.1.7-1 3 | Section: base 4 | Priority: optional 5 | Architecture: armhf 6 | Depends: hostapd, isc-dhcp-server 7 | Maintainer: Todd Treece 8 | Description: Adafruit Raspberry Pi Access Point 9 | A package that makes it easy to setup 10 | a Raspberry Pi as a WiFi access point 11 | -------------------------------------------------------------------------------- /packages/adafruit-ap/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | service isc-dhcp-server stop 4 | service hostapd stop 5 | 6 | # disable on boot 7 | update-rc.d -f hostapd remove 8 | update-rc.d -f isc-dhcp-server remove 9 | 10 | # backups 11 | mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig 12 | mv /etc/default/isc-dhcp-server /etc/default/isc-dhcp-server.orig 13 | cp /etc/sysctl.conf /etc/sysctl.conf.orig 14 | mv /etc/default/hostapd /etc/default/hostapd.orig 15 | mv /usr/sbin/hostapd /usr/sbin/hostapd.orig 16 | mv /etc/network/interfaces /etc/network/interfaces.orig 17 | mv /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.orig 18 | rm /etc/init.d/adafruit-ap 19 | 20 | cp /etc/adafruit-ap/dhcpd.conf /etc/dhcp/dhcpd.conf 21 | cp /etc/adafruit-ap/isc-dhcp-server /etc/default/isc-dhcp-server 22 | cp /etc/adafruit-ap/hostapd /etc/default/hostapd 23 | cp /etc/adafruit-ap/hostapd-replacement /usr/sbin/hostapd 24 | cp /etc/adafruit-ap/interfaces.ap /etc/network/interfaces 25 | cp /etc/adafruit-ap/adafruit-ap /etc/init.d/adafruit-ap 26 | 27 | SSID="Pi_AP" 28 | PASS="raspberry" 29 | 30 | get_ssid() { 31 | 32 | read -e -p "Enter the WiFi SSID: " -i $SSID SSID 33 | 34 | if [ ${#SSID} -lt 1 ] || [ ${#SSID} -gt 32 ]; then 35 | echo "WiFi SSID must be 1..32 characters"; 36 | get_ssid; 37 | fi 38 | 39 | } 40 | 41 | get_pass() { 42 | 43 | read -e -p "Enter the WiFi Passphrase: " -i $PASS PASS 44 | 45 | if [ ${#PASS} -lt 8 ] || [ ${#PASS} -gt 63 ]; then 46 | echo "WiFi Passphrase must be 8..63 characters"; 47 | get_pass; 48 | fi 49 | 50 | } 51 | 52 | get_ssid; 53 | get_pass; 54 | 55 | cat < /etc/hostapd/hostapd.conf 56 | interface=wlan0 57 | driver=rtl871xdrv 58 | ssid=$SSID 59 | hw_mode=g 60 | channel=6 61 | macaddr_acl=0 62 | auth_algs=1 63 | ignore_broadcast_ssid=0 64 | wpa=2 65 | wpa_passphrase=$PASS 66 | wpa_key_mgmt=WPA-PSK 67 | wpa_pairwise=TKIP 68 | rsn_pairwise=CCMP 69 | EOF 70 | 71 | service adafruit-ap start 72 | update-rc.d adafruit-ap defaults 73 | -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/adafruit-ap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ### BEGIN INIT INFO 3 | # Provides: adafruit-ap 4 | # Required-Start: $local_fs $network $named $time $syslog 5 | # Required-Stop: $local_fs $network $named $time $syslog 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: Start and stop adafruit-ap 9 | # Description: Enable access point 10 | ### END INIT INFO 11 | 12 | ada_ap_off () { 13 | 14 | service isc-dhcp-server stop 15 | service hostapd stop 16 | 17 | rm /etc/network/interfaces 18 | cp /etc/network/interfaces.orig /etc/network/interfaces 19 | 20 | echo 0 > /proc/sys/net/ipv4/ip_forward 21 | iptables -t nat -D POSTROUTING -s 192.168.0.0/16 -o eth0 -j MASQUERADE 2>/dev/null 22 | 23 | ip addr flush dev wlan0 24 | service networking restart 25 | ifup eth0 26 | 27 | } 28 | 29 | ada_ap_on () { 30 | 31 | ada_ap_off 32 | 33 | ip addr flush dev wlan0 34 | ip link set dev wlan0 up 35 | ip address add 192.168.42.1/24 dev wlan0 36 | 37 | rm /etc/network/interfaces 38 | cp /etc/adafruit-ap/interfaces.ap /etc/network/interfaces 39 | 40 | echo 1 > /proc/sys/net/ipv4/ip_forward 41 | iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o eth0 -j MASQUERADE 42 | 43 | service hostapd start 44 | service isc-dhcp-server start 45 | 46 | } 47 | 48 | case "$1" in 49 | start) ada_ap_on ;; 50 | stop) ada_ap_off ;; 51 | esac 52 | -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/dhcpd.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Generated by the adafruit-ap package 3 | # Default conf file can be found at /etc/dhcp/dhcp.conf.orig 4 | # 5 | ddns-update-style none; 6 | authoritative; 7 | log-facility local7; 8 | 9 | subnet 192.168.42.0 netmask 255.255.255.0 { 10 | range 192.168.42.10 192.168.42.50; 11 | option broadcast-address 192.168.42.255; 12 | option routers 192.168.42.1; 13 | option domain-name "local"; 14 | option domain-name-servers 8.8.8.8, 8.8.4.4; 15 | } 16 | -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/hostapd: -------------------------------------------------------------------------------- 1 | # 2 | # generated by the adafruit-ap package 3 | # the default version of this file can be found 4 | # at /etc/defaults/hostapd.orig 5 | # 6 | DAEMON_CONF="/etc/hostapd/hostapd.conf" 7 | -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/hostapd-replacement: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit-Occidentalis/115173db410886eed029ebcce3414b6f5b01950f/packages/adafruit-ap/etc/adafruit-ap/hostapd-replacement -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/interfaces.ap: -------------------------------------------------------------------------------- 1 | auto lo 2 | auto eth0 3 | 4 | iface lo inet loopback 5 | iface eth0 inet dhcp 6 | 7 | auto wlan0 8 | iface wlan0 inet static 9 | address 192.168.42.1 10 | netmask 255.255.255.0 11 | 12 | -------------------------------------------------------------------------------- /packages/adafruit-ap/etc/adafruit-ap/isc-dhcp-server: -------------------------------------------------------------------------------- 1 | # 2 | # generated by the adafruit-ap package 3 | # the default version can be found at /etc/default/isc-dhcp-server.orig 4 | # 5 | DHCPD_CONF="/etc/dhcp/dhcpd.conf" 6 | INTERFACES="wlan0" 7 | -------------------------------------------------------------------------------- /packages/adafruit-ap/usr/share/doc/adafruit-ap/changelog.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit-Occidentalis/115173db410886eed029ebcce3414b6f5b01950f/packages/adafruit-ap/usr/share/doc/adafruit-ap/changelog.gz -------------------------------------------------------------------------------- /packages/adafruit-io-gif/DEBIAN/changelog: -------------------------------------------------------------------------------- 1 | adafruit-io-gif (0.2.4) unstable; urgency=low 2 | 3 | * Bump aio_gif version to 1.1.1 4 | 5 | -- Todd Treece Tue, 17 Mar 2015 21:29:42 +0000 6 | 7 | adafruit-io-gif (0.2.3) unstable; urgency=low 8 | 9 | * Support existing X session 10 | 11 | -- Todd Treece Tue, 10 Mar 2015 21:29:42 +0000 12 | 13 | adafruit-io-gif (0.2.2) unstable; urgency=low 14 | 15 | * Adds xdotool dependency 16 | 17 | -- Todd Treece Tue, 10 Mar 2015 20:29:42 +0000 18 | 19 | adafruit-io-gif (0.2.1) unstable; urgency=low 20 | 21 | * Fixes aio_gif start bug 22 | 23 | -- Todd Treece Tue, 10 Mar 2015 19:29:42 +0000 24 | 25 | adafruit-io-gif (0.2.0) unstable; urgency=low 26 | 27 | * Remove init script 28 | * Up gpu memory in boot/config.txt 29 | 30 | -- Todd Treece Tue, 10 Mar 2015 18:29:42 +0000 31 | 32 | adafruit-io-gif (0.1.0) unstable; urgency=low 33 | 34 | * Initial release. 35 | 36 | -- Todd Treece Tue, 10 Mar 2015 15:29:42 +0000 37 | 38 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: adafruit-io-gif 2 | Version: 0.2.4 3 | Section: misc 4 | Priority: optional 5 | Architecture: armhf 6 | Depends: midori, node (>= 0.12.0), matchbox, xdotool 7 | Maintainer: Todd Treece 8 | Description: adafruit.io gif client 9 | This package will attach to adafruit.io 10 | and display full screen animated gifs 11 | pushed from an adafruit.io feed on a 12 | display of your choosing. 13 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | FEED="GIF" 4 | 5 | read -e -p "Enter your adafruit.io Key: " KEY 6 | read -e -p "Enter your adafruit.io Feed Name: " -i $FEED FEED 7 | 8 | cat < /etc/adafruit-io-gif/server.conf 9 | AIO_KEY=${KEY} 10 | AIO_FEED=${FEED} 11 | HTTP_PORT=8080 12 | DISPLAY=:0 13 | EOF 14 | 15 | # up gpu memory 16 | sed -i /boot/config.txt -e "/^gpu_mem=/c gpu_mem=256" 17 | if ! grep -Fq "gpu_mem" /boot/config.txt; then 18 | echo "gpu_mem=256" >> /boot/config.txt 19 | fi 20 | 21 | # turn off screen blanking 22 | cp -n /etc/kbd/config{,.orig} 23 | sed -i /etc/kbd/config -e "/BLANK_TIME=/c BLANK_TIME=0" 24 | 25 | # turn off screen blanking 26 | cp -n /etc/X11/xinit/xinitrc{,.orig} 27 | if ! grep -Fq "noblank" /etc/X11/xinit/xinitrc; then 28 | echo "xset s off" >> /etc/X11/xinit/xinitrc 29 | echo "xset -dpms" >> /etc/X11/xinit/xinitrc 30 | echo "xset s noblank" >> /etc/X11/xinit/xinitrc 31 | fi 32 | 33 | # turn off screen blanking 34 | cp -n /etc/xdg/lxsession/LXDE/autostart{,.orig} 35 | sed -i /etc/xdg/lxsession/LXDE/autostart -e "/^@xscreensaver -no-splash/c # @xscreensaver -no-splash" 36 | if ! grep -Fq "noblank" /etc/xdg/lxsession/LXDE/autostart; then 37 | echo "@xset s off" >> /etc/xdg/lxsession/LXDE/autostart 38 | echo "@xset -dpms" >> /etc/xdg/lxsession/LXDE/autostart 39 | echo "@xset s noblank" >> /etc/xdg/lxsession/LXDE/autostart 40 | fi 41 | 42 | # turn off screen blanking only in defaults 43 | cp -n /etc/lightdm/lightdm.conf{,.orig} 44 | sed -i /etc/lightdm/lightdm.conf -e '/^\[SeatDefaults\]/,/^\[/ s/.*xserver-command.*/xserver-command=X -s 0 -dpms/' 45 | 46 | cd /etc/adafruit-io-gif/node_source 47 | npm install 48 | npm install -g forever 49 | 50 | echo "GPU MEMORY UPDATED TO 256. REBOOT REQUIRED" 51 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/etc/adafruit-io-gif/node_source/README.md: -------------------------------------------------------------------------------- 1 | nothing to see here 2 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/etc/adafruit-io-gif/node_source/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var gif = require('aio_gif'), 4 | dotenv = require('dotenv'), 5 | path = require('path') 6 | spawn = require('child_process').spawn; 7 | 8 | var config = path.join(__dirname, '..', 'server.conf'); 9 | 10 | dotenv._getKeysAndValuesFromEnvFilePath(config); 11 | dotenv._setEnvs(); 12 | 13 | var server = gif({ 14 | key: process.env.AIO_KEY.trim(), 15 | feed: process.env.AIO_FEED.trim(), 16 | port: process.env.HTTP_PORT 17 | }); 18 | 19 | console.log('Starting HTTP server on http://localhost:%d', process.env.HTTP_PORT); 20 | 21 | server.on('error', console.error.bind(this, 'GIF Server Error')); 22 | 23 | server.on('image', function() { 24 | spawn('/usr/bin/aio_gif', ['refresh']); 25 | }); 26 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/etc/adafruit-io-gif/node_source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gif_viewer", 3 | "version": "1.0.0", 4 | "description": "adafruit io gif viewer", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type" : "git", 11 | "url" : "https://github.com/adafruit/Adafruit-Occidentalis.git" 12 | }, 13 | "keywords": [ 14 | "adafruit" 15 | ], 16 | "author": "Todd Treece ", 17 | "license": "MIT", 18 | "dependencies": { 19 | "aio_gif": "^1.1.1", 20 | "dotenv": "^0.5.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/etc/adafruit-io-gif/xinit_script: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /etc/adafruit-io-gif/server.conf 4 | 5 | export DISPLAY 6 | 7 | xset -dpms 8 | xset s off 9 | xset s noblank 10 | 11 | matchbox-window-manager -use_titlebar no -use_cursor no & midori -e Fullscreen -a http://localhost:$HTTP_PORT 12 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/usr/bin/aio_gif: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$1" == "start" ]; then 4 | 5 | echo "Starting GIF server..." 6 | 7 | forever start /etc/adafruit-io-gif/node_source/index.js &>/dev/null 8 | sleep 5 9 | 10 | X=$( pidof X ) 11 | if [ ${#X} -gt 0 ]; then 12 | 13 | if [ -n "$DISPLAY" ]; then 14 | source /etc/adafruit-io-gif/server.conf 15 | export DISPLAY 16 | else 17 | source /etc/adafruit-io-gif/server.conf 18 | fi 19 | 20 | nohup midori -e Fullscreen -a http://localhost:$HTTP_PORT >/dev/null 2>&1 & 21 | 22 | else 23 | nohup xinit /etc/adafruit-io-gif/xinit_script >/dev/null 2>&1 & 24 | fi 25 | 26 | fi 27 | 28 | if [ "$1" == "stop" ]; then 29 | 30 | echo "Stopping GIF server..." 31 | forever stop /etc/adafruit-io-gif/node_source/index.js &>/dev/null 32 | 33 | killall midori 2>/dev/null; 34 | killall matchbox-window-manager 2>/dev/null; 35 | 36 | fi 37 | 38 | if [ "$1" == "refresh" ]; then 39 | 40 | source /etc/adafruit-io-gif/server.conf 41 | export DISPLAY 42 | 43 | xdotool getactivewindow 44 | xdotool key F5 45 | 46 | fi 47 | -------------------------------------------------------------------------------- /packages/adafruit-io-gif/usr/share/doc/adafruit-io-gif/changelog.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit-Occidentalis/115173db410886eed029ebcce3414b6f5b01950f/packages/adafruit-io-gif/usr/share/doc/adafruit-io-gif/changelog.gz -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Adafruit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/README.md: -------------------------------------------------------------------------------- 1 | Adafruit-Pi-ExternalRoot-helper 2 | =============================== 3 | 4 | A shell script for configuring an external USB drive as root filesystem 5 | on a Raspberry Pi running Raspbian. It's a companion to [Using an 6 | External Drive as a Raspberry Pi Root Filesystem][tutorial], which you 7 | should read first. 8 | 9 | Using adafruit-pi-externalroot-helper 10 | ------------------------------------- 11 | 12 | First, read the [tutorial][tutorial]. 13 | 14 | On a Raspberry Pi running Raspbian, with a USB-connected storage device you 15 | wish to use for your root filesystem: 16 | 17 | git clone git@github.com:adafruit/Adafruit-Pi-ExternalRoot-Helper.git 18 | cd Adafruit-Pi-ExternalRoot-Helper 19 | sudo ./adafruit-pi-externalroot-helper -d /dev/sda 20 | 21 | ...where `/dev/sda` is the external USB you wish to use for a root filesystem. 22 | 23 | Sources and Further Reading 24 | --------------------------- 25 | 26 | This script is mostly an implementation of the process outlined in paulv's 27 | [HOWTO: Move the filesystem to a USB stick][1] on the Raspberry Pi forums, with 28 | additional help from the following sources: 29 | 30 | - The Arch Linux wiki, [GUID Partition Table][2] for what a GPT is and 31 | some `parted` commands. 32 | - [GUID Partition Table][wp], Wikipedia 33 | - [Booting from an external USB drive][3], from the Raspberry Pi StackExchange. 34 | - [Booting a Raspberry Pi reliably from USB in the presence of multiple USB drives][4], 35 | by Stefan Krastanov. 36 | - [Speed up your Pi by booting to a USB flash drive][5], by Sam Hobbs. 37 | - [This comment][6] on `root=` in `init/do_mounts.c` in the Linux source tree. 38 | 39 | Along with manual / info pages for: 40 | 41 | - [gdisk](http://manpages.debian.org/cgi-bin/man.cgi?query=gdisk&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en) 42 | - [parted](http://manpages.debian.org/cgi-bin/man.cgi?query=parted&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en) 43 | - [blkid](http://manpages.debian.org/cgi-bin/man.cgi?query=blkid&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en) 44 | - [mkfs](http://manpages.debian.org/cgi-bin/man.cgi?query=mkfs&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en) 45 | - [tune2fs](http://manpages.debian.org/cgi-bin/man.cgi?query=tune2fs&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en) 46 | 47 | [1]: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=44177 48 | [2]: https://wiki.archlinux.org/index.php/GUID_Partition_Table 49 | [3]: http://raspberrypi.stackexchange.com/questions/12404/booting-from-an-external-usb-drive 50 | [4]: http://blog.krastanov.org/2014/01/30/booting-pi-reliably-from-usb/ 51 | [5]: https://samhobbs.co.uk/2013/10/speed-up-your-pi-by-booting-to-a-usb-flash-drive 52 | [wp]: https://en.wikipedia.org/wiki/GUID_Partition_Table 53 | [6]: https://github.com/torvalds/linux/blob/10975933da3d65f8833d4ce98dcc2ecc63a695d6/init/do_mounts.c#L183 54 | [tutorial]: https://learn.adafruit.com/external-drive-as-raspberry-pi-root 55 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/adafruit-pi-externalroot-helper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # adafruit-pi-externalroot-helper 4 | # 5 | # Configure a Raspbian system to use an external USB drive as root filesystem. 6 | # 7 | # See README.md for details and sources. 8 | 9 | set -e 10 | 11 | function print_version() { 12 | echo "Adafruit Pi External Root Helper v0.1.0" 13 | exit 1 14 | } 15 | 16 | function print_help() { 17 | echo "Usage: $0 -d [target device]" 18 | echo " -h Print this help" 19 | echo " -v Print version information" 20 | echo " -d [device] Specify path of device to convert to root" 21 | echo 22 | echo "You must specify a device. See:" 23 | echo "https://learn.adafruit.com/external-drive-as-raspberry-pi-root" 24 | exit 1 25 | } 26 | 27 | 28 | # Display an error message and quit: 29 | function bail() { 30 | FG="1;31m" 31 | BG="40m" 32 | echo -en "[\033[${FG}\033[${BG}error\033[0m] " 33 | echo "$*" 34 | exit 1 35 | } 36 | 37 | # Display an info message: 38 | function info() { 39 | task="$1" 40 | shift 41 | FG="1;32m" 42 | BG="40m" 43 | echo -e "[\033[${FG}\033[${BG}${task}\033[0m] $*" 44 | } 45 | 46 | if [[ $EUID -ne 0 ]]; then 47 | bail "must be run as root. try: sudo adafruit-pi-externalroot-helper" 48 | fi 49 | 50 | # Handle arguments: 51 | args=$(getopt -uo 'hvd:' -- $*) 52 | [ $? != 0 ] && print_help 53 | set -- $args 54 | 55 | for i 56 | do 57 | case "$i" 58 | in 59 | -h) 60 | print_help 61 | ;; 62 | -v) 63 | print_version 64 | ;; 65 | -d) 66 | target_drive="$2" 67 | echo "Target drive = ${2}" 68 | shift 69 | shift 70 | ;; 71 | esac 72 | done 73 | 74 | if [[ ! -e "$target_drive" ]]; then 75 | bail "Target ${target_drive} must be existing device (use -d /dev/foo to specify)" 76 | fi 77 | 78 | info "start" "Will create new ext4 filesystem on ${target_drive}" 79 | info "start" "If there is data on ${target_drive}, it will be lost." 80 | read -p "Really proceed? (y)es / (n)o " -n 1 -r 81 | echo 82 | if [[ ! $REPLY =~ ^[Yy]$ ]] 83 | then 84 | echo "Quitting." 85 | exit 86 | fi 87 | 88 | export target_partition="${target_drive}1" 89 | 90 | info "dependencies" "Installing gdisk, rsync, and parted." 91 | # All except gdisk are probably installed, but let's make sure. 92 | apt-get install gdisk rsync parted 93 | 94 | info "fs create" "Creating ${target_partition}" 95 | # The alternative here seems to be to pipe a series of commands 96 | # to fdisk(1), similar to how it's done by raspi-config: 97 | # https://github.com/asb/raspi-config/blob/3a5d75340a1f9fe5d7eebfb28fee0e24033f4fd3/raspi-config#L68 98 | # This seemed to work, but I was running into weirdness because 99 | # that doesn't seem to make a GPT, and later on I couldn't get 100 | # partition unique GUID from gdisk. parted(1) is also a nice 101 | # option because it's scriptable and allows partition sizes to 102 | # be specified in percentages. 103 | parted --script "${target_drive}" mklabel gpt 104 | parted --script --align optimal "${target_drive}" mkpart primary ext4 0% 100% 105 | 106 | info "fs create" "Creating ext4 filesystem on ${target_partition}" 107 | mkfs -t ext4 -L rootfs "${target_partition}" 108 | 109 | info "fs id" "Getting UUID for target partition" 110 | eval `blkid -o export "${target_partition}"` 111 | export target_partition_uuid=$UUID 112 | 113 | info "fs id" "Getting Partition unique GUID for target filesystem" 114 | # Ok, so the only way I was able to get this was using gdisk. 115 | # I don't quite understand the different between this value and 116 | # the one you can get with blkid and tune2fs (which seem to give 117 | # the same thing). Nevertheless, this seems to be necessary to 118 | # get a value that can be used in cmdline.txt. I think it's a 119 | # GUID specifically for the GPT partition table entry. 120 | export partition_unique_guid=`echo 'i' | sudo gdisk "${target_drive}" | grep 'Partition unique GUID:' | awk '{print $4}'` 121 | 122 | info "fs id" "Target partition UUID: ${target_partition_uuid}" 123 | info "fs id" "Partition unique GUID: ${partition_unique_guid}" 124 | 125 | info "fs copy" "Mounting ${target_partition} on /mnt" 126 | mount "${target_partition}" /mnt 127 | 128 | info "fs copy" "Copying root filesystem to ${target_partition} with rsync" 129 | info "fs copy" "This will take quite a while. Please be patient!" 130 | rsync -ax / /mnt 131 | 132 | info "boot config" "Configuring boot from {$target_partition}" 133 | # rootdelay=5 is likely not necessary here, but seems to do no harm. 134 | cp /boot/cmdline.txt /boot/cmdline.txt.bak 135 | sed -i "s|root=\/dev\/mmcblk0p2|root=PARTUUID=${partition_unique_guid} rootdelay=5|" /boot/cmdline.txt 136 | 137 | info "boot config" "Commenting out old root partition in /etc/fstab, adding new one" 138 | # These changes are made on the new drive after copying so that they 139 | # don't have to be undone in order to switch back to booting from the 140 | # SD card. 141 | sed -i '/mmcblk0p2/s/^/#/' /mnt/etc/fstab 142 | echo "/dev/disk/by-uuid/${target_partition_uuid} / ext4 defaults,noatime 0 1" >> /mnt/etc/fstab 143 | 144 | info "boot config" "Ok, your system should be ready. You may wish to check:" 145 | info "boot config" " /mnt/etc/fstab" 146 | info "boot config" " /boot/cmdline.txt" 147 | info "boot config" "Your new root drive is currently accessible under /mnt." 148 | info "boot config" "In order to restart with this drive at /, please type:" 149 | info "boot config" "sudo reboot" 150 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/adafruit-pi-externalroot-helper.substvars: -------------------------------------------------------------------------------- 1 | misc:Depends= 2 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/changelog: -------------------------------------------------------------------------------- 1 | adafruit-pi-externalroot-helper (0.1.0-1) unstable; urgency=medium 2 | 3 | * Fix hardcoded target drive in gdisk call. 4 | 5 | -- Brennen Bearnes Mon, 08 Jun 2015 16:19:01 -0600 6 | 7 | adafruit-pi-externalroot-helper (0.0.1-1) unstable; urgency=low 8 | 9 | * First pass at helper script. 10 | 11 | -- Brennen Bearnes Sun, 12 Apr 2015 12:36:01 -0600 12 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/control: -------------------------------------------------------------------------------- 1 | Source: adafruit-pi-externalroot-helper 2 | Section: utils 3 | Priority: extra 4 | Maintainer: Brennen Bearnes 5 | Build-Depends: debhelper (>= 8.0.0) 6 | Standards-Version: 3.9.3 7 | Homepage: https://github.com/adafruit/Adafruit-Pi-ExternaRoot-Helper 8 | # Vcs-Git: https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper.git 9 | # Vcs-Browser: https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper 10 | 11 | Package: adafruit-pi-externalroot-helper 12 | Architecture: armhf 13 | Depends: ${shlibs:Depends}, ${misc:Depends}, rsync, parted, gdisk 14 | Description: Configuration helper for using an external drive as root FS 15 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: adafruit-pi-externalroot-helper 3 | Source: https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper 4 | 5 | Files: * 6 | Copyright: 2015 Adafruit Industries 7 | License: MIT 8 | The MIT License (MIT) 9 | . 10 | Copyright (c) 2015 Adafruit Industries 11 | . 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | . 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | . 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/install: -------------------------------------------------------------------------------- 1 | adafruit-pi-externalroot-helper usr/bin 2 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | # export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | -------------------------------------------------------------------------------- /packages/adafruit-pi-externalroot-helper/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/adafruit-pitft-helper.substvars: -------------------------------------------------------------------------------- 1 | misc:Depends= 2 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/changelog: -------------------------------------------------------------------------------- 1 | adafruit-pitft-helper (0.8.3-1) unstable; urgency=low 2 | 3 | * 35r default speed is now 25000000 4 | 5 | -- Todd Treece Tue, 08 Nov 2016 14:18:05 -0500 6 | 7 | adafruit-pitft-helper (0.8.2-1) unstable; urgency=low 8 | 9 | * rotate 35r by 180 10 | 11 | -- Todd Treece Tue, 18 Oct 2016 21:12:23 -0400 12 | 13 | adafruit-pitft-helper (0.8.1-1) unstable; urgency=low 14 | 15 | * use upstream overlay for 28r and 35r 16 | 17 | -- Todd Treece Tue, 18 Oct 2016 18:40:19 -0400 18 | 19 | adafruit-pitft-helper (0.8.0-1) unstable; urgency=low 20 | 21 | * Handles lightdm configuration for framebuffer device. 22 | 23 | -- Brennen Bearnes Thu, 01 Oct 2015 18:42:00 -0600 24 | 25 | adafruit-pitft-helper (0.7.1-1) unstable; urgency=low 26 | 27 | * Makes helper and chroot wrapper a touch more user-friendly. 28 | 29 | -- Brennen Bearnes Tue, 02 Jun 2015 14:58:21 -0600 30 | 31 | adafruit-pitft-helper (0.7.0-1) unstable; urgency=medium 32 | 33 | * Removes explicity kernel package dependency. 34 | 35 | -- Brennen Bearnes Mon, 01 Jun 2015 16:47:00 -0600 36 | 37 | adafruit-pitft-helper (0.6.0-1) unstable; urgency=medium 38 | 39 | * Switches kernel dependency to Adafruit package. 40 | 41 | -- Brennen Bearnes Mon, 01 Jun 2015 13:21:36 -0600 42 | 43 | adafruit-pitft-helper (0.5.1-1) unstable; urgency=medium 44 | 45 | * Fixes ~/.profile handling 46 | 47 | -- Brennen Bearnes Mon, 27 Apr 2015 14:08:30 -0600 48 | 49 | adafruit-pitft-helper (0.5.0-1) unstable; urgency=medium 50 | 51 | * Adds -u dirname option 52 | * Adds warning if /boot is not mounted 53 | * Improves /boot/cmdline.txt handling 54 | 55 | -- Brennen Bearnes Tue, 17 Mar 2015 17:43:30 -0600 56 | 57 | adafruit-pitft-helper (0.4.1-1) unstable; urgency=low 58 | 59 | * Fixes handling of -t 22 60 | * Tweaks helptext 61 | 62 | -- Brennen Bearnes Thu, 12 Mar 2015 13:35:34 -0600 63 | 64 | adafruit-pitft-helper (0.4.0-1) unstable; urgency=low 65 | 66 | * Improve /boot/cmdline.txt handling for console option 67 | 68 | -- Brennen Bearnes Thu, 12 Mar 2015 10:46:00 +0600 69 | 70 | adafruit-pitft-helper (0.3.0-1) unstable; urgency=low 71 | 72 | * Add adafruit-pitft-touch-cal for touchscreen calibration 73 | 74 | -- Brennen Bearnes Mon, 09 Mar 2015 15:10:00 +0600 75 | 76 | adafruit-pitft-helper (0.2.1-1) unstable; urgency=low 77 | 78 | * Bump pitft kernel version 79 | 80 | -- Todd Treece Mon, 09 Mar 2015 16:44:10 +0000 81 | 82 | adafruit-pitft-helper (0.2.0-1) unstable; urgency=low 83 | 84 | * Adds wiringpi and fbi dependencies 85 | * Adds adafruit-pitft-chroot-install wrapper 86 | * Adds kpartx dependency for chroot installs 87 | * Adds touchscreen module configuration 88 | 89 | -- Brennen Bearnes Mon, 09 Mar 2015 13:05:38 +0000 90 | 91 | adafruit-pitft-helper (0.1.0-1) unstable; urgency=low 92 | 93 | * Handles DTO configuration 94 | 95 | -- Brennen Bearnes Fri, 06 Mar 2015 21:53:29 +0000 96 | 97 | adafruit-pitft-helper (0.0.1-2) unstable; urgency=low 98 | 99 | * Adds non-kernel dependencies 100 | 101 | -- Brennen Bearnes Mon, 09 Feb 2015 17:16:01 +0000 102 | 103 | adafruit-pitft-helper (0.0.1-1) unstable; urgency=low 104 | 105 | * Initial release 106 | 107 | -- Brennen Bearnes Fri, 06 Feb 2015 21:42:21 +0000 108 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/control: -------------------------------------------------------------------------------- 1 | Source: adafruit-pitft-helper 2 | Section: utils 3 | Priority: extra 4 | Maintainer: Brennen Bearnes 5 | Build-Depends: debhelper (>= 8.0.0) 6 | Standards-Version: 3.9.3 7 | Homepage: https://github.com/adafruit/Adafruit-PiTFT-Helper 8 | # Vcs-Git: https://github.com/adafruit/Adafruit-PiTFT-Helper.git 9 | # Vcs-Browser: https://github.com/adafruit/Adafruit-PiTFT-Helper 10 | 11 | Package: adafruit-pitft-helper 12 | Architecture: armhf 13 | Depends: ${shlibs:Depends}, ${misc:Depends}, evtest, tslib, libts-bin, fbi, wiringpi, kpartx, python 14 | Description: Configuration helper for Adafruit PiTFT 15 | Tools for configuring Adafruit PiTFT modules. 16 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: adafruit-pitft-helper 3 | Source: https://github.com/adafruit/Adafruit-PiTFT-Helper 4 | 5 | Files: * 6 | Copyright: 2015 Adafruit Industries 7 | License: MIT 8 | The MIT License (MIT) 9 | . 10 | Copyright (c) 2015 Adafruit Industries 11 | . 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | . 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | . 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/install: -------------------------------------------------------------------------------- 1 | adafruit-pitft-helper usr/bin 2 | adafruit-pitft-chroot-install usr/bin 3 | adafruit-pitft-touch-cal usr/bin 4 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | # export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | -------------------------------------------------------------------------------- /packages/adafruit-pitft-helper_TEMPLATE/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /packages/occi.md: -------------------------------------------------------------------------------- 1 | occi config helper 2 | ================== 3 | 4 | This dir is a stub. Will attempt to handle #1 with a minimum of dependencies. 5 | I think this will be a package something like occidentalis-config-helper upon 6 | which occidentalis depends, but which can be installed separately. 7 | 8 | Notes: 9 | 10 | - format echoes existing `/boot/config.txt` 11 | - init system can just run this with the right privileges at boot, user 12 | can change `/boot/occidentalis.txt` and rerun with `sudo occi` 13 | 14 | TODO: 15 | 16 | - [ ] figure out how to modularize handling of individual keys, to the 17 | extent that it matters 18 | - [ ] occidentalis package should stick this in the init system 19 | - [ ] config file format should allow comments 20 | - [ ] make sure it wouldn't be better to put config in some existing 21 | file 22 | - [ ] should do some handholding for confused users 23 | -------------------------------------------------------------------------------- /packages/occi/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | .DS_Store 4 | 5 | # generated man pages - see packages/Makefile 6 | usr/share/man/man1/*.gz 7 | usr/share/doc/occi/changelog.gz 8 | -------------------------------------------------------------------------------- /packages/occi/DEBIAN/changelog: -------------------------------------------------------------------------------- 1 | occi (0.6.0) unstable; urgency=low 2 | 3 | * Don't fail on absence of /boot/occidentalis.txt 4 | 5 | -- Brennen Bearnes Fri, 06 Mar 2015 22:35:18 +0000 6 | 7 | occi (0.5.1) unstable; urgency=low 8 | 9 | * Adds --version flag 10 | * Adds --file flag 11 | * Adds Getopt::Long for CLI option parsing 12 | 13 | -- Brennen Bearnes Mon, 02 Feb 2015 12:38:00 -0700 14 | 15 | occi (0.5.0) unstable; urgency=low 16 | 17 | * Removes handling of Adafruit WebIDE installs 18 | 19 | -- Brennen Bearnes Tue, 27 Jan 2015 14:07:00 -0700 20 | 21 | occi (0.4.0) unstable; urgency=low 22 | 23 | * Adds handling of Adafruit WebIDE installs based on webide=yes 24 | * Refactors some configuration testing and debug output 25 | 26 | -- Brennen Bearnes Mon, 26 Jan 2015 08:24:00 -0700 27 | 28 | occi (0.3.5) unstable; urgency=low 29 | 30 | * Cleans up example occidentalis.txt in POD and man page 31 | 32 | -- Brennen Bearnes Mon, 26 Jan 2015 08:24:00 -0700 33 | 34 | occi (0.3.4) unstable; urgency=low 35 | 36 | * Adds avahi-daemon restart to handle_hostname() 37 | 38 | -- Brennen Bearnes Thu, 22 Jan 2015 14:44:00 -0700 39 | 40 | occi (0.3.3) unstable; urgency=low 41 | 42 | * Adds wpa_supplicant restart to handle_wifi() 43 | 44 | -- Brennen Bearnes Thu, 22 Jan 2015 13:58:00 -0700 45 | 46 | occi (0.3.2) unstable; urgency=low 47 | 48 | * Improve documentation 49 | 50 | -- Brennen Bearnes Tue, 20 Jan 2015 15:35:00 -0700 51 | 52 | occi (0.3.1) unstable; urgency=low 53 | 54 | * Removes occi run from postinst 55 | 56 | -- Todd Treece Tue, 20 Jan 2015 14:23:00 -0500 57 | 58 | occi (0.1.0) unstable; urgency=low 59 | 60 | * Initial release. 61 | * First version of the occi config utility. 62 | 63 | -- Brennen Bearnes Tue, 13 Jan 2015 13:01:00 -0700 64 | -------------------------------------------------------------------------------- /packages/occi/DEBIAN/conffiles: -------------------------------------------------------------------------------- 1 | /etc/init.d/occi 2 | -------------------------------------------------------------------------------- /packages/occi/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: occi 2 | Version: 0.6.0 3 | Section: base 4 | Priority: optional 5 | Architecture: all 6 | Depends: perl (>= 5.10.0), libipc-system-simple-perl (>= 1.21-1), wpasupplicant (>= 1.0) 7 | Maintainer: Brennen Bearnes 8 | Description: OCcidentalis Config for raspberry pI 9 | A simple utility to apply configuration options from 10 | /boot/occidentalis.txt. 11 | -------------------------------------------------------------------------------- /packages/occi/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | update-rc.d -f occi defaults 3 | -------------------------------------------------------------------------------- /packages/occi/README.md: -------------------------------------------------------------------------------- 1 | # Occi 2 | 3 | A small configuration helper for the Raspberry Pi. 4 | 5 | See the [Adafruit Pi Finder](https://github.com/adafruit/Adafruit-Pi-Finder) and 6 | [Occidentalis](https://github.com/adafruit/Adafruit-Occidentalis) for more info. 7 | -------------------------------------------------------------------------------- /packages/occi/etc/init.d/occi: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: occi 5 | # Required-Start: $all 6 | # Required-Stop: 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Occidentalis Configuration Utility 10 | ### END INIT INFO 11 | 12 | set -e 13 | 14 | # /etc/init.d/occi: run the occi configuration utility 15 | test -x /usr/bin/occi || exit 1 16 | 17 | # Carry out specific functions when asked to by the system 18 | case "$1" in 19 | start) 20 | echo Starting occi configuration 21 | occi 22 | ;; 23 | stop) 24 | ;; 25 | restart) 26 | echo Re-applying occi configuration 27 | occi 28 | ;; 29 | force-reload) 30 | echo Re-applying occi configuration 31 | occi 32 | ;; 33 | *) 34 | echo "Usage: /etc/init.d/occi {start|stop}" 35 | exit 1 36 | ;; 37 | esac 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /packages/occi/usr/bin/occi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | =head1 NAME 4 | 5 | occi - Adafruit Occidentalis Configuration Helper for Raspberry Pi 6 | 7 | =head1 DESCRIPTION 8 | 9 | occi is a simple utility for applying configuration settings like 10 | hostname and WiFi credentials to your Raspberry Pi. 11 | 12 | Settings are stored in a simple text file, usually 13 | F. The format is: 14 | 15 | hostname=somepi 16 | 17 | # wifi configuration details: 18 | wifi_ssid=Your Network Here 19 | wifi_password=your password here 20 | 21 | Blank lines and comments starting with C<#> will be ignored. Keys are 22 | case-insensitive. 23 | 24 | See F for a full example. 25 | 26 | =head1 SYNOPSIS 27 | 28 | # apply configuration in /boot/occidentalis.txt 29 | sudo occi 30 | 31 | # check current version 32 | occi --version 33 | 34 | # apply a different configuration file 35 | sudo occi --file=/home/alternate_occidentalis.txt 36 | 37 | =cut 38 | 39 | package OcciConfig v0.6.0; 40 | 41 | use warnings; 42 | use strict; 43 | use 5.10.0; 44 | 45 | use Getopt::Long; 46 | use IPC::System::Simple qw(capturex); 47 | 48 | # Handle CLI options: 49 | my $OCCI_CONFIG = "/boot/occidentalis.txt"; 50 | my $show_version_and_exit = 0; 51 | GetOptions( 52 | "file=s" => \$OCCI_CONFIG, 53 | "version" => \$show_version_and_exit 54 | ) or die("Error in command line arguments\n"); 55 | 56 | diag("Adafruit Occidentalis configuration helper, ${OcciConfig::VERSION}"); 57 | if ($show_version_and_exit) { 58 | exit 0; 59 | } 60 | 61 | have_config_or_exit($OCCI_CONFIG); 62 | my %config = parse_config($OCCI_CONFIG); 63 | 64 | diag('file', $OCCI_CONFIG); 65 | 66 | { 67 | # This bit of magic will find every sub starting with "handle_". 68 | # It just stands in for explicitly calling: 69 | # 70 | # handle_hostname(%config); 71 | # handle_wifi(%config); 72 | # 73 | # and so on down the line. 74 | 75 | no strict 'refs'; 76 | my (@handlers) = grep { defined &{"OcciConfig\::$_"} && m/^handle_/ } keys %{"OcciConfig\::"}; 77 | 78 | diag_push('run'); 79 | foreach my $handler (@handlers) { 80 | diag_push($handler); 81 | &{$handler}(%config); 82 | diag_pop(); 83 | } 84 | diag_pop(); 85 | } 86 | 87 | exit 0; 88 | 89 | =head1 CONFIGURATION HANDLERS 90 | 91 | To add a handler, just write a sub that takes the %config hash, like so, 92 | and returns a list containing one or more log items: 93 | 94 | sub handle_foo { 95 | my %config = @_; 96 | return ('nothing to do here'); 97 | } 98 | 99 | It will automatically be called every time occi runs. 100 | 101 | =over 102 | 103 | =item handle_selftest() 104 | 105 | Run some basic sanity checks. 106 | 107 | =cut 108 | 109 | sub handle_selftest { 110 | my %config = @_; 111 | 112 | my %allowed_keys = map { $_ => 1} qw( 113 | hostname 114 | wifi_password wifi_ssid 115 | ); 116 | 117 | diag('Checking configuration for basic sanity.'); 118 | 119 | foreach my $key (sort keys %config) { 120 | if ($allowed_keys{$key}) { 121 | diag('valid', $key, $config{$key}); 122 | } else { 123 | diag('error', $key, 'unrecognized configuration key'); 124 | } 125 | } 126 | 127 | # This is just a bit of a sanity check - do we know whether some 128 | # things we might expect are installed? 129 | my @check_packages = qw(occi occidentalis); 130 | foreach my $package (@check_packages) { 131 | if (is_installed_package($package)) { 132 | diag('have package', $package); 133 | } else { 134 | diag('no package', $package); 135 | } 136 | } 137 | 138 | chomp(my $dversion = get_file('/etc/debian_version')); 139 | diag('debian version', $dversion); 140 | } 141 | 142 | =item handle_hostname() 143 | 144 | Update current hostname and make sure it's set properly at boot. 145 | 146 | =cut 147 | 148 | sub handle_hostname { 149 | my %config = @_; 150 | 151 | return ('no hostname specified') 152 | unless defined $config{hostname}; 153 | 154 | my $hostname_changed = 0; 155 | 156 | # What's the existing configuration? 157 | chomp(my $existing_etc_hostname = get_file('/etc/hostname')); 158 | chomp(my $existing_hostname = capture_string('hostname')); 159 | 160 | unless ($existing_etc_hostname eq $config{hostname}) { 161 | # Make sure this is set correctly at next boot 162 | diag('Setting /etc/hostname to ' . $config{hostname}); 163 | put_file('/etc/hostname', $config{hostname}); 164 | $hostname_changed = 1; 165 | } 166 | 167 | unless ($existing_hostname eq $config{hostname}) { 168 | # Make sure this is set correctly right _now_. 169 | diag('Setting current hostname to ' . $config{hostname}); 170 | system('hostname', $config{hostname}); 171 | $hostname_changed = 1; 172 | } 173 | 174 | # Make sure our new hostname is mentioned in /etc/hosts: 175 | my $etc_hosts = get_file('/etc/hosts'); 176 | my $new_etc_hosts = $etc_hosts; 177 | my $config_hostline = "127.0.1.1\t$config{hostname}"; 178 | $new_etc_hosts =~ s/^(127[.]0[.]1[.]1\s+${existing_hostname})$/$config_hostline/m; 179 | if ($new_etc_hosts !~ /$config_hostline/) { 180 | $new_etc_hosts .= "\n$config_hostline"; 181 | } 182 | if ($etc_hosts ne $new_etc_hosts) { 183 | diag('Adding ' . $config_hostline . ' to /etc/hosts'); 184 | put_file('/etc/hosts', $new_etc_hosts); 185 | $hostname_changed = 1; 186 | } 187 | 188 | if ($hostname_changed && (-f '/etc/init.d/avahi-daemon')) { 189 | diag('restarting avahi-daemon'); 190 | my (@restart_log) = capture_list('service', 'avahi-daemon', 'restart'); 191 | foreach my $logline (@restart_log) { 192 | diag($logline); 193 | } 194 | } 195 | } 196 | 197 | =item handle_wifi() 198 | 199 | Configure a wireless network. 200 | 201 | =cut 202 | 203 | sub handle_wifi { 204 | my %config = @_; 205 | 206 | my $conf_file = '/etc/wpa_supplicant/wpa_supplicant.conf'; 207 | my $blurb = get_blurb(); 208 | 209 | return ('no wifi_ssid specified') 210 | unless defined $config{wifi_ssid}; 211 | 212 | diag('Configuring network :: ' . $config{wifi_ssid}); 213 | 214 | my ($ifconfig) = capture_string('ifconfig', '-s'); 215 | if ($ifconfig !~ /wlan/) { 216 | diag('No wireless hardware found.'); 217 | } elsif (defined $config{wifi_password}) { 218 | my $wpa_config = capture_string( 219 | 'wpa_passphrase', 220 | $config{wifi_ssid}, 221 | $config{'wifi_password'} 222 | ); 223 | 224 | $wpa_config = <<"WPA"; 225 | # $blurb 226 | ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 227 | update_config=1 228 | $wpa_config 229 | WPA 230 | 231 | diag("Writing $conf_file"); 232 | 233 | my @log = capture_list( 234 | 'wpa_cli', 235 | 'reconfigure' 236 | ); 237 | foreach my $logline (@log) { 238 | diag($logline); 239 | } 240 | 241 | put_file($conf_file, $wpa_config, $conf_file . '.backup'); 242 | } else { 243 | diag("No wifi_password defined, falling back to iwconfig."); 244 | my $iwlog = capture_string( 245 | 'iwconfig', 246 | # TODO: this of course is not always going to be the same... 247 | 'wlan0', 248 | 'essid', 249 | $config{wifi_ssid} 250 | ); 251 | 252 | } 253 | } 254 | 255 | 256 | =back 257 | 258 | =head1 UTILITY SUBROUTINES 259 | 260 | =over 261 | 262 | =item capture_string($cmd, @args) 263 | 264 | Return a string containing the output of a command, or log an 265 | error. 266 | 267 | =cut 268 | 269 | sub capture_string { 270 | my ($cmd, @args) = @_; 271 | 272 | my $output; 273 | 274 | eval { 275 | $output = capturex($cmd, @args); 276 | }; 277 | 278 | if ($@) { 279 | diag(1, 'error', $@); 280 | } 281 | 282 | return $output; 283 | } 284 | 285 | =item capture_list($cmd, @args) 286 | 287 | Return a list containing the output of a command, or log an 288 | error. 289 | 290 | =cut 291 | 292 | sub capture_list { 293 | my ($cmd, @args) = @_; 294 | 295 | my @output; 296 | 297 | eval { 298 | @output = capturex($cmd, @args); 299 | }; 300 | 301 | if ($@) { 302 | diag(1, 'error', $@); 303 | } 304 | 305 | return @output; 306 | } 307 | 308 | 309 | =item parse_config($path_to_file) 310 | 311 | Grab a hash of configuration options out of some text file, 312 | formatted like so: 313 | 314 | key1=value 315 | key2=value2 316 | 317 | =cut 318 | 319 | sub parse_config { 320 | my %config; 321 | my ($config_path) = @_; 322 | my $config_str = get_file($config_path); 323 | 324 | # Crude dos2unix: 325 | $config_str =~ s/\r\n/\n/g; 326 | 327 | while ($config_str =~ m{^([a-z_]+) = (.*?)$}ixmg) { 328 | my $key = lc($1); # normalize to lowercase 329 | my $value = $2; 330 | $config{$key} = $value; 331 | } 332 | 333 | return %config; 334 | } 335 | 336 | =item get_file($path_to_file) 337 | 338 | Returns the contents of a given file as a string. 339 | 340 | =cut 341 | 342 | sub get_file { 343 | my ($path) = @_; 344 | 345 | if (! -e $path) { 346 | die "$path doesn't appear to exist." 347 | } 348 | 349 | local $/ = undef; 350 | open my $fh, '<', $path 351 | or die "Failed opening $path: $!"; 352 | my $contents = <$fh>; 353 | close $fh; 354 | 355 | return $contents; 356 | } 357 | 358 | =item put_file($path, $content) 359 | 360 | Put $content in the file at $path. 361 | 362 | =cut 363 | 364 | sub put_file { 365 | my ($path, $content, $backup_path) = @_; 366 | 367 | # Handle one-time backups - this could use some rethinking. 368 | if (defined $backup_path) { 369 | if (! -e $backup_path) { 370 | if (-e $path) { 371 | my $old_contents = get_file($path); 372 | put_file($backup_path, $old_contents); 373 | } 374 | } 375 | } 376 | 377 | open my $fh, '>', $path 378 | or die "Failed opening $path: $!"; 379 | print $fh $content; 380 | close $fh; 381 | } 382 | 383 | =item is_installed_package($package_name) 384 | 385 | Check whether a given package is installed. 386 | 387 | =cut 388 | 389 | sub is_installed_package { 390 | my ($package_name) = @_; 391 | my $query_result = capture_string( 392 | 'dpkg-query', 393 | '-W', 394 | '-f', 395 | '${Status}', 396 | $package_name 397 | ); 398 | 399 | return ($query_result =~ /install ok installed/); 400 | } 401 | 402 | =item install_package($package_name) 403 | 404 | Ensure that a given package is installed. Should be idempotent. 405 | 406 | Returns a status string and, if action taken, an install log. 407 | 408 | =cut 409 | 410 | sub install_package { 411 | my ($package_name) = @_; 412 | 413 | return 'already-installed' 414 | if is_installed_package($package_name); 415 | 416 | my @install_log = capture_list( 417 | 'apt-get', 418 | '-y', 419 | 'install', 420 | $package_name 421 | ); 422 | 423 | return ('installed', @install_log); 424 | } 425 | 426 | =item uninstall_package($package_name) 427 | 428 | Ensure that a given package is not installed. Should be idempotent. 429 | 430 | Returns a status string and, if action taken, an uninstall log. 431 | 432 | =cut 433 | 434 | sub uninstall_package { 435 | my ($package_name) = @_; 436 | 437 | return 'already-uninstalled' 438 | unless is_installed_package($package_name); 439 | 440 | my @install_log = capture_list( 441 | 'apt-get', 442 | '-y', 443 | 'remove', 444 | $package_name 445 | ); 446 | 447 | return ('uninstalled', @install_log); 448 | } 449 | 450 | =item get_blurb() 451 | 452 | Return a useful blurb for inclusion in config file comments. 453 | 454 | =cut 455 | 456 | sub get_blurb { 457 | return "This file is managed by $OCCI_CONFIG"; 458 | } 459 | 460 | =item diag(@columns) 461 | 462 | Print columns of diagnostic output. 463 | 464 | =cut 465 | 466 | { 467 | # Cheesy retention of state: 468 | my @diag_stack = (); 469 | 470 | sub diag { 471 | my (@cols) = @_; 472 | # print "\t" x $depth; 473 | print join " :: ", (@diag_stack, @cols); 474 | print "\n"; 475 | } 476 | 477 | sub diag_push { 478 | my ($value) = @_; 479 | push @diag_stack, $value; 480 | } 481 | 482 | sub diag_pop { 483 | pop @diag_stack; 484 | } 485 | } 486 | 487 | =item have_config_or_exit($path) 488 | 489 | Check that a given config file exists, and exit with some documentation if not. 490 | 491 | =cut 492 | 493 | sub have_config_or_exit { 494 | my ($file) = @_; 495 | 496 | return 1 if -f $file; 497 | 498 | print STDERR <<"HELPTEXT"; 499 | It looks like you don't have a $OCCI_CONFIG yet. 500 | 501 | In order to create one: 502 | 503 | sudo nano $OCCI_CONFIG 504 | 505 | And then add configuration keys like: 506 | 507 | hostname=somepi 508 | 509 | See /usr/share/doc/occi/occidentalis_example.txt for a full example. 510 | HELPTEXT 511 | 512 | exit 0; 513 | } 514 | 515 | 516 | =back 517 | 518 | =head1 AUTHOR 519 | 520 | Brennen Bearnes 521 | Todd Treece 522 | 523 | =head1 COPYING 524 | 525 | The MIT License (MIT) 526 | 527 | Copyright (c) 2015 Adafruit Industries 528 | 529 | Permission is hereby granted, free of charge, to any person obtaining a copy 530 | of this software and associated documentation files (the "Software"), to deal 531 | in the Software without restriction, including without limitation the rights 532 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 533 | copies of the Software, and to permit persons to whom the Software is 534 | furnished to do so, subject to the following conditions: 535 | 536 | The above copyright notice and this permission notice shall be included in 537 | all copies or substantial portions of the Software. 538 | 539 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 540 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 541 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 542 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 543 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 544 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 545 | THE SOFTWARE. 546 | 547 | =cut 548 | -------------------------------------------------------------------------------- /packages/occi/usr/share/doc/occi/occidentalis_example.txt: -------------------------------------------------------------------------------- 1 | # In order to use this file, you can copy it to /boot/occidentalis.txt: 2 | # 3 | # sudo cp occidentalis_example.txt /boot/occidentalis.txt 4 | # 5 | # and change the options on each line. 6 | # 7 | # Lines with a leading "#" are comments. Blank lines are ignored. 8 | 9 | # set hostname 10 | hostname=somepi 11 | 12 | # configure a wireless network 13 | wifi_ssid=somewifinetwork 14 | wifi_password=somepassword 15 | -------------------------------------------------------------------------------- /packages/occi/usr/share/man/man1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit-Occidentalis/115173db410886eed029ebcce3414b6f5b01950f/packages/occi/usr/share/man/man1/.gitkeep -------------------------------------------------------------------------------- /packages/occidentalis/DEBIAN/changelog: -------------------------------------------------------------------------------- 1 | occidentalis (0.6.0) unstable; urgency=low 2 | 3 | * migrates apt repository to apt.adafruit.com 4 | * bumps occi version dependency to add flags 5 | 6 | -- Brennen Bearnes Mon, 02 Feb 2015 14:09:23 -0700 7 | 8 | occidentalis (0.5.7) unstable; urgency=low 9 | 10 | * bumps suggested webide version 11 | * bumps occi version dependency to remove WebIDE handling 12 | 13 | -- Todd Treece Tue, 27 Jan 2015 18:45:48 +0000 14 | 15 | occidentalis (0.5.6) unstable; urgency=low 16 | 17 | * bumps occi version dependency for WebIDE handling 18 | 19 | -- Brennen Bearnes Tue, 27 Jan 2015 09:36:00 -0700 20 | 21 | occidentalis (0.5.5) unstable; urgency=low 22 | 23 | * bumps webide version suggestion 24 | 25 | -- Todd Treece Fri, 23 Jan 2015 23:48:14 +0000 26 | 27 | occidentalis (0.5.4) unstable; urgency=low 28 | 29 | * Adds git dependency 30 | * Suggests webIDE package 31 | 32 | -- Todd Treece Thu, 22 Jan 2015 23:16:43 +0000 33 | 34 | occidentalis (0.5.3) unstable; urgency=low 35 | 36 | * Adds occi 0.3.4 dependency (avahi restart). 37 | 38 | -- Brennen Bearnes Thu, 22 Jan 2015 14:44:00 -0700 39 | 40 | occidentalis (0.5.2) unstable; urgency=low 41 | 42 | * Adds occi 0.3.3 dependency. 43 | 44 | -- Brennen Bearnes Thu, 22 Jan 2015 13:58:00 -0700 45 | 46 | occidentalis (0.5.1) unstable; urgency=low 47 | 48 | * Turn on i2c & spi kernel modules via postinst 49 | * Only add samba config if it hasn't been added yet 50 | 51 | -- Todd Treece Thu, 22 Jan 2015 01:36:01 +0000 52 | 53 | occidentalis (0.5.0) unstable; urgency=low 54 | 55 | * Adds samba dependency 56 | * Adds samba-common-bin dependency 57 | * Adds samba config change script to postinst 58 | 59 | -- Todd Treece Thu, 22 Jan 2015 00:42:50 +0000 60 | 61 | occidentalis (0.4.0) unstable; urgency=low 62 | 63 | * Adds i2c-tools dependency 64 | * Adds python-smbus dependency 65 | * Adds vim dependency 66 | 67 | -- Brennen Bearnes Tue, 20 Jan 2015 15:28:00 -0700 68 | 69 | occidentalis (0.3.9) unstable; urgency=low 70 | 71 | * Adds occi run to postinst 72 | * Adds changelog 73 | * Adds avahi-daemon restart to postinst 74 | 75 | -- Todd Treece Tue, 20 Jan 2015 14:19:00 -0500 76 | 77 | -------------------------------------------------------------------------------- /packages/occidentalis/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: occidentalis 2 | Version: 0.6.0 3 | Section: base 4 | Priority: optional 5 | Architecture: armhf 6 | Depends: avahi-daemon (>= 0.6.31), netatalk (>= 2.2.2), node (>= 0.10.35), occi (>= 0.5.1), tmux (>= 1.6-2), i2c-tools, python-smbus, vim, git, samba, samba-common-bin 7 | Suggests: adafruitwebide (>= 0.3.10) 8 | Maintainer: Todd Treece 9 | Description: Occidentalis 10 | A collection of packages and utilities brought to you 11 | by Adafruit that make it easier for you to use your Raspberry Pi. 12 | -------------------------------------------------------------------------------- /packages/occidentalis/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | occi 3 | service avahi-daemon restart 4 | service netatalk restart 5 | 6 | # MODULES 7 | sed -i /etc/modprobe.d/raspi-blacklist.conf -e "s/^blacklist[[:space:]]*spi-bcm2708.*/#blacklist spi-bcm2708/" 8 | modprobe spi-bcm2708 9 | sed -i /etc/modprobe.d/raspi-blacklist.conf -e "s/^blacklist[[:space:]]*i2c-bcm2708.*/#blacklist i2c-bcm2708/" 10 | modprobe i2c-bcm2708 11 | sed -i /etc/modprobe.d/raspi-blacklist.conf -e "s/^blacklist[[:space:]]*i2c-dev.*/#blacklist i2c-dev/" 12 | modprobe i2c-dev 13 | 14 | if ! grep -Fq "i2c-dev" /etc/modules; then 15 | echo "i2c-bcm2708" >> /etc/modules 16 | echo "i2c-dev" >> /etc/modules 17 | fi 18 | 19 | # i2c for pi 2 20 | if ! grep -Fq "dtparam=i2c1" /boot/config.txt; then 21 | echo "# Turn on i2c (bus #1) for Raspberry Pi 2 and Pi 1 Model A, B (rev 2) and B+." >> /boot/config.txt 22 | echo "# If you have a Raspberry Pi Model B rev 1 with the i2c bus 0 instead," >> /boot/config.txt 23 | echo "# change this line to dtparam=i2c0=on" >> /boot/config.txt 24 | echo "dtparam=i2c1=on" >> /boot/config.txt 25 | fi 26 | 27 | # SAMBA 28 | if ! grep -Fq "pihome" /etc/samba/smb.conf; then 29 | cp /etc/samba/smb.conf /etc/samba/smb.conf.backup 30 | sed -i "s/.*workgroup[[:space:]]=.*/workgroup = WORKGROUP/" /etc/samba/smb.conf 31 | sed -i "s/.*wins[[:space:]]support[[:space:]]=.*/wins support = yes/" /etc/samba/smb.conf 32 | echo "raspberry" | tee - | smbpasswd -a -s pi 33 | cat << "EOF" >> /etc/samba/smb.conf 34 | [pihome] 35 | comment= Pi Home 36 | path=/home/pi 37 | browseable=Yes 38 | writeable=Yes 39 | only guest=no 40 | create mask=0777 41 | directory mask=0777 42 | public=no 43 | EOF 44 | service samba restart 45 | fi 46 | 47 | # Migrate from apt.uniontownlabs.org to apt.adafruit.com 48 | if grep -q 'apt.uniontownlabs.org' /etc/apt/sources.list; then 49 | echo "Migrating to apt.adafruit.com from apt.uniontownlabs.org" 50 | sed -i '/apt.uniontownlabs.org/d' /etc/apt/sources.list 51 | 52 | if ! grep -q 'apt.adafruit.com' /etc/apt/sources.list; then 53 | echo "deb http://apt.adafruit.com/raspbian/ wheezy main" >> /etc/apt/sources.list 54 | fi 55 | wget -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 56 | fi 57 | -------------------------------------------------------------------------------- /packages/occidentalis/usr/share/doc/occidentalis/README: -------------------------------------------------------------------------------- 1 | Please see https://github.com/adafruit/Adafruit-Pi-Finder 2 | -------------------------------------------------------------------------------- /repo/README.md: -------------------------------------------------------------------------------- 1 | # APT repo 2 | 3 | ## Deploying Packages to the Apt Repo 4 | 5 | ```sh 6 | $ sudo su && cd ~ 7 | $ ./deploy /path_to/your/pi_bootstrap 8 | ``` 9 | -------------------------------------------------------------------------------- /repo/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | NODE_DEB='node_0.12.6_armhf.deb' 4 | IDE_DEB='adafruitwebide-0.3.11-Linux.deb' 5 | RUN_DATE=`date '+%Y-%m-%d-%I:%M:%S'` 6 | 7 | # incomplete notes: 8 | # - this whole script is by now sort of a bad idea 9 | # - stuff will break if there are spaces in filenames, 10 | # so don't do that or fix the quoting first 11 | # - we keep old snapshots for wheezy debs in ~/wheezy_deb_cache 12 | # but overwrite them if there have been new ones made for jessie 13 | 14 | # make sure user passed a path to the repo 15 | if [ "$1" == "" ]; then 16 | echo "You must specify a path to your pi_bootstrap repo. i.e. /home/admin/pi_bootstrap" 17 | exit 1 18 | fi 19 | 20 | # confirm we are working with the right folder 21 | if [ ! -f $1/finder.sh ]; then 22 | echo "Are you sure ${1} is the correct path to the repo? finder.sh check failed." 23 | exit 1 24 | fi 25 | 26 | # deploy latest finder shell script 27 | cd /var/packages/bootstrap 28 | rm index.txt 29 | cp $1/finder.sh index.txt 30 | chmod 644 index.txt 31 | 32 | # deploy latest install shell script 33 | mkdir -p /var/packages/install 34 | cd /var/packages/install 35 | rm index.txt 36 | cp $1/install.sh index.txt 37 | chmod 644 index.txt 38 | 39 | # deploy latest addrepo shell script 40 | mkdir -p /var/packages/add 41 | cd /var/packages/add 42 | rm index.txt 43 | cp $1/addrepo.sh index.txt 44 | chmod 644 index.txt 45 | 46 | # deploy latest install shell script 47 | mkdir -p /var/packages/add-pin 48 | cd /var/packages/add-pin 49 | cp $1/addrepo-pin.sh index.txt 50 | chmod 644 index.txt 51 | 52 | # deploy latest install shell script 53 | mkdir -p /var/packages/install-pin 54 | cd /var/packages/install-pin 55 | cp $1/install-pin.sh index.txt 56 | chmod 644 index.txt 57 | 58 | # copy the packages to a temp folder, build them: 59 | TEMP_DIR=`mktemp -d` 60 | cp -r $1/packages/* $TEMP_DIR 61 | mkdir $TEMP_DIR/build 62 | cd $TEMP_DIR 63 | make 64 | 65 | # make the deb cache folder if it doesn't exist 66 | mkdir -p ~/jessie_deb_cache 67 | 68 | # cache the node deb 69 | if [ ! -f ~/jessie_deb_cache/$NODE_DEB ]; then 70 | wget http://node-arm.herokuapp.com/node_latest_armhf.deb -O ~/deb_cache/$NODE_DEB 71 | fi 72 | # cache the webide deb 73 | if [ ! -f ~/jessie_deb_cache/$IDE_DEB ]; then 74 | wget -P ~/jessie_deb_cache/ http://adafruit-download.s3.amazonaws.com/$IDE_DEB 75 | fi 76 | 77 | # copy all of the cached debs into the build dir 78 | cp ~/jessie_deb_cache/*.deb $TEMP_DIR/build 79 | 80 | # sign packages, and add them to the repo 81 | dpkg-sig -k $GPG_KEY --sign builder $TEMP_DIR/build/*.deb 82 | 83 | # this should be our target: 84 | 85 | rm -rf ~/.aptly/ 86 | 87 | WHEEZY_SNAPSHOT="occidentalis-wheezy-$RUN_DATE" 88 | JESSIE_SNAPSHOT="occidentalis-jessie-$RUN_DATE" 89 | 90 | # add packages to an existing aptly repo - we use force-replace to overwrite 91 | # any existing versions. (for all i know, this could cause problems, but i 92 | # don't think it has yet.) 93 | aptly repo create occidentalis-wheezy 94 | aptly repo create occidentalis-jessie 95 | 96 | for file in `ls $TEMP_DIR/build/`; do 97 | if [ -f ~/wheezy_deb_cache/"$file" ]; then 98 | cp $TEMP_DIR/build/"$file" ~/wheezy_deb_cache/"$file" 99 | fi 100 | done 101 | 102 | # wheezy_deb_cache is old stuff, we are not touching it any more 103 | aptly repo add --force-replace=true occidentalis-wheezy ~/wheezy_deb_cache/*.deb 104 | 105 | aptly repo add --force-replace=true occidentalis-jessie $TEMP_DIR/build/*.deb 106 | aptly snapshot create $WHEEZY_SNAPSHOT from repo occidentalis-wheezy 107 | aptly snapshot create $JESSIE_SNAPSHOT from repo occidentalis-jessie 108 | 109 | # aptly publish drop wheezy 110 | aptly publish snapshot --distribution="wheezy" $WHEEZY_SNAPSHOT 111 | # aptly publish drop jessie 112 | aptly publish snapshot --distribution="jessie" $JESSIE_SNAPSHOT 113 | 114 | REPO_TEMP_DIR=`mktemp -d` 115 | cp -r ~/.aptly/public/ $REPO_TEMP_DIR 116 | rm -r /var/packages/raspbian 117 | mv $REPO_TEMP_DIR/public /var/packages/raspbian 118 | 119 | # clean up 120 | rm -r $TEMP_DIR 121 | rm -r $REPO_TEMP_DIR 122 | -------------------------------------------------------------------------------- /repo/nginx/apt.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name apt.adafruit.com; 4 | 5 | access_log /var/log/nginx/packages-error.log; 6 | error_log /var/log/nginx/packages-error.log; 7 | 8 | location / { 9 | root /var/packages; 10 | index index.html index.txt; 11 | autoindex on; 12 | } 13 | 14 | location ~ /(.*)/conf { 15 | deny all; 16 | } 17 | 18 | location ~ /(.*)/db { 19 | deny all; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /repo/nginx/apt_ssl.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 443; 4 | server_name apt.adafruit.com; 5 | 6 | access_log /var/log/nginx/packages-error.log; 7 | error_log /var/log/nginx/packages-error.log; 8 | 9 | ssl on; 10 | ssl_certificate /etc/ssl/private/bundle.crt; 11 | ssl_certificate_key /etc/ssl/private/private.key; 12 | 13 | ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL'; 14 | 15 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 16 | ssl_session_cache shared:SSL:10m; 17 | 18 | ssl_stapling on; 19 | ssl_stapling_verify on; 20 | resolver 8.8.4.4 8.8.8.8 valid=300s; 21 | resolver_timeout 10s; 22 | 23 | ssl_prefer_server_ciphers on; 24 | ssl_dhparam /etc/ssl/certs/dhparam.pem; 25 | 26 | add_header Strict-Transport-Security max-age=63072000; 27 | add_header X-Frame-Options DENY; 28 | add_header X-Content-Type-Options nosniff; 29 | 30 | location / { 31 | root /var/packages; 32 | index index.html index.txt; 33 | autoindex on; 34 | } 35 | 36 | location ~ /(.*)/conf { 37 | deny all; 38 | } 39 | 40 | location ~ /(.*)/db { 41 | deny all; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /repo/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "**** add nginx apt repo ****" 4 | curl http://nginx.org/keys/nginx_signing.key | apt-key add - 5 | echo "deb http://nginx.org/packages/debian/ wheezy nginx" >> /etc/apt/sources.list 6 | echo "deb-src http://nginx.org/packages/debian/ wheezy nginx" >> /etc/apt/sources.list 7 | 8 | echo "**** update package lists & install dependencies ****" 9 | apt-get update 10 | apt-get install -y nginx gnupg rng-tools reprepro vim build-essential ntp dpkg-sig fakeroot devscripts mosh fail2ban tmux git 11 | 12 | echo "**** configure and start rng-tools ****" 13 | echo "HRNGDEVICE=/dev/urandom" >> /etc/default/rng-tools 14 | /etc/init.d/rng-tools start 15 | --------------------------------------------------------------------------------