- Using instructions from http://dev.iachieved.it/iachievedit/building-swift-3-0-on-a-raspberry-pi-3/
Install Ubuntu on microSD card
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 and update Pi 3
Boot the pi and log in with user
ubuntupassword (automatically forced on first log in).
Log in remotely
ifconfig -ato get the eth0 address since
ubuntu.localdidn't work out of the box.
ssh email@example.com whatever.
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.
perform the edits, save and exit
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 localhostto 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
Append your public key from your Mac
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 Swap Space
Configure the swap file:
sudo -s cd ~root fallocate -l 1G 1G.swap chmod 0600 1G.swap mkswap 1G.swap swapon 1G.swap exit
Prevent multiple concurrent invocations of the linker
Install a helper script
Paste in the following (w/o leading whitespace):
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="
mkdir -p "$LOCK_DIR" echo "Using lock file $LOCK_FILE..."
$LOCK_FILE" "$REAL_CMD" "$@"
chmod ugo+x /usr/local/bin/exec-once
ld.goldto 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&
screen ./package.sh |& tee swiftbuild.log
SPI is enabled by default in Ubuntu
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-oncewrapper 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