#!/bin/bash # Raspbian Jessie Build Script # Version 1.0 (very simple --- make me better) # June 2016 # Sean Taylor # review the application lists: # uncomment from install list to install # uncomment from remove list to remove # # make this script executable: # use sudo chmod o+xwr raspbian_build.sh # use chown pi raspbian_build.sh ---> user pi # use chown :pi raspbian_build.sh ---> group pi # ./raspbian_build.sh clear cd ~ echo -e "\n\n +-----------------------------------------+" echo " | RASPBIAN JESSIE BUILD SCRIPT (V1.0) |" echo " +-----------------------------------------+ " echo " review the script as it runs and answer" echo " the prompts as needed " echo -e "\n\n -------------------------------------------" date echo "HOSTNAME:" hostname echo "IP ADDRESS:" hostname -I echo "Network Configuration:" ifconfig -a # list all of the network interfaces #sudo nmcli dev status echo -e " ------------------------------------------- \n\n" sleep 10 # update the system, assume a fresh base installation #sudo rpi-update # this will require a reboot if the firmware is upgraded sudo apt-get update -y sudo apt-get upgrade -y # Manual instructions, perhaps automate this later: # change the system font size to make it easier to read # sudo dpkg-reconfigure console-setup # select UTF-8 # select Guess Optimal Character Set # select Terminus font # select 16x32 font size (or one of the other sizes that are listed) # complete this with a reboot of the system # sudo reboot # Now install some applications echo -e "\n\n +-------------------------------------------+" echo " | INSTALLING APPLICATIONS TO THE SYSTEM |" echo " +-------------------------------------------+ " echo " review the script as it runs and answer" echo -e " the prompts as needed \n\n" #sudo apt-get install rpi-update -y # to update the firmware sudo apt-get install mc -y # midnight commander sudo apt-get install libboost1.50-all -y sudo apt-get install build-essential -y sudo apt-get install python-dev -y sudo apt-get install python-openssl -y sudo apt-get install python-pip -y sudo apt-get install wicd-curses -y #sudo apt-get install tightvncserver -y #sudo apt-get install gspread -y #sudo apt-get install oauth2client -y #sudo apt-get install filezilla -y # transfer files # a list of applications just in case # most of these will not be required so leave them commented # if you want them then remove the comment #sudo apt-get install network-manager -y #sudo apt-get install network-manager-openvpn -y #sudo apt-get install network-manager-openvpn-gnome -y #sudo apt-get install netcat -y #sudo apt-get install sshfs -y # #sudo apt-get install avrdude -y # mc programmer shell #sudo apt-get install arduino -y # this is revision 1.0.5 #sudo apt-get install flex -y #sudo apt-get install bison -y #sudo apt-get install gcc -y #sudo apt-get install gcc-avr -y #sudo apt-get install binutils -y #sudo apt-get install avr-libc -y #sudo apt-get install libusb-dev -y #sudo apt-get install libc6-dev -y #sudo apt-get install byacc -y #sudo apt-get install avr-libc -y #sudo apt-get install python-serial -y #sudo apt-get install lynx -y # shell web browser #sudo apt-get install links2 -y #sudo apt-get install irssi -y # irc client cli #sudo apt-get install curl -y #sudo apt-get install w3m -y # shell web browser #sudo apt-get install w3m-img y # image support for w3m #sudo apt-get install hplip -y # HP printer driver #sudo apt-get install hplip-gui -y #sudo apt-get install wicd-cli -y # wicd network manager #sudo apt-get install nmcli -y #sudo apt-get install bridge-utils -y #sudo apt-get install ebtables -y #sudo apt-get install gnumeric -y # like this over libreoffice #sudo apt-get install abiword -y # like this over libreoffice #sudo apt-get install focuswriter -y # like this, no distractions, just write #sudo apt-get install mp3blaster -y #sudo apt-get install tin -y #sudo apt-get install dtrx y #sudo apt-get install dstat -y #sudo apt-get install ffmpeg -y #sudo apt-get install mtr -y #sudo apt-get install multitail -y #sudo apt-get install wifite -y # wifi cracker # Now remove some applications echo -e "\n\n +-------------------------------------------+" echo " | REMOVING APPLICATIONS FROM THE SYSTEM |" echo " +-------------------------------------------+ " echo " review the script as it runs and answer" echo -e " the prompts as needed \n\n" # remove dhcpcd5 from Raspbian Jessie Lite image # keep dhcpcd5 on Raspbian Jessie full image #sudo apt-get remove --purge dhcpcd5 -y # causes problems # take away some of the bloat and trim the default distribution down #sudo apt-get remove --purge modemmanager -y #sudo apt-get remove --purge libreoffice -y # too much for Pi #sudo apt-get remove --purge libreoffice-core -y #sudo apt-get remove --purge libreoffice-base -y #sudo apt-get remove --purge libreoffice-writer -y #sudo apt-get remove --purge libreoffice-draw -y #sudo apt-get remove --purge libreoffice-math -y # remove math and draw from menu manually, they are gone #sudo apt-get remove --purge mathmatica -y # don't use it #sudo apt-get remove --purge scratch -y # don't use it #sudo apt-get remove --purge sonic-pi -y # like it but don't use it #sudo apt-get remove --purge minecraft-pi -y # don't play it #sudo apt-get remove --purge wolfram-engine -y # will remove wolfram and mathmatica #sudo apt-get remove --purge claws-mail -y #sudo apt-get remove --purge bluej -y # don't use it #sudo apt-get remove --purge greenfoot -y # don't use it # clean up and get rid of stragglers sudo apt-get clean sudo apt-get autoremove #add more as required # Now change the swap size to something more useful # this will make a huge difference in how well things compile echo -e "\n\n +-------------------------------------------+" echo " | CHANGE THE SWAP SIZE |" echo " +-------------------------------------------+" echo " review the script as it runs and answer" echo " the prompts as needed." echo " This process will take a little time" echo -e " be patient. \n\n" free # swap is small sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=1000 sudo mkswap /var/swap.img sudo swapon /var/swap.img free # swap is larger # Now install the Optimized NRF24L01+ Libraries echo -e "\n\n +-------------------------------------------+" echo " | INSTALL THE OPTIMIZED nRF24L01+ LIBRARIES |" echo " +-------------------------------------------+" echo " review the script as it runs and answer" echo -e " the prompts as needed \n\n" cd ~ # ensure we are in the home directory wget https://tmrh20.github.io/RF24Installer/RPi/install.sh chmod +x install.sh ./install.sh # automated install echo -e "\n\nThe Optimized nRF24L01+ Libraries will now be installed\n\n" #rm install.sh # remove the script # ----------------------------------------------------- # cd ~/rf24libs/RF24/ sudo make install cd ~/rf24libs/RF24/examples_linux sudo make install cd ~/rf24libs/RF24/examples_linux/extra make sudo make install cd ~/rf24libs/RF24/interrupts/ make sudo make install echo -e "\n\n Installing the Python Library Components" echo -e " This may take some time - be patient. \n\n" cd ~/rf24libs/RF24/pyRF24 sudo ./setup.py install # we could add more automation to move through the nRF24 directories # and build everything. But not nessessary at the moment. # Now install the Adafruit_Python_DHT Libraries echo -e "\n\n +-------------------------------------------+" echo " | INSTALL THE ADAFRUIT DHT LIBRARIES |" echo " +-------------------------------------------+ " echo " review the script as it runs and answer" echo -e " the prompts as needed \n\n" cd ~ git clone https://github.com/adafruit/Adafruit_Python_DHT.git cd ~/Adafruit_Python_DHT sudo python setup.py install echo -e "\n\n +----------------------------------------------------------+" echo " | THE OPTIMIZED nRF24L01+ and ADAFRUIT DHT LIBRARIES |" echo " | HAVE BEEN INSTALLED |" echo " +----------------------------------------------------------+ " echo " review the pin assignments for the example PYTHON" echo " scripts and edit the scripts accordingly." echo -e " See the appropriate readme files \n\n" # cd /examples nano simpletest.py edit this file for the desired pin assignment # sudo python simpletest.py to test the sensor cd ~ # back to home echo -e "\n\n --------------------------------------------- " echo " The Home Directory List: " ls -lhnF echo -e "\n\n +-------------------------------------------+" echo " | INSTALLATION COMPLETED NOW REBOOTING |" echo -e " +-------------------------------------------+ \n\n" sleep 10 clear echo -e "\n\n\n\n\n +-------------------------------------------+" echo " | Good Bye |" echo -e " +-------------------------------------------+ \n\n\n" sudo apt-get autoclean sudo reboot