1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# System status webserver
This is a snappy demo package that shows how to build and package a minimalistic
webserver that displays the system status using golang for snappy. This package
is multi-architecture enabled.
Currently it uses Linux Dash (https://github.com/afaqurk/linux-dash), the
source of which can also be found in Launchpad
(https://launchpad.net/~vthompson/+junk/system-status/).
To build for both amd64 and armhf, on an amd64 host, create the binaries in the
architecture dependent directories. the magic-bin/system-status-webserver launch
script will do the magic to find the right architecture and launch the right
binary.
To build simply do this:
# change to the x86_64 directory and build the binary...
1. cd magic-bin/x86_64-linux-gnu
2. go build ../../
# switch to the armhf directory and build for ARM
3. cd ../arm-linux-gnueabihf
4. GOARCH=arm go build ../../
NOTE: You may need to bootstrap your go installation using the following
command in the go source directory:
sudo GOOS=linux GOARCH=arm ./make.bash --no-clean
# go to top level dir and build the snapp
5. cd ../../
6. snappy build .
This produces a snappy package for you that you can try on your snappy system.
Have fun!
- Victor Thompson
|