aboutsummaryrefslogtreecommitdiff
path: root/gnu/system/install.scm
blob: 7fa5c15324ac06d1845a7995cc20960bb42d213b (about) (plain)
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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu system install)
  #:use-module (gnu)
  #:use-module (gnu system)
  #:use-module (gnu bootloader u-boot)
  #:use-module (guix gexp)
  #:use-module (guix store)
  #:use-module (guix monads)
  #:use-module (guix modules)
  #:use-module ((guix packages) #:select (package-version))
  #:use-module ((guix store) #:select (%store-prefix))
  #:use-module (gnu installer)
  #:use-module (gnu system locale)
  #:use-module (gnu services avahi)
  #:use-module (gnu services dbus)
  #:use-module (gnu services networking)
  #:use-module (gnu services shepherd)
  #:use-module (gnu services ssh)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages bootloaders)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages fonts)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages package-management)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages xorg)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-26)
  #:export (installation-os
            a20-olinuxino-lime-installation-os
            a20-olinuxino-lime2-emmc-installation-os
            a20-olinuxino-micro-installation-os
            bananapi-m2-ultra-installation-os
            beaglebone-black-installation-os
            mx6cuboxi-installation-os
            nintendo-nes-classic-edition-installation-os
            novena-installation-os
            firefly-rk3399-installation-os
            pine64-plus-installation-os
            pinebook-installation-os
            rock64-installation-os
            rockpro64-installation-os
            rk3399-puma-installation-os
            wandboard-installation-os
            os-with-u-boot))

;;; Commentary:
;;;
;;; This module provides an 'operating-system' definition for use on images
;;; for USB sticks etc., for the installation of the GNU system.
;;;
;;; Code:


;;;
;;; Documentation service.
;;;

(define %installation-node-names
  ;; Translated name of the "System Installation" node of the manual.  Ideally
  ;; we'd extract it from the 'guix-manual' gettext domain, but that one is
  ;; usually not available at run time, hence this hack.
  '(("de" . "Systeminstallation")
    ("en" . "System Installation")
    ("es" . "Instalación del sistema")
    ("fr" . "Installation du système")
    ("ru" . "Установка системы")))

