torch-pi-cloud-init/README.md

50 lines
1.7 KiB
Markdown
Raw Normal View History

2020-10-11 22:12:36 +00:00
# TORch RPi Cloud Init Installer
This project aims to create an easy way to burn a RPi SD card with an [Ubuntu Server pre-installed image](https://ubuntu.com/download/raspberry-pi) with [Torch](/bj/torch-agent) installed and configured to broadcast it's connection info to you.
## Quick Start
2020-10-11 22:58:19 +00:00
### Configure Torch and SSH Parameters
2020-10-11 22:12:36 +00:00
Place your settings in `parameters.env`
```bash
cat <<EOF > parameters.env
DISABLE_IPV6=1
USERNAME=ubuntu
USERFULLNAME="Mr. Ubuntu"
SSH_PUBKEY="ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAiOr5aUytobxxu6TG0CQqqyk3hOaaVyC8ZIt4Es9HGSDmKhBznrvMEJ5GyUIMB85+YLh0ohlVZJyrk8BWaIzoHD8IszKEJvpeYMRTGq8LVRe7YW1lFyJLFdTbLliKY0v1PvJmbrPiijHYjg8/l4gGEGlrg4XcnzdYtl9aHjfdc5nyVWkX1GYwDIP08slyt/gM8u7FIuYi1qyMxgjiEm4dcBECghlC8vN6TRBDW7ssald/jpNDUBOLYVQmGiW1KKI0mHxDFF1HoBAYYKtRz9Y4CdWXGTZ35/I50RhXHaI6hkIzfWiouBasnsMIYAvP1qhTW3EC9FlJVi2j16dN44awqw== rsa-key-20201012"
TORCH_CONFIG_DIR=~/.torch
EOF
```
* DISABLE_IPV6 - Disabled IPv6 on the RPi
* USERNAME - Created a user with the given username
* USERFULLNAME - Full name of the user to create
* SSH_PUBKEY - Pubkey to copy to the ~/.ssh directory for SSH access
* TORCH_CONFIG_DIR - Directory containing Torch [configuration](/bj/torch-agent) files
2020-10-11 22:58:19 +00:00
### Manual Image Configuration
2020-10-11 22:12:36 +00:00
Run `build.sh`
```bash
./build.sh
```
Find the built configuration bundle in the `build` directory and extract it to the boot partition of the SD card after the Ubuntu server image has been burned
```bash
tar -xzvf build/rpi-cloud-init.tgz /mnt/rpi-boot/
```
2020-10-11 22:58:19 +00:00
### Automatic Image Configuration
Place a decompressed Ubuntu Server `*.img` file in the project directory and
use `img-config.sh` to build and dope the boot partition of `*.img` file directly
```bash
sudo ./img-config.sh ubuntu-20.04.1-preinstalled-server-arm64+raspi.img
```