guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: talk: fosdem-2020: Add Yocto talk.


From: Mathieu Othacehe
Subject: branch master updated: talk: fosdem-2020: Add Yocto talk.
Date: Tue, 18 Feb 2020 12:27:32 -0500

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new edb1228  talk: fosdem-2020: Add Yocto talk.
edb1228 is described below

commit edb12281e4af4f9902e8b419ea57185cac4aea0e
Author: Mathieu Othacehe <address@hidden>
AuthorDate: Tue Feb 18 18:26:47 2020 +0100

    talk: fosdem-2020: Add Yocto talk.
    
    talks/fosdem-2020/yocto: New directory.
---
 talks/fosdem-2020/yocto/ardupilot.png         | Bin 0 -> 39527 bytes
 talks/fosdem-2020/yocto/buildroot.png         | Bin 0 -> 105558 bytes
 talks/fosdem-2020/yocto/drone.png             | Bin 0 -> 126001 bytes
 talks/fosdem-2020/yocto/guix-pinea64.png      | Bin 0 -> 52034 bytes
 talks/fosdem-2020/yocto/guix.png              | Bin 0 -> 10734 bytes
 talks/fosdem-2020/yocto/layers.png            | Bin 0 -> 118910 bytes
 talks/fosdem-2020/yocto/pinea64.png           | Bin 0 -> 262062 bytes
 talks/fosdem-2020/yocto/pinea64_ardupilot.png | Bin 0 -> 288209 bytes
 talks/fosdem-2020/yocto/talk.org              | 375 ++++++++++++++++++++++++++
 talks/fosdem-2020/yocto/talk.pdf              | Bin 0 -> 843838 bytes
 talks/fosdem-2020/yocto/tools.png             | Bin 0 -> 39689 bytes
 talks/fosdem-2020/yocto/yocto.png             | Bin 0 -> 5125 bytes
 12 files changed, 375 insertions(+)