(define (log-to-info tty user)
  "Return a script that spawns the Info reader on the right section of the
manual."
  (program-file "log-to-info"
                #~(let* ((tty      (open-file #$(string-append "/dev/" tty)
                                              "r0+"))
                         (locale   (cadr (command-line)))
                         (language (string-take locale
                                                (string-index locale #\_)))
                         (infodir  "/run/current-system/profile/share/info")
                         (per-lang (string-append infodir "/guix." language
                                                  ".info.gz"))
                         (file     (if (file-exists? per-lang)
                                       per-lang
                                       (string-append infodir "/guix.info")))
                         (node     (or (assoc-ref '#$%installation-node-names
                                                  language)
                                       "System Installation")))
                    (redirect-port tty (current-output-port))
                    (redirect-port tty (current-error-port))
                    (redirect-port tty (current-input-port))

                    (let ((pw (getpwnam #$user)))
                      (setgid (passwd:gid pw))
                      (setuid (passwd:uid pw)))

                    ;; 'gunzip' is needed to decompress the doc.
                    (setenv "PATH" (string-append #$gzip "/bin"))

                    ;; Change this process' locale so that command-line
                    ;; arguments to 'info' are properly encoded.
                    (catch #t
                      (lambda ()
                        (setlocale LC_ALL locale)
                        (setenv "LC_ALL" locale))
                      (lambda _
                        ;; Sometimes LOCALE itself is not available.  In that
                        ;; case pick the one UTF-8 locale that's known to work
                        ;; instead of failing.
                        (setlocale LC_ALL "en_US.utf8")
                        (setenv "LC_ALL" "en_US.utf8")))

                    (execl #$(file-append info-reader "/bin/info")
                           "info" "-d" infodir "-f" file "-n" node))))

(define (documentation-shepherd-service tty)
  (list (shepherd-service
         (provision (list (symbol-append 'term- (string->symbol tty))))
         (requirement '(user-processes host-name udev virtual-terminal))
         (start #~(lambda* (#:optional (locale "en_US.utf8"))
                    (fork+exec-command
                     (list #$(log-to-info tty "documentation") locale)
                     #:environment-variables
                     `("GUIX_LOCPATH=/run/current-system/locale"
                       "TERM=linux"))))
         (stop #~(make-kill-destructor)))))

(define %documentation-users
  ;; User account for the Info viewer.
  (list (user-account (name "documentation")
                      (system? #t)
                      (group "nogroup")
                      (home-directory "/var/empty"))))

(define documentation-service-type
  ;; Documentation viewer service.
  (service-type (name 'documentation)
                (extensions
                 (list (service-extension shepherd-root-service-type
                                          documentation-shepherd-service)
                       (service-extension account-service-type
                                          (const %documentation-users))))
                (description "Run the Info reader on a tty.")))


(define %backing-directory
  ;; Sub-directory used as the backing store for copy-on-write.
  "/tmp/guix-inst")

(define cow-store-service-type
  (shepherd-service-type
   'cow-store
   (lambda _
     (define (import-module? module)
       ;; Since we don't use deduplication support in 'populate-store', don't
       ;; import (guix store deduplication) and its dependencies, which
       ;; includes Guile-Gcrypt.
       (and (guix-module-name? module)
            (not (equal? module '(guix store deduplication)))))

     (shepherd-service
      (requirement '(root-file-system user-processes))
      (provision '(cow-store))
      (documentation
       "Make the store copy-on-write, with writes going to \
the given target.")

      ;; This is meant to be explicitly started by the user.
      (auto-start? #f)

      (modules `((gnu build install)
                 ,@%default-modules))
      (start
       (with-imported-modules (source-module-closure
                               '((gnu build install))
                               #:select? import-module?)
         #~(case-lambda
             ((target)
              (mount-cow-store target #$%backing-directory)
              target)
             (else
              ;; Do nothing, and mark the service as stopped.
              #f))))
      (stop #~(lambda (target)
                ;; Delete the temporary directory, but leave everything
                ;; mounted as there may still be processes using it since
                ;; 'user-processes' doesn't depend on us.  The 'user-file-systems'
                ;; service will unmount TARGET eventually.
                (delete-file-recursively
                 (string-append target #$%backing-directory))))))
   (description "Make the store copy-on-write, with writes going to \
the given target.")))

(define (cow-store-service)
  "Return a service that makes the store copy-on-write, such that writes go to
the user's target storage device rather than on the RAM disk."
  ;; See <http://bugs.gnu.org/18061> for the initial report.
  (service cow-store-service-type 'mooooh!))


(define (/etc/configuration-files _)
  "Return a list of tuples representing configuration templates to add to
/etc."
  (define directory
    (computed-file "configuration-templates"
                   (with-imported-modules '((guix build utils))
                     #~(begin
                         (mkdir #$output)
                         (for-each (lambda (file target)
                                     (copy-file file
                                                (string-append #$output "/"
                                                               target)))
                                   '(#$(local-file "examples/bare-bones.tmpl")
                                     #$(local-file "examples/beaglebone-black.tmpl")
                                     #$(local-file "examples/desktop.tmpl")
                                     #$(local-file "examples/lightweight-desktop.tmpl"))
                                   '("bare-bones.scm"
                                     "beaglebone-black.scm"
                                     "desktop.scm"
                                     "lightweight-desktop.scm"))
                         #t))))

  `(("configuration" ,directory)))

(define configuration-template-service-type
  (service-type (name 'configuration-template)
                (extensions
                 (list (service-extension etc-service-type
                                          /etc/configuration-files)))))

(define %configuration-template-service
  (service configuration-template-service-type #t))


(define %nscd-minimal-caches
  ;; Minimal in-memory caching policy for nscd.
  (list (nscd-cache (database 'hosts)
                    (positive-time-to-live (* 3600 12))

                    ;; Do not cache lookup failures at all since they are
                    ;; quite likely (for instance when someone tries to ping a
                    ;; host before networking is functional.)
                    (negative-time-to-live 0)

                    (persistent? #f)
                    (max-database-size (* 5 (expt 2 20)))))) ;5 MiB


;; These define a service to load the uvesafb kernel module with the
;; appropriate options.  The GUI installer needs it when the machine does not
;; support Kernel Mode Setting.  Otherwise kmscon is missing /dev/fb0.
(define (uvesafb-shepherd-service _)
  (list (shepherd-service
         (documentation "Load the uvesafb kernel module if needed.")
         (provision '(maybe-uvesafb))
         (requirement '(file-systems))
         (start #~(lambda ()
                    ;; uvesafb is only supported on x86 and x86_64.
                    (or (not (and (string-suffix? "linux-gnu" %host-type)
                                  (or (string-prefix? "x86_64" %host-type)
                                      (string-prefix? "i686" %host-type))))
                        (file-exists? "/dev/fb0")
                        (invoke #+(file-append kmod "/bin/modprobe")
                                "uvesafb"
                                (string-append "v86d=" #$v86d "/sbin/v86d")
                                "mode_option=1024x768"))))
         (respawn? #f)
         (one-shot? #t))))

(define uvesafb-service-type
  (service-type
   (name 'uvesafb)
   (extensions
    (list (service-extension shepherd-root-service-type
                             uvesafb-shepherd-service)))
   (description
    "Load the @code{uvesafb} kernel module with the right options.")
   (default-value #t)))

(define %installation-services
  ;; List of services of the installation system.
  (let ((motd (plain-file "motd" "
\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m

\x1b[2m\
Using this shell, you can carry out the installation process \"manually.\"
Access documentation at any time by pressing Alt-F2.\x1b[0m
")))
    (define (normal-tty tty)
      (mingetty-service (mingetty-configuration (tty tty)
                                                (auto-login "root")
                                                (login-pause? #t))))

    (define bare-bones-os
      (load "examples/bare-bones.tmpl"))

    (list (service virtual-terminal-service-type)

          (service kmscon-service-type
                   (kmscon-configuration
                    (virtual-terminal "tty1")
                    (login-program (installer-program))))

          (login-service (login-configuration
                          (motd motd)))

          ;; Documentation.  The manual is in UTF-8, but
          ;; 'console-font-service' sets up Unicode support and loads a font
          ;; with all the useful glyphs like em dash and quotation marks.
          (service documentation-service-type "tty2")

          ;; Documentation add-on.
          %configuration-template-service

          ;; A bunch of 'root' ttys.
          (normal-tty "tty3")
          (normal-tty "tty4")
          (normal-tty "tty5")
          (normal-tty "tty6")

          ;; The usual services.
          (syslog-service)

          ;; Use the Avahi daemon to discover substitute servers on the local
          ;; network.  It can be faster than fetching from remote servers.
          (service avahi-service-type)

          ;; The build daemon.  Register the default substitute server key(s)
          ;; as trusted to allow the installation process to use substitutes by
          ;; default.
          (service guix-service-type
                   (guix-configuration (authorize-key? #t)))

          ;; Start udev so that useful device nodes are available.
          ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
          ;; regulations-compliant WiFi access.
          (udev-service #:rules (list lvm2 crda))

          ;; Add the 'cow-store' service, which users have to start manually
          ;; since it takes the installation directory as an argument.
          (cow-store-service)

          ;; Install Unicode support and a suitable font.
          (service console-font-service-type
                   (map (match-lambda
                          ("tty2"
                           ;; Use a font that contains characters such as
                           ;; curly quotes as found in the manual.
                           '("tty2" . "LatGrkCyr-8x16"))
                          (tty
                           ;; Use a font that doesn't have more than 256
                           ;; glyphs so that we can use colors with varying
                           ;; brightness levels (see note in setfont(8)).
                           `(,tty . "lat9u-16")))
                        '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))

          ;; To facilitate copy/paste.
          (service gpm-service-type)

          ;; Add an SSH server to facilitate remote installs.
          (service openssh-service-type
                   (openssh-configuration
                    (port-number 22)
                    (permit-root-login #t)
                    ;; The root account is passwordless, so make sure
                    ;; a password is set before allowing logins.
                    (allow-empty-passwords? #f)
                    (password-authentication? #t)

                    ;; Don't start it upfront.
                    (%auto-start? #f)))

          ;; Since this is running on a USB stick with a overlayfs as the root
          ;; file system, use an appropriate cache configuration.
          (nscd-service (nscd-configuration
                         (caches %nscd-minimal-caches)))

          ;; Having /bin/sh is a good idea.  In particular it allows Tramp
          ;; connections to this system to work.
          (service special-files-service-type
                   `(("/bin/sh" ,(file-append bash "/bin/sh"))))

          ;; Loopback device, needed by OpenSSH notably.
          (service static-networking-service-type
                   (list (static-networking (interface "lo")
                                            (ip "127.0.0.1")
                                            (requirement '())
                                            (provision '(loopback)))))

          (service wpa-supplicant-service-type)
          (dbus-service)
          (service connman-service-type
                   (connman-configuration
                    (disable-vpn? #t)))

          ;; Keep a reference to BARE-BONES-OS to make sure it can be
          ;; installed without downloading/building anything.  Also keep the
          ;; things needed by 'profile-derivation' to minimize the amount of
          ;; download.
          (service gc-root-service-type
                   (append
                    (list bare-bones-os
                          glibc-utf8-locales
                          texinfo
                          guile-3.0)
                    %default-locale-libcs))

          ;; Machines without Kernel Mode Setting (those with many old and
          ;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI
          ;; installer.  Some may also need a kernel parameter like nomodeset
          ;; or vga=793, but we leave that for the user to specify in GRUB.
          (service uvesafb-service-type))))

(define %issue
  ;; Greeting.
  "
\x1b[1;37mThis is an installation image of the GNU system.  Welcome.\x1b[0m

\x1b[1;33mUse Alt-F2 for documentation.\x1b[0m
")

(define installation-os
  ;; The operating system used on installation images for USB sticks etc.
  (operating-system
    (host-name "gnu")
    (timezone "Europe/Paris")
    (locale "en_US.utf8")
    (name-service-switch %mdns-host-lookup-nss)
    (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (target "/dev/sda")))
    (label (string-append "GNU Guix installation "
                          (package-version guix)))

    ;; XXX: The AMD Radeon driver is reportedly broken, which makes kmscon
    ;; non-functional:
    ;; <https://lists.gnu.org/archive/html/guix-devel/2019-03/msg00441.html>.
    ;; Thus, blacklist it.
    (kernel-arguments '("quiet" "modprobe.blacklist=radeon"))

    (file-systems
     ;; Note: the disk image build code overrides this root file system with
     ;; the appropriate one.
     (cons* (file-system
              (mount-point "/")
              (device (file-system-label "Guix_image"))
              (type "ext4"))

            ;; Make /tmp a tmpfs instead of keeping the overlayfs.  This
            ;; originally was used for unionfs because FUSE creates
            ;; '.fuse_hiddenXYZ' files for each open file, and this confuses
            ;; Guix's test suite, for instance (see
            ;; <http://bugs.gnu.org/23056>).  We keep this for overlayfs to be
            ;; on the safe side.
            (file-system
              (mount-point "/tmp")
              (device "none")
              (type "tmpfs")
              (check? #f))

            ;; XXX: This should be %BASE-FILE-SYSTEMS but we don't need
            ;; elogind's cgroup file systems.
            (list %pseudo-terminal-file-system
                  %shared-memory-file-system
                  %efivars-file-system
                  %immutable-store)))

    (users (list (user-account
                  (name "guest")
                  (group "users")
                  (supplementary-groups '("wheel")) ; allow use of sudo
                  (password "")
                  (comment "Guest of GNU"))))

    (issue %issue)
    (services %installation-services)

    ;; We don't need setuid programs, except for 'passwd', which can be handy
    ;; if one is to allow remote SSH login to the machine being installed.
    (setuid-programs (list (file-append shadow "/bin/passwd")))

    (pam-services
     ;; Explicitly allow for empty passwords.
     (base-pam-services #:allow-empty-passwords? #t))

    (packages (append
                (list glibc         ; for 'tzselect' & co.
                      fontconfig
                      font-dejavu font-gnu-unifont
                      grub          ; mostly so xrefs to its manual work
                      nss-certs)    ; To access HTTPS, use git, etc.
                %base-packages-disk-utilities
                %base-packages))))

(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
                         (triplet "arm-linux-gnueabihf"))
  "Given OS, amend it with the u-boot bootloader for BOARD,
installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET.

If you want a serial console, make sure to specify one in your
operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
  (operating-system (inherit os)
    (bootloader (bootloader-configuration
                 (bootloader (bootloader (inherit u-boot-bootloader)
                              (package (make-u-boot-package board triplet))))
                 (target bootloader-target)))))

(define* (embedded-installation-os bootloader bootloader-target tty
                                   #:key (extra-modules '()))
  "Return an installation os for embedded systems.
The initrd gets the extra modules EXTRA-MODULES.
A getty is provided on TTY.
The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
  (operating-system
    (inherit installation-os)
    (bootloader (bootloader-configuration
                 (bootloader bootloader)
                 (target bootloader-target)))
    (kernel linux-libre)
    (kernel-arguments
     (cons (string-append "console=" tty)
           (operating-system-user-kernel-arguments installation-os)))
    (initrd-modules (append extra-modules %base-initrd-modules))))

(define beaglebone-black-installation-os
  (embedded-installation-os u-boot-beaglebone-black-bootloader
                            "/dev/sda"
                            "ttyO0"
                            #:extra-modules
                            ;; This module is required to mount the sd card.
                            '("omap_hsmmc")))


(define a20-olinuxino-lime-installation-os
  (embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttyS0"))

(define a20-olinuxino-lime2-emmc-installation-os
  (embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
                            "/dev/mmcblk1" ; eMMC storage
                            "ttyS0"))

(define a20-olinuxino-micro-installation-os
  (embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttyS0"))

(define bananapi-m2-ultra-installation-os
  (embedded-installation-os u-boot-bananapi-m2-ultra-bootloader
                            "/dev/mmcblk1" ; eMMC storage
                            "ttyS0"))

(define firefly-rk3399-installation-os
  (embedded-installation-os u-boot-firefly-rk3399-bootloader
                            "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
                            "ttyS2")) ; UART2 connected on the Pi2 bus

(define mx6cuboxi-installation-os
  (embedded-installation-os u-boot-mx6cuboxi-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttymxc0"))

(define novena-installation-os
  (embedded-installation-os u-boot-novena-bootloader
                            "/dev/mmcblk1" ; SD card storage
                            "ttymxc1"))

(define nintendo-nes-classic-edition-installation-os
  (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
                            "/dev/mmcblk0" ; SD card (solder it yourself)
                            "ttyS0"))

(define pine64-plus-installation-os
  (embedded-installation-os u-boot-pine64-plus-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttyS0"))

(define pinebook-installation-os
  (embedded-installation-os u-boot-pinebook-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttyS0"))

(define rock64-installation-os
  (embedded-installation-os u-boot-rock64-rk3328-bootloader
                            "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
                            "ttyS2")) ; UART2 connected on the Pi2 bus

(define rockpro64-installation-os
  (embedded-installation-os u-boot-rockpro64-rk3399-bootloader
                            "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
                            "ttyS2")) ; UART2 connected on the Pi2 bus

(define rk3399-puma-installation-os
  (embedded-installation-os u-boot-puma-rk3399-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttyS0"))

(define wandboard-installation-os
  (embedded-installation-os u-boot-wandboard-bootloader
                            "/dev/mmcblk0" ; SD card storage
                            "ttymxc0"))

;; Return the default os here so 'guix system' can consume it directly.
installation-os

;;; install.scm ends here
='hex'>~{.mmbtT.7/9d..R...<........%.+. 1c40 27 3f 79 d7 ea a4 a6 9a ee bf ff d8 fa f5 47 ef ba 4b 9f 95 95 f5 dc 73 a7 5c 50 71 3a 13 fc 8e '?y...........G..K.....s.\Pq:... 1c60 3d 3b b1 58 ec 4b 5f fa d2 7f fe e7 7f de 76 db 6d 74 00 60 ea e1 14 20 e0 c2 66 fc e2 17 75 26 =;.X.K_.......v.mt.`......f...u& 1c80 53 df a7 3f 6d 7e f8 e1 e3 bf fa 55 fc c0 01 d3 37 be 31 fa f7 bf 8f 86 c3 e3 3f 31 b9 53 65 98 S..?m~.....U....7.1.......?1.Se. 1ca0 33 47 2a 2a 1a de bc 39 f5 93 9f 34 cc 9d 6b c8 c9 19 dd b7 6f ec 0d da d1 fd fb 85 10 89 a1 a1 3G**...9...4..k.....o........... 1cc0 71 e6 89 bf f9 e6 d1 7f fb b7 e4 ed e8 ce 9d c9 1b 19 f7 de 9b 88 46 8f dc 7a 6b f2 58 44 f4 f5 q.....................F..zk.XD.. 1ce0 d7 2d 7f fe 73 fa cd 37 1f 7f f1 45 21 44 c6 5d 77 8d 86 42 47 ab aa 44 22 31 dc dc 6c c8 cb 3b .-..s..7...E!D.]w..BG..D"1..l..; 1d00 e5 02 d3 71 8c 3f f3 68 57 97 10 22 31 38 98 18 19 49 86 3f 95 24 0d ac 5d 3b d2 da 2a 84 d0 4d ...q.?.hW.."18...I.?.$..];..*..M 1d20 9f 3e 63 fd 7a fd ec d9 f1 43 87 ce 38 f3 f8 eb 2b 84 10 7a fd c0 37 be 91 7c db 3b f2 f4 d3 99 .>c.z....C..8...+..z..7..|.;.... 1d40 4f 3d 35 c1 99 cf 9c 79 9c 8d ff d6 5b c7 be ff fd d8 ce 9d 42 af 4f bb e1 86 e9 5f fa 92 7e d6 O=5....y....[.......B.O...._..~. 1d60 ac a3 ff f2 2f ef 7d 64 ca c7 3e 96 f6 a9 4f 0d 3c fc 70 62 64 64 42 cf 95 24 f3 b7 bf 7d ec fb ..../.}d..>...O.<.pbddB..$...}.. 1d80 df 8f f7 f6 8a bc bc 53 66 d3 65 66 c6 fb fb f5 b3 66 59 fe f8 c7 e1 3f fc e1 ed 55 ab 84 10 fa .......Sf.ef.....fY....?...U.... 1da0 19 33 26 32 3a 71 ef cd 9c 64 f9 9f ff d1 5b 2c 42 88 a1 97 5e 1a fb 5a 9c 31 f3 f8 eb ab cb ca .3&2:q...d....[,B...^..Z.1...... 1dc0 4a ab a8 18 3d 78 f0 e8 57 bf aa 9b 36 2d a3 ba 3a ab be fe ad 6b ae 19 ff 9b 3f c9 70 e9 a5 d3 J...=x..W...6-..:....k....?.p... 1de0 6f bf 3d b2 61 c3 c0 b7 be 95 5c 32 f4 9b df 8c ed 88 8f fc f1 8f 23 7f fc e3 c9 31 92 6f f3 8f o.=.a.....\2..........#....1.o.. 1e00 1d 21 11 06 43 ff 03 0f 0c bf fa aa 10 22 16 0e 5f fc bb df a5 dd 72 cb f1 17 5e 38 e3 eb 4e f0 .!..C........".._.....r...^8..N. 1e20 3b f6 ec d4 d4 d4 08 21 cc 66 73 79 79 f9 17 be f0 85 6d db b6 cd 7a cf 81 0b 00 17 2e 0a 00 70 ;......!.fsyy.....m...z........p 1e40 61 8b fc e0 07 27 df 8d 75 76 1e 99 d8 1f 93 49 5e e9 6b c8 c9 49 b9 e2 8a e1 6d db 0c 73 e7 a6 a....'..uv.....I^.k..I....m..s.. 1e60 14 15 19 e6 cc 19 7d e7 fc 9f 09 1a fa ed 6f df bb 70 da b5 d7 0e 6f db 36 76 26 52 fc d0 a1 d1 ......}.......o..p....o.6v&R.... 1e80 8e 8e 94 2b ae 48 ee 9a 48 97 5f 3e f4 ca 2b 22 21 5f a7 30 d2 d4 74 6a 01 30 18 f4 d3 a7 27 6f ...+.H..H._>..+"!_.0..tj.0....'o 1ea0 26 e2 f1 c4 49 6f 87 8f 3f f3 99 25 12 d1 ff fd df e4 cd e4 d9 26 86 77 76 d3 27 38 f3 fb ae af &...Io..?..%.........&.wv.'8.... 1ec0 3c f3 ee dd 63 cf 3d 8b 99 cf c2 b0 d7 3b ec f5 ca c1 5e 79 65 c6 e8 68 fa d2 a5 c7 d6 af 3f a5 <...c.=......;....^ye..h......?. 1ee0 fe e9 67 cd ca fc c1 0f 86 ff f0 87 c8 86 0d 13 7c ee f4 55 ab 74 69 69 83 ff fd df e3 bd fc e8 ..g.............|..U.tii........ 1f00 68 e2 d8 b1 13 67 a8 27 12 1f 60 f4 4c de 37 73 d2 91 2f 7c 41 67 36 4f fb e8 47 a7 7f e5 2b a6 h....g.'..`.L.7s../|Ag6O..G...+. 1f20 6f 7e b3 ff de 7b 93 cb c7 cf 7c 86 6d a5 d7 eb 66 ce 3c 52 51 91 3c 9e 30 7a e8 d0 45 0d 0d 69 o~...{....|.m...f.<RQ.<.0z..E..i 1f40 37 dd 74 fc 97 bf 3c 63 d4 69 25 25 42 af 3f fe ab 5f bd 6b 69 2c f6 ce 9a e8 8d 1e 4f fa 6d b7 7.t...<c.i%%B.?.._.ki,......O.m. 1f60 19 ac 56 5d 46 86 d0 e9 84 10 7a 8b 45 8c 15 00 21 c6 1a 42 6c f7 ee 78 5f 5f ca e5 97 1f 3f e3 ..V]F.....z.E...!..Bl..x__....?. 1f80 ab 9e cf ef 2b 21 c4 d7 be f6 b5 d9 b3 67 cf 9f 3f bf b4 b4 f4 ee bb ef 66 ef 1f 98 62 28 00 c0 ....+!.......g..?.......f...b(.. 1fa0 14 31 f8 ec b3 a3 1f e4 6f 05 26 06 06 e2 bd bd 86 9c 9c 94 a2 a2 63 8f 3e 2a e5 e7 a7 5c 79 a5 .1......o.&...........c.>*...\y. 1fc0 3e 27 27 da d6 f6 81 5e 77 f4 e0 c1 53 17 19 0c 7a b3 39 fd 96 5b d2 16 2f 1e 5b a6 4b 49 91 ff >''....^w...S...z.9..[../.[.KI.. 1fe0 e8 8a 5e af 9f 39 33 7e f8 f0 d8 d0 c9 57 70 26 a5 5c 79 e5 45 0d 0d f2 fc e1 70 6f 49 c9 84 66 ..^..93~.....Wp&.\y.E.....poI..f 2000 9e c8 5a 47 a3 27 de 4e 1e 1d 15 e2 9d 33 c8 27 3c f3 fb ac ef 3b 33 9f d8 e7 4b 1e 42 f9 80 33 ..ZG.'.N.....3.'<....;3...K.B..3 2020 9f bb a1 cd 9b d3 97 2e 4d b9 fc f2 93 0b 80 ce 64 9a f9 dc 73 f1 be be b7 ef bc 73 9c 93 ef 4f ........M.......d...s......s...O 2040 7e ae fe e2 8b 33 56 af ee ff fa d7 45 4a 8a 2e 25 45 3e 69 3e 35 55 97 9e 9e fc 13 3a 89 a3 47 ~....3V.....EJ..%E>i>5U.....:..G 2060 f5 66 73 fc f0 e1 9e 05 0b 92 2f 21 84 18 bb b8 76 fc d1 89 18 3f 73 f4 f5 d7 85 10 23 7f f8 c3 .fs......./!....v....?s.....#... 2080 e8 a1 43 33 ea ea 8e bf f0 42 b4 ad ed 8c 99 c7 df 56 89 fe fe 78 77 f7 d8 d9 44 d1 9d 3b 45 3c ..C3.....B.......V...xw...D..;E< 20a0 2e 5d 76 d9 44 d2 ea b3 b2 c4 3b 17 ec be 57 c6 57 bf 9a 71 f7 dd 03 eb d7 8f b4 b4 24 06 06 a4 .]v.D.....;...W.W..q........$... 20c0 bc bc cc 67 9e d1 9d 74 a2 4e 22 1a 4d 44 22 27 ee 1e 3d aa bf f8 e2 33 bf ea 79 fe be 9a 73 d2 ...g...t.N".MD"'..=....3..y...s. 20e0 a7 8c db 94 fb 13 bd 00 26 09 0a 00 30 45 44 ff ef ff 3e e8 53 62 a1 50 ca 3f fc 83 2e 23 23 ba ........&...0ED...>.Sb.P.?...##. 2100 67 8f e1 af 7f 35 2e 5f 6e c8 c9 19 fa a0 6f 1f be 77 9f 72 74 34 31 30 70 fc 37 bf 19 7c fa e9 g....5._n.....o..w.rt410p.7..|.. 2120 93 17 cb 6f e4 c7 e3 f1 c3 87 75 19 19 63 cb 75 ef b9 e0 35 16 08 f4 dd 72 8b fc ac 93 cf c1 18 ...o......u..c.u...5....r....... 2140 7f e6 73 31 f1 99 4f bf 0f 7d ae 33 9f 33 9d 5e 7f 4a 42 5d 6a 6a d6 b3 cf ea 8c c6 be 9b 6f 1e ..s1..O..}.3.3.^.JB]jj........o. 2160 ff 15 4f 7e ae 61 ce 1c dd f4 e9 33 1e 7f 7c c6 e3 8f 8f 3d 20 f3 a9 a7 46 bb ba 7a af ba 4a 08 ..O~.a.....3..|....=....F..z..J. 2180 11 eb e8 30 9c b4 73 9c dc 51 1e 3b 76 34 fe e8 99 d7 62 c2 99 93 4d 20 65 de bc 68 5b db 19 33 ...0..s..Q.;v4....b...M.e..h[..3 21a0 8f bf ad 92 b5 e7 d4 07 4d ec a8 45 b2 c1 ea 67 cd 7a 6f 95 15 42 a4 55 56 1e 7f f1 c5 c8 3b d7 ........M..E...g.zo..B.UV.....;. 21c0 84 bc f7 3a 5d 5d 4a 8a 6e fa f4 b1 0e a0 cb cc 8c f7 f6 be 3b c5 fb c5 f8 10 bf af 00 4c 3d 14 ...:]]J.n...........;........L=. 21e0 00 40 bb 46 43 a1 d4 eb af 8f be f1 86 88 c5 a2 ed ed 29 eb d6 e9 d2 d3 15 79 07 71 b8 a5 25 a5 .@.FC.............)......y.q..%. 2200 a8 28 16 0a c9 ef b2 bf 5b f4 8d 37 52 e6 cf 1f bb 9b f2 d1 8f 9e f2 80 c4 b1 63 23 3b 76 9c c5 .(......[..7R.............c#;v.. 2220 cc f2 d3 07 06 74 ef 9c 41 a4 54 e6 f3 b7 35 ce 25 b3 90 a4 13 87 1d 84 48 5b bc 58 c4 e3 d1 b1 .....t..A.T...5.%.......H[.X.... 2240 4b 36 25 29 f3 bf fe cb 90 9b db 77 f3 cd a7 ec 53 8e ff dc d8 de bd 63 05 4c 08 21 15 16 9a d7 K6%).......w....S......c.L.!.... 2260 ae 1d 78 f8 e1 91 3f fc 21 b9 64 a4 b9 d9 f4 e0 83 92 d3 19 f3 fb 85 10 69 9f fc a4 18 1d 1d 7e ..x...?.!.d.............i......~ 2280 e7 3c 96 f1 47 cf b8 46 e3 64 d6 4d 9b 76 f2 f5 00 d3 ae b9 46 08 31 da d3 33 91 cc e3 6f ab 91 .<..G..F.d.M.v......F.1..3...o.. 22a0 3f fe 31 63 cd 1a 43 4e ce 68 77 b7 10 62 da c7 3e 26 f4 fa d8 e9 3f a2 eb 64 23 ff f3 3f 22 1e ?.1c..CN.hw..b..>&....?..d#..?". 22c0 4f ff 7f ff 6f e0 1b df 78 ef e6 d5 19 8d 27 17 83 d4 eb ae 7b ef 0c a9 d7 5e 3b b4 75 ab 10 42 O...o...x.....'.....{....^;.u..B 22e0 2a 28 d0 67 65 9d f2 27 8c 12 47 8e 08 21 f4 59 59 f1 23 47 4e 5e 7e fe be 63 01 4c 79 14 00 40 *(.ge..'..G..!.YY.#GN^~..c.Ly..@ 2300 bb 62 9d 9d e9 99 99 c9 3f f2 33 1a 0e 27 46 46 74 26 d3 d8 5f 5c d1 67 65 25 df a7 d7 a5 a5 89 .b......?.3..'FFt&.._\.ge%...... 2320 68 34 f9 c7 3a 13 fd fd f1 a3 47 cf 38 f3 b1 c7 1e bb e8 b7 bf 9d f9 fc f3 83 cf 3d 17 ef eb 93 h4..:.....G.8..............=.... 2340 2e bd 34 b5 bc fc f8 a6 4d c9 13 e8 23 1b 36 cc 7c e1 05 e3 e7 3f 7f 7c d3 a6 69 25 25 e9 4b 96 ..4.....M...#.6.|....?.|..i%%.K. 2360 4c 3c f3 f8 33 cb eb b5 7b b7 f1 73 9f 4b 5f be 3c da d6 26 46 47 63 9d 9d 13 79 db 7e 22 33 9f L<..3...{..s.K_.<..&FGc...y.~"3. 2380 9d f3 97 f9 a2 cd 9b a3 7f f9 4b f2 72 d2 d4 7f fe e7 d4 b2 b2 c1 ff fe ef d1 37 df 4c 8e 9a bf ..........K.r.............7.L... 23a0 f5 ad d4 7f fe e7 63 8f 3d 96 52 54 94 52 54 94 5c 38 b2 63 47 72 c7 7a 9c e7 26 22 91 77 15 30 ......c.=.RT.RT.\8.cGr.z..&".w.0 23c0 83 41 08 31 1a 0c 8e 1d 65 1a 7c fe 79 e3 97 be 94 b9 61 c3 b1 ba 3a c3 25 97 18 ef b8 63 f0 b9 .A.1....e.|.y.....a...:.%....c.. 23e0 e7 c6 ce 81 19 7f 54 08 91 5a 56 a6 4b 4f 97 0a 0a 84 10 a9 a5 a5 f1 c3 87 63 1d 1d c9 24 e3 67 ......T..ZV.KO...........c...$.g 2400 be f8 f7 bf 1f f9 d3 9f a2 bb 77 27 06 07 53 e6 cf 37 de 76 5b cc e7 1b 69 6a 9a 48 e6 f1 b7 d5 ..........w'..S..7.v[...ij.H.... 2420 e0 73 cf 19 57 ad ca fa c9 4f 8e 3d fe b8 2e 35 35 63 cd 9a d1 bf ff 7d e8 9d f3 d0 c6 37 ba 7f .s..W....O.=...55c.....}.....7.. 2440 7f e4 99 67 a6 df 71 87 2e 3d 7d b8 b1 51 67 34 a6 dd 70 c3 f1 17 5f 1c 6e 6c 14 42 0c 37 35 a5 ...g..q..=}..Qg4..p..._.nl.B.75. 2460 dd 72 cb f1 17 5f 1c dd bf 3f fd e6 9b d3 6e ba e9 3d cf 1f 35 3d f4 90 ce 64 4a 0c 0e 66 dc 73 .r..._...?....n..=..5=...dJ..f.s 2480 cf 68 77 f7 d0 cb 2f 9f 3c 3e b2 63 87 88 c5 4c f7 dd 77 fc f9 e7 13 a3 a3 d1 9d 3b 93 d5 e2 fc .hw.../.<>.c...L..w........;.... 24a0 7d c7 02 98 f2 28 00 80 76 25 f7 f5 c7 fe ca 67 f4 f5 d7 a7 95 94 8c 1e 3a 94 bc 6b aa a9 49 ff }....(..v%.....g........:..k..I. 24c0 cc 67 c6 1e 6c 79 ed 35 21 44 e4 c9 27 07 be fd ed 33 ce 1c 0b 04 0e df 74 53 c6 3d f7 98 bf f5 .g..ly.5!D..'....3......tS.=.... 24e0 2d 5d 7a 7a bc bb 7b f8 8f 7f 1c fb b8 e2 91 d6 d6 a3 6b d6 64 fc eb bf 9a 1e 7a 28 f6 b7 bf 45 -]zz..{...........k.d.....z(...E 2500 9e 7c 32 e3 9e 7b 26 98 79 fc 99 93 8e bf f0 82 54 54 64 ba f7 5e fd c5 17 0b 9d ae 67 de bc 89 .|2..{&.y.......TTd..^......g... 2520 9c 80 3e 91 99 cf ce f9 cb 3c d2 d2 92 76 fd f5 e9 4b 97 ea 52 53 63 9d 9d fd 0f 3c 30 f8 cc 33 ..>......<...v...K..RSc....<0..3 2540 63 a3 d3 16 2c 10 42 9c b2 6d 8f ac 58 31 dc d4 74 c6 e7 8e 2f 31 30 70 e4 d6 5b cd df fa d6 8c c...,.B..m..X1..t.../10p..[..... 2560 ef 7f 3f 11 89 0c 3e fb ec b1 75 eb 26 38 2a 84 30 3f f6 98 21 3b 5b be bd 6e 9d 10 22 f2 5f ff ..?...>...u.&8*.0?..!;[..n.."._. 2580 95 7c fb 7c fc cc c7 7f f5 ab d4 f2 f2 d4 1b 6e d0 a5 a7 c7 0f 1c 88 fc f0 87 91 ff fc cf 44 34 .|.|...........n..............D4 25a0 3a 91 cc e3 af 6f fc f0 e1 be 65 cb cc 0f 3c 30 e3 3b df 11 42 8c bc f6 5a 7f 6d ed 04 67 16 42 :....o....e...<0.;..B...Z.m..g.B 25c0 0c 3c f4 d0 e8 be 7d c6 cf 7e 36 fd b6 db 12 fd fd 23 ad ad b1 77 ae 08 1f 58 bb 56 97 92 32 f3 .<....}..~6......#...w...X.V..2. 25e0 c5 17 75 d3 a6 8d fc f9 cf 47 ff ed df 4e f9 54 8d c4 f0 f0 c0 43 0f 99 ee bb 4f ff 91 8f 44 db ..u......G...N.T.....C....O...D. 2600 db fb ef bc f3 94 d7 1d dd bf ff ed aa 2a d3 bd f7 a6 df 7a ab d0 e9 7a ae b8 22 79 48 e1 fc 7d .............*.....z...z.."yH..} 2620 c7 02 98 f2 74 42 f4 9d fb 2c c0 24 71 e0 c0 89 ab fd 0a 0b 0b 1f 79 e4 91 1b 6f bc 51 ed 50 67 ....tB...,.$q.........y...o.Q.Pg 2640 30 67 ce 89 8f 25 da b5 6b e8 df ff 3d e5 95 57 0c ef bb 46 ef f5 e6 49 17 ea 01 40 52 f6 07 f9 0g...%..k...=..W...F...I...@R... 2660 7b 00 0a 3a 97 df 66 93 c1 7b ff d7 98 73 86 df b1 ec 41 e1 c2 32 73 ec 16 1f 04 06 00 00 00 68 {..:..f..{...s....A..2s........h 2680 08 05 00 00 00 00 d0 10 ae 01 00 80 49 6a c6 f7 be 77 ba a1 e8 5f fe 32 58 5f af 76 40 4d e0 ab ............Ij...w..._.2X_.v@M.. 26a0 00 60 ea a1 00 00 17 30 b5 ce f4 85 ea d2 97 2d 33 3f f2 88 da 29 b4 8e af 02 80 0b 14 a7 00 01 .`.....0.......-3?...).......... 26c0 00 00 00 1a 42 01 00 00 00 00 34 84 02 00 00 00 00 68 08 05 00 00 00 00 d0 10 0a 00 00 00 00 a0 ....B.....4......h.............. 26e0 21 14 00 00 00 f0 2e 4f 3d f5 54 fe 49 8e 1c 39 a2 76 22 00 4a e2 cf 80 02 00 80 77 89 46 a3 83 !......O=.T.I..9.v".J......w.F.. 2700 83 83 63 77 13 89 84 da 89 00 28 89 23 00 00 00 00 80 86 50 00 00 00 00 00 0d a1 00 00 00 00 00 ..cw......(.#......P............ 2720 1a 42 01 00 00 00 00 34 84 02 00 00 00 00 68 08 05 00 00 00 00 d0 10 0a 00 00 00 00 a0 21 7c 0e .B.....4......h..............!|. 2740 00 00 00 78 97 2b af bc f2 0b 5f f8 c2 d8 dd b4 b4 34 b5 13 01 50 12 05 00 00 00 bc cb 27 3e f1 ...x.+...._......4...P.......'>. 2760 89 4f 7c e2 13 6a a7 00 70 be 70 0a 10 00 00 00 a0 21 14 00 00 00 00 40 43 28 00 00 00 40 e6 76 .O|..j..p.p......!.....@C(...@.v 2780 bb eb ea ea 84 10 35 35 35 37 dd 74 93 10 e2 f1 c7 1f 77 bb dd d1 68 54 ed 68 00 14 43 01 00 00 ......5557.t......w...hT.h..C... 27a0 00 b2 8e 8e 8e 9e 9e 1e 21 c4 c1 83 07 43 a1 90 10 a2 a7 a7 a7 a3 a3 23 1e 8f ab 1d 0d 80 62 28 ........!....C.........#......b( 27c0 00 00 00 40 16 0e