-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
592 lines (533 loc) · 24.8 KB
/
index.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>cdynak / linux2018</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Embedded Linux build systems</h1>
<h2>Cezary Dynak</h2>
<h3>2018-04-07</h3>
</section>
<!-- https://github.com/impress/impress.js/wiki/Examples-and-demos -->
<!-- https://github.com/hakimel/reveal.js/wiki/Example-Presentations -->
<section>
<section>
<h2>CEZARY DYNAK</h3>
<h3>about me</h3>
</section>
<section>
<h2>SOME TIME AGO...</h2>
<ul>
<li>Wrocław University of Science and Technology</li>
<li>Faculty of Electronics / W4</li>
<li>Department of Cybernetics and Robotics / K7</li>
<li>Laboratory 07/C-3 (diablo/panamint)</li>
<li>Automatyka i Robotyka / Embedded Robotics</li>
</ul>
</section>
<section>
<h2>CURRENTLY</h2>
<a href="http://www.spyro-soft.com"><img src="http://www.spyro-soft.com/wp-content/themes/spyro/img/logo.svg" /></a>
<ul>
<li>Node.js developer</li>
<li>IoT back-end (cloud)</li>
<li><a href="mailto:cdynak@spyro-soft.com">cdynak@spyro-soft.com</a></li>
</ul>
</section>
<section>
<a href="http://www.fsf.org/fb">
<img src="http://static.fsf.org/nosvn/no-facebook-me.png" alt="Not f'd — you won't find me on Facebook" />
</a>
<br></br>
<ul>
<li><a href="https://github.com/cdynak">github.com/cdynak</a></li>
<li><a href="https://linkedin.com/in/cdynak">linkedin.com/in/cdynak</a></li>
<li><a href="https://last.fm/user/cezdyn">last.fm/user/cezdyn</a></li>
</ul>
</section>
</section>
<section>
<section>
<h2>PLAN</h2>
<h4><a href="https://cdynak.github.io/linux2018">cdynak.github.io/linux2018</a></h4>
<ul>
<li>Embedded Linux build systems - comparison</li>
<ul>
<li>introduction</li>
<li>definitions</li>
<li>examples</li>
</ul>
<li>Embedded Linux build systems - applications</li>
<ul>
<li>IoT</li>
<li>cloud</li>
<li>edge</li>
</ul>
</ul>
</section>
</section>
<section>
<section>
<h2>Linux</h2>
<h3>cloud / desktop / embedded</h3>
</section>
<section>
<h2>supercomputers</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/0/0d/Operating_systems_used_on_top_500_supercomputers.svg" />
<!-- https://commons.wikimedia.org/wiki/File:Operating_systems_used_on_top_500_supercomputers.svg -->
<!-- https://en.wikipedia.org/wiki/File:Operating_systems_used_on_top_500_supercomputers.svg -->
<!-- https://en.wikipedia.org/wiki/Usage_share_of_operating_systems -->
</section>
<section>
<h2>cloud</h2>
<img src="http://fossbytes.com/wp-content/uploads/2015/08/Ubuntu-linux-cloud-os-1.jpg" />
<!-- https://fossbytes.com/ubuntu-linux-is-the-most-popular-operating-system-in-cloud/ -->
</section>
<section>
<h2>desktop</h2>
<img src="https://upload.wikimedia.org/wikipedia/commons/8/81/Operatingsystem_market_share.svg" />
<!-- https://commons.wikimedia.org/wiki/File:Operatingsystem_market_share.svg -->
<!-- https://en.wikipedia.org/wiki/Usage_share_of_operating_systems -->
</section>
<section>
<h2>desktop</h2>
<img src="http://static4.businessinsider.com/image/505375a769bedda419000017-960/wintel-monopoly.jpg" />
<!-- www.businessinsider.com/mobile-market-share-2012-11 -->
</section>
<section>
<h2>mobile</h2>
<img src="http://zoomcloud.co.nz/wp-content/uploads/2014/08/Smartphone-Market-share.png" />
<!-- http://zoomcloud.co.nz/index.php/smartphone-market-share-2014-stars/ -->
<!-- http://static1.businessinsider.com/image/537b72f169bedd1e04384fab-1200-924/smartphoneosmarketshare.png -->
<!-- http://www.businessinsider.com/iphone-v-android-market-share-2014-5 -->
</section>
<section>
<h2>embedded</h2>
<img src="https://lcom.static.linuxfound.org/images/stories/41373/VDC-embedded-open-source-market.jpg" />
<!-- https://www.linux.com/news/embedded-linux-keeps-growing-amid-iot-disruption-says-study -->
</section>
<section>
<h2>embedded</h2>
<img src="https://static4.arrow.com/-/media/images/research-and-events/articles/0916/0916-iot-operating-systems-final-image-2.jpg" />
<!-- https://www.arrow.com/en/research-and-events/articles/iot-operating-systems -->
</section>
</section>
<section>
<section>
<h2>Embedded Linux</h2>
</section>
<section>
<h2>so...
<h2>What are the Embedded Linux build systems?!</h2>
</section>
<section>
<h3>For a lot of people it all starts with...</h3>
<img src="https://elinux.org/images/thumb/9/96/RpiFront.jpg/800px-RpiFront.jpg" />
</section>
<section>
<h3>But there are others...</h3>
<ul>
<li>https://raspberrypi.org</li>
<li>https://beagleboard.org/black</li>
<li>http://wiki.litesom.grinn-global.com</li>
<li>https://wandboard.org</li>
<li>http://pandaboard.org</li>
</ul>
<!-- https://en.wikipedia.org/wiki/Comparison_of_single-board_computers -->
<!-- https://hackaday.com/2017/06/19/intel-discontinues-joule-galileo-and-edison-product-lines/ -->
</section>
<section>
<img src="img/dev-boards.png" />
</section>
<section>
<h3>But why?</h3>
<ul>
<li>for prototyping</li>
<li>for promotion</li>
<li>for learning</li>
<li>for fun</li>
</ul>
</section>
<section>
<h3>How to make it work?</h3>
<ul>
<li>Download dedicated OS image from web</li>
<li>or... build own image!</li>
</ul>
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
wget https://downloads.raspberrypi.org/raspbian_latest
pv sdcard.img | dd of=/dev/sdb bs=4M oflag=dsync
</code></pre>
</section>
</section>
<section>
<section>
<h2>Testing and Comparing</h1>
<ul>
<li>Representative set of embedded devices</li>
<li>Available open source distribution builders</li>
</ul>
</section>
<section>
<img height="100" src="https://buildroot.org/images/logo.png" />
<img src="https://openwrt.org/lib/tpl/openwrt/images/logo.png" />
<img height="150" src="http://ltib.org/graphics/ltib_build.png" />
<img height="150" src="https://www.ptxdist.org/images/PTXdist_Logo_RGB.svg" />
<img src="http://www.yoctoproject.org/docs/current/yocto-project-qs/figures/yocto-project-transp.png" />
</section>
<section>
<img src="img/builders-table.png" />
</section>
<section>
<h3>But there are others...</h3>
<ul>
<li>linux from scratch</li>
<li>debootstrap</li>
<li>wind river</li>
</ul>
</section>
<section>
<img src="img/os-builders-trends.png" />
</section>
<section>
<img src="img/openwrt-trends.png" />
</section>
<section>
<h3>generalized os builders structure</h3>
<ul>
<li>Source code</li>
<li>Host OS requirements</li>
<li>Cross-compilation toolchain</li>
<li>Target OS configuration</li>
<li>Produced output</li>
</ul>
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
apt-get install python-dev python-pip
pip install python-openstackclient
openstack server create --flavor 'c2-30' --image 'Debian 9' --network 'Ext-Net' --key-name 'my_key-name' '15sl1'
ssh debian@54.37.130.68
</code></pre>
</section>
<section>
<img src="https://buildroot.org/images/logo.png" />
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
sudo apt update
sudo apt upgrade
sudo apt install make gcc g++ libncurses-dev unzip git patch python rsync bc bzip2
wget https://buildroot.org/downloads/buildroot-2017.02.8.tar.gz
tar -zxf buildroot-2017.02.8.tar.gz
cd buildroot-2017.02.8/
make raspberrypi_defconfig
make
ls output/images/sdcard.img
</code></pre>
</section>
<section>
<img src="https://openwrt.org/lib/tpl/openwrt/images/logo.png" />
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
sudo apt install make gcc g++ libncurses-dev unzip git gawk file zlib1g-dev
git clone -b v17.01.4 https://github.com/openwrt/openwrt
cd openwrt/
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make menuconfig
# Target System (Broadcom BCM27xx)
# Target Profile (Raspberry Pi B/B+/CM/Zero/ZeroW)
time make -j
cp build_dir/target-arm_arm1176jzf-s+vfp_musl-1.1.16_eabi/linux-brcm2708_bcm2708/tmp/lede-brcm2708-bcm2708-rpi-ext4-sdcard.img ~
</code></pre>
</section>
<section>
<img src="http://ltib.org/graphics/ltib_build.png" />
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
sudo apt install make gcc g++ libncurses-dev unzip rpm bison patch tcl zlib1g-dev
wget https://github.com/downloads/midnightyell/RPi-LTIB/raspberrypi-tools-9c3d7b6-1.i386.rpm
sudo mkdir -p /opt/ltib/pkgs/
sudo cp raspberrypi-tools-9c3d7b6-1.i386.rpm /opt/ltib/pkgs/
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install zlib1g:i386 libstdc++:i386
wget http://download.savannah.nongnu.org/releases/ltib/ltib-13-2-1-sv.tar.gz
tar -xzf ltib-13-2-1-sv.tar.gz
cd ltib-13-2-1-sv/
time ./ltib
# Platform choice (Raspberry Pi with BCM2835 SoC)
cp output/images/sdcard.img ~
</code></pre>
</section>
<section>
<img src="https://www.ptxdist.org/images/PTXdist_Logo_RGB.svg" />
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
sudo apt install make gcc g++ libncurses-dev unzip git gawk flex bison gettext python-dev lzop pkg-config libxml-parser-perl
wget http://public.pengutronix.de/software/ptxdist/ptxdist-2018.01.0.tar.bz2
tar -xjf ptxdist-2018.01.0.tar.bz2
cd ptxdist-2018.01.0
./configure
make
sudo make install
cd ..
wget http://public.pengutronix.de/software/ptxdist/ptxdist-2016.06.0.tar.bz2
tar -xjf ptxdist-2016.06.0.tar.bz2
cd ptxdist-2016.06.0
./configure
make
sudo make install
cd ..
wget https://public.pengutronix.de/oselas/toolchain/OSELAS.Toolchain-2016.06.1.tar.bz2
tar -xjf OSELAS.Toolchain-2016.06.1.tar.bz2
cd OSELAS.Toolchain-2016.06.1/
ptxdist-2016.06.0 select ptxconfigs/arm-1136jfs-linux-gnueabihf_gcc-5.4.0_glibc-2.23_binutils-2.26_kernel-4.6-sanitized.ptxconfig
ptxdist-2016.06.0 migrate
time ptxdist-2016.06.0 go
git clone https://git.pengutronix.de/cgit/DistroKit/
cd DistroKit/
ptxdist-2018.01.0 platform configs/platform-rpi/platformconfig
ptxdist-2018.01.0 migrate
time ptxdist-2018.01.0 images
cp platform-rpi/images/hd.img ~
</code></pre>
</section>
<section>
<img src="http://www.yoctoproject.org/docs/current/yocto-project-qs/figures/yocto-project-transp.png" />
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
wget http://commondatastorage.googleapis.com/git-repo-downloads/repo
chmod a+x repo
sudo mv repo /usr/local/bin/
sudo apt install make gcc g++ unzip git
sudo apt install gawk diffstat texinfo build-essential chrpath
export MACHINE=raspberrypi
mkdir yoctoproject
cd yoctoproject
repo init -u https://github.com/cdynak/yocto-manifest -m $MACHINE.xml
repo sync
source poky/oe-init-build-env
%MACHINE=wandboard DISTRO=poky source setup-environment build
% vi conf/bblayers.conf (...?)
time bitbake core-image-minimal
cp tmp/deploy/images/$MACHINE/*img ~
</code></pre>
</section>
<section>
<h3>Tests</h3>
<ul>
<li>With respect to the target OS</li>
<li>With respect to the host OS</li>
</ul>
</section>
<section>
<img src="img/cmpr-buildroot.png" />
<img src="img/cmpr-openwrt.png" />
</section>
<section>
<img src="img/cmpr-ptxdist.png" />
<img src="img/cmpr-yocto.png" />
</section>
<section>
<img src="img/hostOS.png" />
</section>
<section>
<h3>Example use cases</h3>
<ul>
<li>The Node.js IoT application</li>
<li>Building Containers</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Node.js SCADA</h2>
</section>
<section>
<ul>
<li><a href="github.com/newterm/szarp">github.com/newterm/szarp</a> (C++/wxWidgets, MIT)</li>
<li><a href="github.com/RapidScada/scada">github.com/RapidScada/scada</a> (C#, Apache)</li>
<li><a href="github.com/SCADA-LTS/Scada-LTS">github.com/SCADA-LTS/Scada-LTS</a> (Java, GPLv2)</li>
<li><a href="github.com/trombastic/PyScada">github.com/trombastic/PyScada</a> (Python, GPLv3)</li>
<li><a href="oscada.org/websvn/listing.php?repname=OpenSCADA">oscada.org/websvn/listing.php?repname=OpenSCADA</a> (C++, GPLv2)</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Linux Containers</h2>
</section>
<!--section>
<h3>Containerization</h3>
<p>Operating-system-level virtualization, also known as
containerization,refers to an operating system feature in which
the kernel allows the existence of multiple isolated user-space
instances. Such instances, called containers</p>
</section-->
<section>
<h4>Currently there is only one king</h4>
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4e/Docker_%28container_engine%29_logo.svg" />
<!-- https://en.wikipedia.org/wiki/File:Docker_(container_engine)_logo.svg -->
</section>
<section>
<img src="https://www.docker.com/sites/default/files/containers-vms-together.png" />
<!-- https://www.docker.com/what-container -->
</section>
<section>
<h3>How to make it work?</h3>
<ul>
<li>Download dedicated OS image from web</li>
<li>or... build own image!</li>
</ul>
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
</code></pre>
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
docker pull alpine
docker images
docker run alpine ls -l
docker run -it alpine /bin/sh
</code></pre>
</section>
</section>
<section>
<section>
<h2>Building Linux Containers</h2>
</section>
<section>
<pre><code class="hljs" data-trim contenteditable>
cd output/images
mkdir extra extra/etc extra/sbin extra/lib extra/lib64
touch extra/etc/resolv.conf
touch extra/sbin/init
cp /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libc.so.6 extra/lib
cp /lib64/ld-linux-x86-64.so.2 extra/lib64
cp rootfs.tar fixup.tar
tar rvf fixup.tar -C extra .
docker import - basic-system < fixup.tar
docker run -t -i basic-system /bin/sh
</code></pre>
<!-- https://blog.docker.com/2013/06/create-light-weight-docker-containers-buildroot/ -->
</section>
</section>
<section>
<section>
<h1>CONCLUSIONS</h1>
</section>
<section>
<h3>Build systems are better than distributions</h3>
<ul>
<li>For professional usage</li>
<li>Latest versions of kernel and packages</li>
<li>Easy update and portability</li>
<li>Examples: PandaBoard, Raspbian MPK</li>
</ul>
</section>
<section>
<img src="https://gallery.dpcdn.pl/imgd/News/81008/g_-_-x-_-_-_xc66f0287-6f49-4948-9b92-039672875592.png" \>
<!-- https://www.dobreprogramy.pl/Kasowniki-nowego-systemu-biletowego-we-Wroclawiu-zawiesisz-przez-Google-Pay,News,86699.html -->
</section>
<section>
<h3>Comparability</h3>
<ul>
<li>Experience from one build system is useful on the others</li>
<li>Software is easily portable between build systems</li>
<li>Companies should try to experiment</li>
</ul>
</section>
<section>
<img height="600" src="http://turnoff.us/image/en/devops-explained.png" \>
</section>
<section>
<h3>Edge computing</h3>
<ul>
<li>Perfect tools for edge computing</li>
<li>Portable between cloud and embedded</li>
<li>It is affordable to run Node.js on embedded device</li>
<li>Escaping from vendor/cloud lock-in...</li>
</ul>
</section>
<section>
<img height="600" src="http://turnoff.us/image/en/net-neutrality-and-iot.png" \>
</section>
<section>
<img height="600" src="http://turnoff.us/image/en/net-neutrality-and-iot-2.png" \>
</section>
<section>
<h3>Open questions</h3>
<ul>
<li>Why only Linux?</li>
<li>What about MINIX, BSD, Darvin and HURD?</li>
<li>Embedded Unix build systems?</li>
<li>(yes, I know that Linux Standard Base and other "great standarizations" failed...)</li>
</ul>
</section>
</section>
<section>
<section>
<h2>Thank you for attention</h2>
</section>
<section>
<h2>bibliography is inside source code</h2>
<p><a href="cdynak.github.io/linux2018">cdynak.github.io/linux2018</a></p>
<p><a href="github.com/cdynak/linux2018">github.com/cdynak/linux2018</a></p>
<p><a href="github.com/cdynak/embedded-linux-build-systems">github.com/cdynak/embedded-linux-build-systems</a></p>
</section>
<section>
<h2>discussion / questions?</h2>
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>