Raspbian netinst

Post tags: | raspberry_pi | raspbian |

Net Installer Image

Notes

To flash your SD card on Linux:


        xzcat /path/to/raspbian-ua-netinst-latest.img.xz > glop.img
        sudo dd bs=1M if= glop.img of=/dev/sdc
        rm glop.img
        

Boot with the SDHC and view the HDMI video to see install progress.

First boot

The system is almost completely unconfigured on first boot. Here are some tasks you most definitely want to do on first boot.

The default root password is raspbian.

Set new root password:


        passwd
        

Configure your default locale:


        dpkg-reconfigure locales
        

Configure your timezone:


        dpkg-reconfigure tzdata
        

Install latest kernel and firmware package:


        apt-get update
        apt-get install linux-image-rpi-rpfv raspberrypi-bootloader-nokernel
        
         ...
        update-initramfs: Generating /boot/initrd.img-3.10-3-rpi
        

Replace old kernel.img with latest kernel:


        cp /vmlinuz /boot/kernel.img
        

Reboot to new kernel and firmware:


        reboot
        

Change the hostname

Edit /etc/hostname and /etc/hosts to have the hostname.


        root@pi:/etc# cat hostname
        pika
        root@pi:/etc# cat hosts
        127.0.0.1 localhost pika
        

Set up serial console

Edit /etc/inittab and add a line to enable the serial console.


        #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
        T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
        #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
        

After a reboot, check the serial console and hostname.


        $ sudo screen /dev/ttyUSB0 115200
        

        root@pika:~# uname -a
        Linux pika 3.10-3-rpi #1 Debian 3.10.11-1+rpi4 (2014-01-24) armv6l GNU/Linux
        

ssh is working. This is the IP address assigned to eth0


        ssh root@192.168.88.223
        

Archive the image so far

Check the size of file systems. Looks like the whole 8GB SDHC is used.


        root@pika:~# df -k
        Filesystem     1K-blocks   Used Available Use% Mounted on
        rootfs           7399324 302888   6697524   5% /
        /dev/root        7399324 302888   6697524   5% /
        devtmpfs          224292      0    224292   0% /dev
        tmpfs              44876    116     44760   1% /run
        tmpfs               5120      0      5120   0% /run/lock
        tmpfs              89740      0     89740   0% /run/shm
        /dev/mmcblk0p1     48742  22956     25786  48% /boot
        tmpfs              89740      0     89740   0% /tmp
        

        $ sudo dd bs=1M if=/dev/sdc of=pika_20140305_0958.img
        $ 7za a -t7z pika_20140305_0958.img.7z pika_20140305_0958.img
        

set up the wifi Edimax EW-7811UN

I had problems, but got help here.

Post on raspberrypi.org forum - Where to get help on wifi?

So I added 2 packages.


        apt-get install wpasupplicant
        apt-get install wireless-tools
        

Here is the trail Verify the Edimax EW-7811Un is seen.


        root@pika:~# lsusb
         ...
        Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
         ...
        

Note that the wpa-psk entry is not the passphrase. With the ssid and passphrase this site can give the psk.

Wireshark - WPA PSK (Raw Key) Generator

Here is the interfaces file.


        root@pika:~# cat /etc/network/interfaces
        auto lo
        iface lo inet loopback
        
        auto eth0
        iface eth0 inet dhcp
        
        auto wlan0
        allow-hotplug wlan0
        iface wlan0 inet dhcp
          wpa-ssid Pirates
          wpa-psk alonghexstringpsk
        

See if iwlist from wireless-tools finds the router.


        root@pika:~# iwlist wlan0 scan
        
        wlan0     Scan completed :
                  Cell 01 - Address: D4:CA:6D:56:86:59
                            ESSID:"Pirates"
                            Protocol:IEEE 802.11bgn
                            Mode:Master
                            Frequency:2.412 GHz (Channel 1)
                            Encryption key:on
                            Bit Rates:300 Mb/s
                            Extra:wpa_ie=dd1a0050f20101000050f20402000050f2040050f20201000050f202
                            IE: WPA Version 1
                                Group Cipher : CCMP
                                Pairwise Ciphers (2) : CCMP TKIP
                                Authentication Suites (1) : PSK
                            Extra:rsn_ie=30160100000fac040200000fac04000fac020100000fac02
                            IE: IEEE 802.11i/WPA2 Version 1
                                Group Cipher : CCMP
                                Pairwise Ciphers (2) : CCMP TKIP
                                Authentication Suites (1) : PSK
                            Quality=100/100  Signal level=100/100  
        