diff --git a/talks/fosdem-2020/yocto/ardupilot.png 
b/talks/fosdem-2020/yocto/ardupilot.png
new file mode 100644
index 0000000..9d55085
Binary files /dev/null and b/talks/fosdem-2020/yocto/ardupilot.png differ
diff --git a/talks/fosdem-2020/yocto/buildroot.png 
b/talks/fosdem-2020/yocto/buildroot.png
new file mode 100644
index 0000000..23cc062
Binary files /dev/null and b/talks/fosdem-2020/yocto/buildroot.png differ
diff --git a/talks/fosdem-2020/yocto/drone.png 
b/talks/fosdem-2020/yocto/drone.png
new file mode 100644
index 0000000..0fe94ca
Binary files /dev/null and b/talks/fosdem-2020/yocto/drone.png differ
diff --git a/talks/fosdem-2020/yocto/guix-pinea64.png 
b/talks/fosdem-2020/yocto/guix-pinea64.png
new file mode 100644
index 0000000..c603599
Binary files /dev/null and b/talks/fosdem-2020/yocto/guix-pinea64.png differ
diff --git a/talks/fosdem-2020/yocto/guix.png b/talks/fosdem-2020/yocto/guix.png
new file mode 100644
index 0000000..9c3c6de
Binary files /dev/null and b/talks/fosdem-2020/yocto/guix.png differ
diff --git a/talks/fosdem-2020/yocto/layers.png 
b/talks/fosdem-2020/yocto/layers.png
new file mode 100644
index 0000000..7cd8d06
Binary files /dev/null and b/talks/fosdem-2020/yocto/layers.png differ
diff --git a/talks/fosdem-2020/yocto/pinea64.png 
b/talks/fosdem-2020/yocto/pinea64.png
new file mode 100644
index 0000000..2faf1e6
Binary files /dev/null and b/talks/fosdem-2020/yocto/pinea64.png differ
diff --git a/talks/fosdem-2020/yocto/pinea64_ardupilot.png 
b/talks/fosdem-2020/yocto/pinea64_ardupilot.png
new file mode 100644
index 0000000..7024d75
Binary files /dev/null and b/talks/fosdem-2020/yocto/pinea64_ardupilot.png 
differ
diff --git a/talks/fosdem-2020/yocto/talk.org b/talks/fosdem-2020/yocto/talk.org
new file mode 100644
index 0000000..10d7776
--- /dev/null
+++ b/talks/fosdem-2020/yocto/talk.org
@@ -0,0 +1,375 @@
+#+TITLE: GNU Guix as an alternative to the Yocto Project
+#+AUTHOR: Mathieu Othacehe <address@hidden>
+#+DATE: 2020-02-02
+#+OPTIONS: H:1 toc:nil num:t
+#+LATEX_CLASS: beamer
+#+LATEX_CLASS_OPTIONS: [presentation]
+#+BEAMER_HEADER: \setbeamertemplate{footline}[page number]{}
+#+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{}
+#+BEAMER_THEME: Madrid
+
+#+begin_src emacs-lisp :results output silent :exports none
+  (setq org-latex-listings 'minted
+        org-latex-packages-alist '(("newfloat" "minted"))
+        org-latex-pdf-process
+        '("pdflatex -shell-escape -interaction nonstopmode -output-directory 
%o %f"
+          "pdflatex -shell-escape -interaction nonstopmode -output-directory 
%o %f")))
+#+end_src
+
+* About myself
+  #+ATTR_LATEX: :width 5cm
+  [[file:drone.png]]
+
+- Working as a Linux embedded engineer for 7 years.
+  
+- Mostly making drones and other IOT devices using Buildroot, Yocto, and
+  Alchemy (Android based build system).
+
+* Using the right tools
+  #+ATTR_LATEX: :width 6cm
+  [[file:tools.png]]
+
+- I've been switching from distributions to distributions, from desktop
+  environments to desktop environments for a few years.
+
+- Kept using GNU Emacs the whole time.
+
+- Never found in Buildroot, Yocto and AOSP[fn:1] build system a tool that I 
could rely
+  on to produce embedded Linux root file-systems.
+[fn:1] Android Open Source Project
+
+* GNU Guix
+  #+ATTR_LATEX: :width 2cm
+  [[file:guix.png]]
+
+- In the meantime, I'm quite involved with GNU Guix.
+
+- Who has ever heard of GNU Guix?
+
+- GNU Guix is many things:
+       - package manager
+       - tool to instanciate an operating system
+       - container provisioning tool
+       - continuous integration/deployment tool
+
+* GNU Guix vs Yocto
+What to expect from Yocto & friends?
+
+- A tool that can generate disk-images.
+- A wide board support & packages database.
+- A versatile tool that can adapt to industrial mess (X boards x Y hardware
+  revisions).
+
+* Let's fly
+  #+ATTR_LATEX: :width 10cm
+  [[file:pinea64_ardupilot.png]]
+
+- Let's take a real world use case to compare both tools: installation of
+  Ardupilot[fn:2] on a Pine A64 LTS.
+[fn:2] Unmanned vehicle autopilot software.
+
+* Using Yocto
+** Bash
+    :PROPERTIES:
+    :BEAMER_col: 0.8
+    :END:
+#+ATTR_LATEX: :options fontsize=\small,breaklines=true
+ #+begin_src bash
+   apt install gawk wget gt-core diffstat unzip texinfo gcc-multilib 
build-essential chrpath socat libsdl1.2-dev xterm
+
+   git clone git://git.yoctoproject.org/poky && cd poky
+
+   git clone https://github.com/alistair23/meta-pine64.git
+
+   . oe-init-build-env 
+
+   bitbake-layers add-layer ../meta-pine64
+
+   # This package does not exist yet.
+   echo 'IMAGE_INSTALL_append = "ardupilot"' >> conf/local.conf
+
+   MACHINE=pine-a64-lts bitbake core-image-base
+ #+end_src
+
+* Unexpected failures
+** Output
+    :PROPERTIES:
+    :BEAMER_env: alertblock
+    :END:
+
+#+ATTR_LATEX: :options fontsize=\scriptsize
+ #+begin_src console
+   WARNING: Host distribution "ubuntu-19.10" has not been validated with this
+   version of the build system; you may possibly experience unexpected
+   failures. It is recommended that you use a tested distribution.
+ #+end_src
+
+** Is it bad?
+    :PROPERTIES:
+    :BEAMER_env: alertblock
+    :END:
+ - I don't want to go any further. Build should be distribution independant
+   and fully reproducible.
+
+* Yocto build result
+ - 8 hours and 50GB later, I have a disk-image than I can copy onto an
+   SD-card, and boot from.
+
+* Using GNU Guix
+** Operating system configuration (config.scm)
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src scheme
+(use-modules (gnu) (gnu bootloader u-boot) (gnu packages drones))
+
+(operating-system
+  (host-name "vignemale")
+  (timezone "Europe/Paris")
+  (locale "en_US.utf8")
+  (bootloader (bootloader-configuration
+               (bootloader u-boot-pine64-lts-bootloader)
+               (target "/dev/vda")))
+  (initrd-modules (cons* "sunxi-mmc" "sd_mod" "axp20x-rsb" "axp20x-regulator"
+                         %base-initrd-modules))
+  (file-systems (cons (file-system
+                        (device (file-system-label "my-root"))
+                        (mount-point "/")
+                        (type "ext4"))
+                      %base-file-systems))
+  (packages (cons arducopter-bbbmini %base-packages))
+  (services (cons (service agetty-service-type
+                           (agetty-configuration
+                            (extra-options '("-L")) ; no carrier detect
+                            (baud-rate "115200")
+                            (term "vt100")
+                            (tty "ttyS0")))
+                  %base-services)))
+ #+end_src
+
+* Using GNU Guix
+** Create the disk-image
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+ #+begin_src python
+guix system disk-image --target aarch64-linux-gnu config.scm
+ #+end_src
+ 
+** Flash it
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\small
+ #+begin_src bash
+dd if=/gnu/store/yjslrvdszyng7ism4cdy-disk-image of=/dev/mmcblk0
+ #+end_src
+
+** Disclaimer
+ This will not work using the current GNU Guix 1.0.1 release.
+
+* Using GNU Guix
+  #+ATTR_LATEX: :width 10cm
+  [[file:guix-pinea64.png]]
+
+In short:
+- 1 file and 1 command.
+- A few minutes to build a whole disk-image with substitutes locally
+  available.
+
+* Now fly!
+
+* Tool organization
+- Yocto has many layers, maintained by different entites. Quality and support
+  of those layers can vary substantially.
+
+- Guix has one Git repository and supports 12000 packages on 4
+  architectures. It is also possible to add external packages definitions
+  using various mechanisms.
+
+* Tool organization
+  #+ATTR_LATEX: :width 12cm
+  [[file:layers.png]]
+
+* Build reproducibility
+Both GNU Guix and Yocto aim for "Reproducible builds". But Yocto also states:
+
+** Yocto wiki
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+begin_quote
+"Depending on your circumstances and requirements, it may help to:
+    - build on the same distro version with the same installed packages
+    - build in the same path
+    - use the same build hardware"
+#+end_quote
+
+* Build reproducibility
+- GNU Guix is building in isolated build environments. You can expect the same
+  result using different host distributions and different build paths!
+
+- No need to use a docker image or a virtual machine to be able to reproduce a
+  build, running the same version of GNU Guix is enough.
+
+* Substitutes and offloading
+- Using substitutes, disk-space and build time is considerably reduced. By
+  default, GNU Guix will use an official build farm to get substitutes.
+
+- It is also very is easy to setup build offloading to different machines on
+  different architectures.
+
+- Yocto can setup shared sstate cache but if you are not running the same
+  distro at the same exact version, chances of hitting substitutes are
+  reduced.
+
+* Deploying the same config on multiple supports
+An operating-system object can be instanciated on multiple supports.
+
+** Deploy systems
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+
+#+ATTR_LATEX: :options escapeinside=||
+ #+begin_src bash
+# Create a disk image for the host architecture.
+guix system disk-image config.scm
+
+# Create a disk image for a target architecture.
+guix system disk-image --target aarch64-linux-gnu config.scm
+
+# Reconfigure my running Guix System.
+guix system reconfigure config.scm
+
+# Create a virtual machine image.
+guix system vm-image config.scm
+
+# Deploy to remote servers.
+guix deploy deploy.scm
+ #+end_src
+
+* Tool handling as an integrator
+** Creating multiple vehicles
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src scheme
+(use-modules (gnu)
+             (gnu packages drones)
+             (base-system))
+
+(define (ardupilot-package vehicle)
+  (case vehicle
+    ((copter) arducopter-bbbmini)
+    ((plane)  arduplane-bbbmini)
+    (else (error "Unsupported vehicle."))))
+
+(define (make-vehicle vehicle)
+  (operating-system
+    (inherit my-base-os)
+    (packages
+     (cons (ardupilot-package vehicle) %base-packages))))
+
+(make-vehicle 'copter)
+;;(make-vehicle 'plane)
+ #+end_src
+
+* Tool handling as an integrator
+** Enjoying Guix scheme API
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src scheme
+;; Get all licenses.
+(format #t "Using licenses: ~%~{  - ~a~%~}%"
+        (delete-duplicates
+         (map license-name
+              (flatten (map package-license
+                            (operating-system-packages my-os))))))
+ #+end_src
+
+** Result
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src console
+Using licenses: 
+  - GPL 2+
+  - GPL 2
+  - GPL 3+
+  - LGPL 2.0+
+  - Original BSD
+  - Public Domain
+  - MPL 2.0
+  - Modified BSD
+  - ISC
+  - LGPL 2.1+
+  - X11
+  - LGPL 2.0
+  - LGPL 3+
+  - non-copyleft
+ #+end_src
+* Tool handling as an integrator
+** Enjoying Guix scheme API
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src scheme
+;; Get all packages licensed GPL 3+.
+(format #t "Packages licensed GPL 3+: ~{~a ~}~%"
+        (map package-name
+             (filter (lambda (package)
+                       (any (lambda (license)
+                              (equal? license gpl3+))
+                            (flatten (list (package-license package)))))
+                     (operating-system-packages os))))
+ #+end_src
+
+** Result
+#+ATTR_LATEX: :options fontsize=\tiny,breaklines=true
+ #+begin_src console
+Packages licensed GPL 3+: which less zile nano util-linux-with-udev inetutils 
info-reader guile-readline guile-colorized bash coreutils findutils grep sed 
diffutils patch gawk tar gzip lzip
+ #+end_src
+
+* Tool handling as a developer
+** Adding an SSH server
+    :PROPERTIES:
+    :BEAMER_env: block
+    :END:
+#+ATTR_LATEX: :options fontsize=\small,breaklines=true
+ #+begin_src scheme
+   (use-modules (gnu)
+                (gnu services ssh)
+                (base-system))
+
+  (operating-system
+    (inherit my-base-os)
+    (services
+     (cons (service openssh-service-type
+                    (openssh-configuration
+                     (permit-root-login 'without-password)
+                     (authorized-keys
+                      `(("mathieu"
+                         ,(local-file
+                           "/home/mathieu/.ssh/id_rsa.pub"))))
+                     (port-number 2222)))
+           %base-services)))
+ #+end_src
+* Some limits
+- Many packages build natively but fail to cross-compile.
+- The minimal image isn't minimal yet (1.5GB vs 300MB).
+- No support for minimalistic libc.
+- Board support catalog still has to be improved.
+* Conclusion
+- GNU Guix is already a real alternative to Yocto.
+- Build reproducibility and substitutes make developments faster and easier.
+- The GNU Guix high level Scheme API can benefit system integrators as
+  well as developers.
+- GNU Guix is fun, come help us!
+* Thank you
+- Thanks for your attention.
+- Any questions?
+
diff --git a/talks/fosdem-2020/yocto/talk.pdf b/talks/fosdem-2020/yocto/talk.pdf
new file mode 100644
index 0000000..eab2a5d
Binary files /dev/null and b/talks/fosdem-2020/yocto/talk.pdf differ
diff --git a/talks/fosdem-2020/yocto/tools.png 
b/talks/fosdem-2020/yocto/tools.png
new file mode 100644
index 0000000..557d983
Binary files /dev/null and b/talks/fosdem-2020/yocto/tools.png differ
diff --git a/talks/fosdem-2020/yocto/yocto.png 
b/talks/fosdem-2020/yocto/yocto.png
new file mode 100644
index 0000000..b9e0674
Binary files /dev/null and b/talks/fosdem-2020/yocto/yocto.png differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]