120 lines
4.6 KiB
HTML
120 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
||
<html> <head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>gokrazy quickstart</title>
|
||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
|
||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||
<link href="/jumbotron-narrow.css" rel="stylesheet">
|
||
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400">
|
||
<style type="text/css">
|
||
body {
|
||
font-family: "Open Sans";
|
||
}
|
||
.table-striped>tr:nth-child(odd){
|
||
background-color:red;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container"><div class="header"><nav>
|
||
<ul class="nav nav-pills pull-right">
|
||
|
||
|
||
|
||
<li role="presentation" class=""><a href="/">Home </a></li>
|
||
|
||
|
||
<li role="presentation" class=""><a href="/platforms/">Platforms </a></li>
|
||
|
||
|
||
<li role="presentation" class="active"><a href="/quickstart/">Quickstart <span class="sr-only">(current)</span></a></li>
|
||
|
||
|
||
<li role="presentation" class=""><a href="/showcase/">Showcase </a></li>
|
||
|
||
|
||
<li role="presentation" class=""><a href="https://github.com/gokrazy/gokrazy">Source </a></li>
|
||
|
||
</ul>
|
||
</nav>
|
||
<h3 class="text-muted">gokrazy</h3>
|
||
</div>
|
||
|
||
|
||
<div class="row">
|
||
<div class="col-lg-12">
|
||
<h1>Get a Raspberry Pi 3 (no other model)</h1>
|
||
<p>
|
||
Currently, the Raspberry Pi 3 is the <strong>only</strong>
|
||
model supported. Many people assume the Raspberry Pi Zero W
|
||
could be used as well. Unfortunately, it uses the older
|
||
BCM2835 SoC, which is not arm64, so gokrazy won’t run on
|
||
it. See
|
||
also <a href="https://www.reddit.com/r/golang/comments/5xgf8u/gokrazy_a_purego_userland_for_your_raspberry_pi_3/dei7b2m/">stapelberg’s
|
||
reddit comment about supported hardware</a>.
|
||
</p>
|
||
|
||
<h1>Install Go</h1>
|
||
<p>
|
||
If you don’t already have Go installed, install the latest <a href="https://golang.org/dl/">Go</a> version.
|
||
</p>
|
||
|
||
<h1>Install the gokrazy packer</h1>
|
||
<pre>INSTANCE=gokrazy/hello; mkdir -p ~/${INSTANCE?} && cd ~/${INSTANCE?} && echo module ${INSTANCE?} > go.mod
|
||
go get -u github.com/gokrazy/tools/cmd/gokr-packer</pre>
|
||
|
||
<h1>Overwrite an SD card with gokrazy</h1>
|
||
<p>
|
||
Plug an SD card into your card reader and locate its device node by checking <code>dmesg | tail</code>. In this example, we’ll assume the SD card is accessible as <code>/dev/sdb</code>.
|
||
</p>
|
||
<p>
|
||
To overwrite the entire SD card <code>/dev/sdb</code> with a gokrazy installation running a hello world program, use:
|
||
</p>
|
||
<pre>cd ~/gokrazy/hello
|
||
gokr-packer -overwrite=/dev/sdb github.com/gokrazy/hello github.com/gokrazy/serial-busybox</pre>
|
||
<p>
|
||
The <code>gokr-packer</code> command above will result in log output like this:
|
||
</p>
|
||
<pre>2017/03/01 20:59:55 packer.go:85: installing [github.com/gokrazy/hello]
|
||
2017/03/01 20:59:56 packer.go:131: partitioning /dev/sdb
|
||
2017/03/01 20:59:56 parttable.go:40: device holds 15931539456 bytes
|
||
2017/03/01 20:59:56 packer.go:139: waiting for /dev/sdb1 to appear
|
||
If your applications need to store persistent data, create a file system using e.g.:
|
||
|
||
mkfs.ext4 /dev/sdb4
|
||
|
||
To boot gokrazy, plug the SD card into a Raspberry Pi 3 (no other model supported)
|
||
|
||
To interact with the device, gokrazy provides a web interface reachable at:
|
||
|
||
http://gokrazy:<i><automatically-generated-random-password></i>@gokrazy/
|
||
|
||
There will be not be any other output (no HDMI, no serial console, etc.)</pre>
|
||
<p>
|
||
After booting from this SD card, your Raspberry Pi 3 will:
|
||
<ul>
|
||
<li>obtain an IP address for hostname “gokrazy” via DHCP (IPv4) and SLAAC (IPv6)</li>
|
||
<li>synchronize the clock using NTP</li>
|
||
<li>expose a password-authenticated web interface on private IP addresses<br>
|
||
(the default password can be recovered from <code>~/.config/gokrazy/http-password.txt</code>)</li>
|
||
<li>supervise all installed programs (only the hello world program in this example)</li>
|
||
</ul>
|
||
The only way for you to interact with the device is via the
|
||
web interface (unless the installed programs provide other
|
||
ways). There will be no HDMI output, no serial console, etc.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footer" style="text-align: center">
|
||
<p>© 2017 gokrazy authors (Michael Stapelberg and contributors)</p>
|
||
</footer>
|
||
</div>
|
||
</body>
|
||
</html>
|
||
</div>
|
||
</body>
|
||
</html>
|