Building a Pi image

These instructions aren’t necessary to use this system. They’re intended for developers who need to build a Pi image from scratch.

Pi setup

Manual configuration: these steps apply to both the production and development configurations below.

  1. Download Raspian 64-bit Lite (no desktop).

  2. Unzip and use Rufus to burn to 32GB+ card. Boot on Pi.

  3. Run sudo raspi-config. Set the following:

    1. Localisation->WLAN country-> US

    2. Localisation->Timezone->Chicago

    3. Localisation->Keyboard (auto-sets to 104 keys, US)

    4. Enable SSH

Next, run

Click on the link above for instruction on how to run it. Finally, follow the steps for the production or development configuration below.

Pi production configuration

This statically assigns addresses to both the Ethernet and Wifi sides of the Pi; the Pi is configured as a wireless access point.

  1. Run:

    cd NIST-UAS-3.2/production
    ./install.sh
    

Configuration files

These files configure the Pi for production mode.

Pi development configuration

For development, the Pi is configured as a bridged wireless access point. This allows devices plugged in via either Ethernet or connected via WiFi to live on the same subnet, so that iPerf3 client / servers can connect across the Pi. It also allows developers to plug the Pi in to Ethernet and still connect to it via WiFi for testing. When no Ethernet cable is present (meaning the Ethernet interfaced doesn’t assign the Pi an IP address), the Pi uses a default address of 169.254.56.126.

This configuration was produced by following the Setting up a Bridged Wireless Access Point instructions. To set this up, run:

cd NIST-UAS-3.2/development
./install.sh

Configuration files

These files configure the Pi for development mode.

Generating an image file

Finally, create an image from the working Pi setup produced by following the previous two steps.

  1. (Optional) Boot Linux on a PC; use partition management tools to shrink the partition on the Pi’s flash drive to make the image faster to generate.

  2. Mount a flash drive:

    1. Do this one time:

      sudo apt-get install exfat-fuse exfat-utils
      sudo mkdir /media/usb
      
    2. Connect flash drive

    3. Run:

      # (shows /dev/sda)
      sudo fdisk -l
      sudo mount /dev/sda1 /media/usb
      
  3. Create the image: sudo dd if=/dev/mmcblk0 of=/media/usb/pi.img bs=1k conv=noerror. This took about 20 minutes.

  4. TODO – need details: run pishrink.sh.

  5. Unmount flash drive: sudo umount /media/usb