For the wifi interface


        $ ssh craig@192.168.88.218
        

For the wired interface


        $ ssh root@192.168.88.223
        

add a user


        pika# adduser craig
        

Generate a key pair for the new user


        $ ssh-keygen
        

Install python, vim, tmux, git


        pika# apt-get install python
         ...
        The following NEW packages will be installed:
          file libmagic1 libsqlite3-0 mime-support python python-minimal python2.7 python2.7-minimal
         ...
        
        pika# apt-get install vim tmux git
         ...
        The following NEW packages will be installed:
          git git-man libclass-isa-perl libcurl3-gnutls liberror-perl libevent-2.0-5 libgpm2 libldap-2.4-2 libpopt0 librtmp0 libsasl2-2 libsasl2-modules libssh2-1 libswitch-perl patch perl perl-modules rsync tmux vim vim-runtime
         ...
        

Personalize git


        $ git config --global user.name "Your Name Here"
        Sets the default name for git to use when you commit
        
        $ git config --global user.email "your_email@example.com"
        Sets the default email for git to use when you commit
        

Set up the vim dotfiles and vundle.


        $ git clone git@github.com:CootCraig/dotfiles_again.git
        
        $ cd dotfiles_again/linux
        $ bash ./install.sh 
        
        cd ~/dotfiles_again/windows/vimfiles/bundle
        git clone https://github.com/gmarik/vundle.git
        

There are some notes on using vundle in the file ~/.vim/bundle/Readme.txt The Raspbian vim does not have python support, so disable UltiSnips vim script. Comment out the following line in ~/.vimrc


        Bundle 'vim-scripts/UltiSnips'
          to
        "Bundle 'vim-scripts/UltiSnips'
        

And then run BundleInstall.


        in vim. :BundleInstall
        

password less ssh

These instructions worked fine.

How to set up ssh so you aren’t asked for a password

Add the contents of the public key file into ~/.ssh/authorized_keys on the remote site (the file should be mode 600).

make user a sudoer


        pika# apt-get install sudo
        pika# adduser craig sudo
        

Install Compiler tools


        pika# apt-get install build-essential checkinstall libtool automake uuid-dev
         ...
        The following NEW packages will be installed:
          autoconf automake autotools-dev binutils build-essential bzip2 checkinstall cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6 gcc-4.6-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-dev-bin
          libc6-dev libdpkg-perl libfile-fcntllock-perl libgmp10 libgomp1 libltdl-dev libltdl7 libmpc2 libmpfr4 libstdc++6-4.6-dev libtimedate-perl libtool linux-libc-dev m4 make manpages manpages-dev uuid-dev xz-utils
         ...
        

Zeromq build and install

Source for stable release 3.2.4

This is supported by ffi-rzmq, the JRuby library I plan to use. I unpacked for build at:


        pika# cd /opt/zeromq/zeromq-3.2.4
        

The installation will be to /usr/local/


        pika# ./configure --help
        Installation directories:
          --prefix=PREFIX         install architecture-independent files in PREFIX
                                  [/usr/local]
          --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                                  [PREFIX]
        

        pika# ./configure
        pika# make
        pika# checkinstall
        

A debian package was left here:


        /opt/zeromq/zeromq-3.2.4/zeromq_3.2.4-1_armhf.deb
        

install socat


        pika# apt-get install socat
        

