- Using instructions from http://dev.iachieved.it/iachievedit/building-swift-3-0-on-a-raspberry-pi-3/
-
Download image from https://wiki.ubuntu.com/ARM/RaspberryPi
-
Check Disk Utility for device
-
Unmount card's filesystem, if mounted
-
Copy to card:
xzcat ubuntu-16.04-preinstalled-server-armhf+raspi3.img.xz | sudo dd bs=32m of=/dev/rdiskN
-
Eject card an put it in your Pi 3
-
Boot the pi and log in with user
ubuntu
, passwordubuntu
-
Change the
ubuntu
password (automatically forced on first log in). -
Reboot
-
Log in remotely
ifconfig -a
to get the eth0 address sinceubuntu.local
didn't work out of the box.ssh [email protected]
or whatever.
-
Update:
sudo apt-get update && sudo apt-get upgrade -y reboot
-
At least as of 2016-08-18, at this point the Pi 3 will have non-functioning ethernet due to https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1579969 Suggestion on Swift Pi Slack is to edit /etc/network/interfaces.d/50-cloud-ini.cfg to match the actual name.
nano /etc/network/interfaces.d/50-cloud-ini.cfg
reboot
-
Install a mDNS server
sudo apt-get install avahi-daemon
-
Log out from the console, turn off monitor and ssh in from Mac:
-
Install personal ssh public key (.ssh doesn't exist,
ssh localhost
to get it created with right permissions)$HOME/.ssh may not exist so use ssh to create it with correct permissions (don't actually need to complete connection)
ssh localhost vi .ssh/authorized_keys
-
Install prerequisites:
sudo apt-get install -y git cmake ninja-build clang uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config
-
Install htop for fun monitoring builds
sudo apt-get install htop
-
Install screen to be able to disconnect from a running build:
sudo apt-get install screen
-
Configure the swap file:
sudo -s cd ~root fallocate -l 1G 1G.swap chmod 0600 1G.swap mkswap 1G.swap swapon 1G.swap exit
-
Install a helper script
sudo -s
nano /usr/local/bin/exec-once#!/bin/sh
There should be a link from a command to this script and the real command should have a ".real" suffix.
REAL_CMD="$0.real" LOCK_DIR="$HOME/locks" LOCK_FILE="$LOCK_DIR/$(basename $0)"
mkdir -p "$LOCK_DIR" echo "Using lock file $LOCK_FILE..."
flock "$LOCK_FILE" "$REAL_CMD" "$@"
^O ^X
chmod ugo+x /usr/local/bin/exec-once
-
Set up
ld.gold
to use the helper script. This will break updating dev tools likely...mv /usr/bin/ld.gold /usr/bin/ld.gold.real ln -s /usr/local/bin/exec-once /usr/bin/ld.gold exit
-
Check out and patch Swift
git clone https://github.com/iachievedit/package-swift cd package-swift ./get.sh ./patch.sh
- CoreFoundation.h (two copies) contain stdio.h which produces errors on ARM. Comment them out.
- Edit NSXMLNode.swift, removing UInt(bitPattern: 0xFF000000) from the preserve all option (overflows on 32 bit Int)
-
Build with nohup or screen:
nohup ./package.sh > swiftbuild.log&
or:
screen ./package.sh |& tee swiftbuild.log
-
SPI is enabled by default in Ubuntu
lsmod
-
But, you need to run as root to access it.
-
Use external swap on USB stick again? which is faster, microSD swap or USB?
- Probably not an issue; with
exec-once
wrapper Swap is barely used
- Probably not an issue; with
-
Get wireless working
sudo apt-get install wireless-tools ... configure interface ... sudo reboot
-
change host name
-
enable SPI?