You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you don't have a Linux machine then the easiest way to build all Qt projects and the SD card image is with the provided Docker image.
25
+
26
+
Features:
27
+
28
+
- Buildroot build and output directories are stored in a Docker Volume due to hard links performance reasons.
29
+
- Binary outputs are copied to bind mounted directory on the host.
30
+
- YIO Remote projects can be bind mounted from the host or stored in a Docker Volume.
31
+
- A convenient build script handles all common build tasks (single project builds, full build, Git operations, etc.).
32
+
33
+
See dedicated [Docker Readme](docker/README.md) for further information.
34
+
35
+
### Linux
24
36
25
-
#### Linux Ubuntu 18.04.3 or newer
37
+
The build process has been tested on Ubuntu 18.04.3, 19.04 and 19.10. Other Linux distributions should work as well.
26
38
27
-
- If you just need a headless build VM then use the minimal [Ubuntu 18.04.3 LTS Server](http://cdimage.ubuntu.com/releases/18.04.3/release/) version.
28
-
- Some packages might already be installed depending on the version (desktop or server).
39
+
#### Prepare Build Environment
40
+
41
+
The minimal [Ubuntu 18.04.3 LTS Server](http://cdimage.ubuntu.com/releases/18.04.3/release/) version is well suited for a headless build VM. Use a desktop version if the VM should also be used for Qt development with Qt Creator.
29
42
30
43
Install required tools:
31
44
32
-
1. Prepare Ubuntu for buildroot:
45
+
1. Prepare Ubuntu to build the Buildroot toolchain:
33
46
34
47
sudo apt-get install \
35
48
build-essential \
@@ -41,77 +54,134 @@ Install required tools:
41
54
libtool \
42
55
python \
43
56
texinfo \
44
-
unzip
57
+
unzip \
58
+
screen \
59
+
openssh-server
45
60
46
-
2. Optional: convenient packages for development
61
+
The system is now ready to compile Buildroot and build the base Linux image for YIO.
47
62
48
-
sudo apt-get install \
49
-
mc \
50
-
nano \
51
-
screen
63
+
2. Optional: Qt Linguist.
64
+
Qt Linguist is required to compile language files in *remote-software* before cross compilation.
65
+
- Unfortunately there's no standalone package of the required command line tools `lupdate` and `lrelease`. Therefore the complete Qt development environment needs to be installed!
66
+
- Attention: only use *apt* to install Qt on Ubuntu 19.10 or newer! Otherwise the Qt version is too old and the command line tools might be incompatible. Use the [Qt online installer](https://www.qt.io/download-open-source) instead.
52
67
53
-
3. Optional: SSH server for remote access
68
+
sudo apt-get install \
69
+
qttools5-dev-tools qt5-default
54
70
55
-
sudo apt-get install openssh-server
71
+
3. Optional: dependencies for Qt development and building Linux target in Qt Creator:
56
72
57
-
#### macOS
73
+
sudo apt-get install \
74
+
libavahi-client-dev \
75
+
libgl1-mesa-dev
58
76
59
-
TODO
77
+
#### Build Environment Variables
60
78
61
-
#### Windows
79
+
The following optional environment variables control where the build output and other artefacts during the build are stored:
# build full toolchain without YIO remote SD card image
103
+
make SKIP_BUILD_IMAGE=y
82
104
83
-
#### Build Image
105
+
This will take at least an hour or much longer on a slower system.
106
+
The `make` command will automatically initialize the buildroot Git submodule (`git submodule init && git submodule update`).
84
107
85
-
cd ${SRC_DIR}/remote-os/buildroot
86
-
87
-
make defconfig BR2_DEFCONFIG=../yio_rpi0w_defconfig
108
+
#### Build SD Card Image
109
+
110
+
The SD card image build requires at least a YIO remote configuration file in `./rpi0/boot/config.json`. The latest version can be found in the [remote-software](https://github.com/YIO-Remote/remote-software) repository.
111
+
Furthermore all application binaries and resources have to be put in `./overlay/usr/bin/yio-remote/`. These are the remote-software binary, integration plugins, fonts, icons, images and the web-configurator. See [build script in the Docker image](docker/yio-image/scripts/yio.sh) for a quick and dirty approach until each component will be properly released.
112
+
113
+
Once all resources are in place the build is a simple command:
114
+
115
+
cd $SRC_DIR/remote-os
88
116
make
89
117
90
118
Hint: redirect the `make` output log into a logfile to easy find an error during building or when using `screen` without scrollback capability:
91
119
92
-
make 2>&1 | tee ../buildlog-$(date +"%Y%m%d_%H%M%S").log
120
+
make 2>&1 | tee remote-os_build_$(date +"%Y%m%d_%H%M%S").log
121
+
122
+
The final SD card image will be written to: `${BUILDROOT_OUTPUT}/images/yio-remote-sdcard.img`
123
+
124
+
### Buildroot Commands
93
125
94
-
The built SD card image can be found at: `${SRC_DIR}/remote-os/buildroot/output/images/yio-remote-sdcard.img`
126
+
All Buildroot make commands must be executed in the `remote-os` project and *not* within the /buildroot sub-directory!
127
+
The main makefile wraps all comands and takes care of configuration handling and output directories.
128
+
Most important commands:
95
129
96
-
#### Buildroot Commands
130
+
|**Command**|**Description**|
131
+
|--------------------------|------------------|
132
+
|`make`| Update configuration from project's defconfig and start build. |
133
+
|`make clean`| Deletes all of the generated files, including build files and the generated toolchain! |
134
+
|`make menuconfig`| Shows the configuration menu with the project's defconfig. All changes will be written back to the project configuration. |
135
+
|`make linux-menuconfig`| Configure Linux kernel options. |
136
+
|`make help`| Shows all options. |
97
137
98
-
TODO: shortly describe the main commands (menuconfig, clean, rebuild, etc.)
138
+
The project configuration in `rpi0/defconfig` is automatically loaded and saved back depending on the Buildroot command (see [common.mk](common.mk)). Manual `make savedefconfig BR2_DEFCONFIG=...` and `make defconfig BR2_DEFCONFIG=...` commands are no longer required and automatically taken care of!
99
139
100
-
####Write SD Card Image
140
+
## Write SD Card Image
101
141
102
142
Use [balenaEtcher](https://www.balena.io/etcher/) - available for Linux, macOS and Windows - or your favorite tool.
103
143
104
144
## Technology Research
105
145
106
146
The following technologies were / are investigated for finding an easy and automated solution to build the RPi image.
107
147
108
-
### Docker
148
+
### Build and Use external Toolchain with Buildroot
149
+
150
+
A separate toolchain would speed up the build process. This can easily be achieved with [Buildroot Submodule](https://github.com/Openwide-Ingenierie/buildroot-submodule#using-buildroot-submodule-to-build-a-toolchain-separately).
151
+
152
+
A *make clean* will no longer erase the compiler toolchain and therefore speedup a new full build. Since Qt is required to build the YIO remote projects the complete Qt tools would have to be included as well to use the separate toolchain for the remote-software and -plugin projects. Therefore we are not using this feature to keep it simple and not to introduce another build dependency.
109
153
110
-
Docker works best for running services. But it can also be used to build software or anything else. Well, that's a service too :-)
154
+
Using an external toolchain involves the following changes:
111
155
112
-
TODO:
156
+
1. Dedicated Makefile for the toolchain: `Makefile.toolchain`
113
157
114
-
-[ ] Docker setup using Docker Volumes for the build cache. (Volume mounts have too many issues on Windows).
158
+
PROJECT_NAME := toolchain
159
+
include common.mk
160
+
161
+
2. A toolchain subproject with the toolchain configuration: `toolchain/defconfig`
0 commit comments