Install supervisor with python-pip


        pika# apt-get install python-pip
         ...
        The following NEW packages will be installed:
          python-pip python-pkg-resources python-setuptools python2.6 python2.6-minimal
         ...
        
        pika# pip install supervisor
         ...
          Downloading supervisor-3.0.tar.gz (459Kb): 459Kb downloaded
         ...
            Installing echo_supervisord_conf script to /usr/local/bin
            Installing pidproxy script to /usr/local/bin
            Installing supervisorctl script to /usr/local/bin
            Installing supervisord script to /usr/local/bin
         ...
        

install python-pip mentioned apt-utils not installed, so let’s install it.


        pika# apt-get install apt-utils
         ...
        The following NEW packages will be installed:
          apt-utils libapt-inst1.5
         ...
        

supervisor setup - run socat at boot


        for copy and paste
        

Install Oracle jdk 8

extracted jdk-8-fcs-b129-linux-arm-vfp-hflt-06_feb_2014.tar.gz to /opt/java/jdk1.8.0

Made a symbolic link for /opt/java/jdk


        $ ls -l /opt/java/jdk
        lrwxrwxrwx 1 root root 9 Mar  5 22:06 /opt/java/jdk -> jdk1.8.0/
        

Add jdk to the path

  • /etc/profile
  • /etc/sudoers
  • /etc/environment
  • /etc/login.defs

Modify /etc/login.defs


        ENV_SUPATH      PATH=/opt/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        ENV_PATH        PATH=/opt/java/jdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
        

Modify /etc/profile


        if [ "`id -u`" -eq 0 ]; then
          PATH="/opt/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        else
          PATH="/opt/java/jdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
        fi
        

modify /etc/sudoers


        Defaults        secure_path="/opt/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        

/etc/environment was empty

Verify that java runs and the version.


        $ java -version
        java version "1.8.0"
        Java(TM) SE Runtime Environment (build 1.8.0-b129)
        Java HotSpot(TM) Client VM (build 25.0-b69, mixed mode)
        

install jruby

Unpack the latest jruby tarball to /opt/jruby/jruby-1.7.11

Make a symbolic to this version of jruby.


        $ ls -l /opt/jruby/jruby
        lrwxrwxrwx 1 root root 13 Mar  5 23:06 /opt/jruby/jruby -> jruby-1.7.11/
        

modify the path to add /opt/jruby/jruby/bin

Modify /etc/login.defs


        ENV_SUPATH      PATH=/opt/java/jdk/bin:/opt/jruby/jruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        ENV_PATH        PATH=/opt/java/jdk/bin:/opt/jruby/jruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
        

Modify /etc/profile


        if [ "`id -u`" -eq 0 ]; then
          PATH="/opt/java/jdk/bin:/opt/jruby/jruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        else
          PATH="/opt/java/jdk/bin:/opt/jruby/jruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
        fi
        

modify /etc/sudoers


        Defaults        secure_path="/opt/java/jdk/bin:/opt/jruby/jruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        

Define JAVA_HOME in the environment

Add to /etc/environment


        JAVA_HOME=/opt/java/jdk
        

Verify that jruby runs.


        $ jruby -v
        jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) Client VM 1.8.0-b129 +indy [linux-arm]
        

Change permissions in jruby folder to allow user craig to add gems


        pika# adduser craig staff
        
        pika# cd /opt/jruby/jruby/lib/ruby/gems
        pika# sudo bash -c "find shared -type d |xargs chmod 775"
        pika# sudo bash -c "find shared |xargs chmod g+w"
        
        pika# cd /opt/jruby/jruby-1.7.11
        pika# sudo bash -c "find bin |xargs chmod g+w"
        

gem install bundler


        $ gem install bundler
        Fetching: bundler-1.5.3.gem (100%)
        /opt/jruby/jruby-1.7.11/lib/ruby/shared/rubygems/installer.rb:507 warning: executable? does not in this environment and will return a dummy value
        Successfully installed bundler-1.5.3
        1 gem installed
        

todo

done

  • serial console
  • wifi setup
  • password less ssh
  • make user a sudoer
  • checkinstall and compile tools
  • zeromq compile and install
  • supervisor
  • socat
  • Oracle JVM
  • JRuby

todo

  • fixed IP address
  • JRuby/Reel test