/skybian

Base image for Skywire boards. Available for Orange and Raspberry Pi.

Primary LanguageGo

Skybian

Build Status

Skybian is an Armbian-based Operating System that contains the Skycoin's Skywire software and it's dependencies.

Currently, the following SBCs (Single Board Computer) are supported:

This repository has two main components. The first is a script for building a base Skybian image. The second is a tool named skyimager, that downloads a base Skybian image, and generates a number of final Skybian images (based on the provided options by the user).

Dependencies

At the time of writing, only building on Linux is supported.

Golang 1.13+ is requred.

Additional dependencies for building Skybian base image:

rsync wget 7z cut awk sha256sum gzip tar e2fsck losetup resize2fs truncate sfdisk qemu-aarch64-static go

For Debian-based linux distributions, you can install these via:

$ sudo apt update && sudo apt install -y p7zip-full qemu-user-static build-essential crossbuild-essential-arm64

On Arch-based distributions, to satisfy the qemu-aarch64-static dependency, one can install the qemu-arm-static AUR package.

Additional dependencies for building skyimager-gui:

The GUI uses the Fyne library. The prerequisites for Fyne can be found here: https://fyne.io/develop/index

Configure and build

Both the script to build the Skybian base image, as well as the script to build skyimager-gui are configured via build.conf.

To build the Skybian base image, run:

$ make build-skybian-img

To build skyimager-gui, run:

$ make build-skyimager-gui

Developer Information

Skybian Image Build Process

The build.sh script orchestrates the Skybian image build process.

It's supplemented by files in the static folder where auxiliary scripts and systemd service files reside.

Running the script will create a folder named output containing:

  • parts - Where downloaded or compiled components such as the Armbian, Skywire and skyconf are stored.
  • image - Where the temporary image is stored during the build process.
  • mnt - Used as a mount point for the image. Scripts will be copied and executed for the image being built.
  • final - Where the final image is stored.

Preparing a Release

  1. Make sure your remote is set to a branch on origin.
  2. Update CHANGELOG as required.
  3. Change VERSION variable within build.conf.
  4. Do git add . && git commit -m "<your-commit-msg>".
  5. Run make tag. Travis will prepare a release draft at https://github.com/skycoin/skybian/releases
  6. Edit the draft and publish.

FAQ

What are Boot Parameters?

Final Skybian images have boot parameters written to the Master Boot Record section of the image. The encoded boot parameters have a maximum size of 216 bytes, and is located at offset +0E0 (The bootstrap code area part 2).

Boot parameters determine what is, and what is not done when booting the OS.

Values of the boot parameters are separated by 0x1F characters. The values are of the following order:

  • MD: The operating mode of the node. Current valid values are: 0x00 (Hypervisor), 0x01 (Visor).
  • IP: The local IP address. Only IPv4 compatible addresses are supported.
  • GW: The gateway IP address. Only IPv4 compatible addresses are supported.
  • SS: The passcode for the skysocks app (Only valid if MD=0x01 - Visor).
  • HVS: Delegated hypervisor public keys. (Only valid of MD=0x01 - Visor).

These values can be written by the skyimager-gui (provided in this repo) with user-provided options.

Storage Paths

Binaries

  • respectively located in /usr/bin are:
    • skyconf
    • skybian-firstrun
    • skywire-cli
    • skywire-visor

Systemd Service Files

  • Skywire visor systemd service file is located in /etc/systemd/system/skywire-visor.service

Skywire Visor Config

  • Skywire visor file is located in /etc/skywire-visor.config
  • DMSGPTY
    • "authorization_file": "/var/skywire-visor/dsmgpty/whitelist.json",
    • "cli_address": "/run/skywire-visor/dmsgpty/cli.sock"
  • Transports
    • "log_store": {"type": "file", "location": "/var/skywire-visor/transports" },
  • Launcher
    • "bin_path": "/usr/bin/apps",
    • "local_path": "/var/skywire-visor/apps"

Apps

  • Binaries are located in /usr/bin/apps:
    • skychat
    • skysocks
    • skysocks-client
    • vpn-client
    • vpn-server
  • Logs are stored in /var/skywire-visor/apps:

Networking

  • networking defaults are located in /etc/NetworkManager/system-connections:
    • Wired connection 1 (wrt. LAN)
    • Wireless connection 1 (wrt. WIFI)