nls: Update.
[jackhill/guix/guix.git] / gnu / system / install.scm
CommitLineData
fc91c17a 1;;; GNU Guix --- Functional package management for GNU
5c215c9e 2;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
b2a5fa59 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
f0fbf2c1 4;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
c80cd4df 5;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
b24f561c 6;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
557e6820 7;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
fc91c17a
LC
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu system install)
25 #:use-module (gnu)
d0f3a672 26 #:use-module (gnu system)
ceb39527 27 #:use-module (gnu bootloader u-boot)
fc91c17a 28 #:use-module (guix gexp)
e87f0591 29 #:use-module (guix store)
fc91c17a 30 #:use-module (guix monads)
557e6820 31 #:use-module (guix modules)
0134ebc5 32 #:use-module ((guix packages) #:select (package-version))
83a17b62 33 #:use-module ((guix store) #:select (%store-prefix))
a49d633c 34 #:use-module (gnu installer)
d0f3a672
MO
35 #:use-module (gnu services dbus)
36 #:use-module (gnu services networking)
0190c1c0 37 #:use-module (gnu services shepherd)
c80cd4df 38 #:use-module (gnu services ssh)
db84467a 39 #:use-module (gnu packages admin)
f4bdfe73 40 #:use-module (gnu packages bash)
862e38d5 41 #:use-module (gnu packages bootloaders)
9ce09a76 42 #:use-module (gnu packages certs)
b24f561c 43 #:use-module (gnu packages file-systems)
d0f3a672
MO
44 #:use-module (gnu packages fonts)
45 #:use-module (gnu packages fontutils)
af4a761e 46 #:use-module (gnu packages guile)
fc91c17a 47 #:use-module (gnu packages linux)
1e8d398a 48 #:use-module (gnu packages ssh)
b419c7f5 49 #:use-module (gnu packages cryptsetup)
fc91c17a 50 #:use-module (gnu packages package-management)
cc4a2aeb 51 #:use-module (gnu packages disk)
fc91c17a 52 #:use-module (gnu packages texinfo)
dd6b28d1 53 #:use-module (gnu packages compression)
a8cb87ab 54 #:use-module (gnu packages nvi)
557e6820 55 #:use-module (gnu packages xorg)
e1fbc32a
LC
56 #:use-module (ice-9 match)
57 #:use-module (srfi srfi-26)
ceb39527 58 #:export (installation-os
c55c6985 59 a20-olinuxino-lime-installation-os
4b9e9abb 60 a20-olinuxino-lime2-emmc-installation-os
a7bb327e 61 a20-olinuxino-micro-installation-os
e830c9d0 62 bananapi-m2-ultra-installation-os
84ee3378 63 beaglebone-black-installation-os
07ca9045 64 mx6cuboxi-installation-os
fd5536e3 65 nintendo-nes-classic-edition-installation-os
1b960787 66 novena-installation-os
545ff7b7 67 firefly-rk3399-installation-os
9f7d6665 68 pine64-plus-installation-os
74e35e8c 69 pinebook-installation-os
2fce14af 70 rock64-installation-os
fa747018 71 rockpro64-installation-os
6fe16577 72 rk3399-puma-installation-os
4ce4fc50
DM
73 wandboard-installation-os
74 os-with-u-boot))
fc91c17a
LC
75
76;;; Commentary:
77;;;
78;;; This module provides an 'operating-system' definition for use on images
79;;; for USB sticks etc., for the installation of the GNU system.
80;;;
81;;; Code:
82
9d3fb6c7 83\f
126d4c12
LC
84;;;
85;;; Documentation service.
86;;;
87
c7dc6042
LC
88(define %installation-node-names
89 ;; Translated name of the "System Installation" node of the manual. Ideally
90 ;; we'd extract it from the 'guix-manual' gettext domain, but that one is
91 ;; usually not available at run time, hence this hack.
92 '(("de" . "Systeminstallation")
93 ("en" . "System Installation")
55111549 94 ("es" . "Instalación del sistema")
7059cfc8
LC
95 ("fr" . "Installation du système")
96 ("ru" . "Установка системы")))
c7dc6042 97
126d4c12 98(define (log-to-info tty user)
fc91c17a
LC
99 "Return a script that spawns the Info reader on the right section of the
100manual."
ce8a6dfc 101 (program-file "log-to-info"
c7dc6042
LC
102 #~(let* ((tty (open-file #$(string-append "/dev/" tty)
103 "r0+"))
104 (locale (cadr (command-line)))
105 (language (string-take locale
106 (string-index locale #\_)))
107 (infodir "/run/current-system/profile/share/info")
108 (per-lang (string-append infodir "/guix." language
109 ".info.gz"))
110 (file (if (file-exists? per-lang)
111 per-lang
112 (string-append infodir "/guix.info")))
113 (node (or (assoc-ref '#$%installation-node-names
114 language)
115 "System Installation")))
126d4c12
LC
116 (redirect-port tty (current-output-port))
117 (redirect-port tty (current-error-port))
118 (redirect-port tty (current-input-port))
119
120 (let ((pw (getpwnam #$user)))
121 (setgid (passwd:gid pw))
122 (setuid (passwd:uid pw)))
123
dd6b28d1
LC
124 ;; 'gunzip' is needed to decompress the doc.
125 (setenv "PATH" (string-append #$gzip "/bin"))
126
c7dc6042
LC
127 ;; Change this process' locale so that command-line
128 ;; arguments to 'info' are properly encoded.
129 (catch #t
130 (lambda ()
131 (setlocale LC_ALL locale)
132 (setenv "LC_ALL" locale))
133 (lambda _
134 ;; Sometimes LOCALE itself is not available. In that
135 ;; case pick the one UTF-8 locale that's known to work
136 ;; instead of failing.
137 (setlocale LC_ALL "en_US.utf8")
138 (setenv "LC_ALL" "en_US.utf8")))
139
140 (execl #$(file-append info-reader "/bin/info")
141 "info" "-d" infodir "-f" file "-n" node))))
fc91c17a 142
126d4c12
LC
143(define (documentation-shepherd-service tty)
144 (list (shepherd-service
145 (provision (list (symbol-append 'term- (string->symbol tty))))
146 (requirement '(user-processes host-name udev virtual-terminal))
c7dc6042
LC
147 (start #~(lambda* (#:optional (locale "en_US.utf8"))
148 (fork+exec-command
149 (list #$(log-to-info tty "documentation") locale)
150 #:environment-variables
151 `("GUIX_LOCPATH=/run/current-system/locale"
152 "TERM=linux"))))
126d4c12
LC
153 (stop #~(make-kill-destructor)))))
154
155(define %documentation-users
156 ;; User account for the Info viewer.
157 (list (user-account (name "documentation")
158 (system? #t)
159 (group "nogroup")
160 (home-directory "/var/empty"))))
161
162(define documentation-service-type
163 ;; Documentation viewer service.
164 (service-type (name 'documentation)
165 (extensions
166 (list (service-extension shepherd-root-service-type
167 documentation-shepherd-service)
168 (service-extension account-service-type
169 (const %documentation-users))))
170 (description "Run the Info reader on a tty.")))
171
172\f
83a17b62
LC
173(define %backing-directory
174 ;; Sub-directory used as the backing store for copy-on-write.
175 "/tmp/guix-inst")
176
177(define (make-cow-store target)
178 "Return a gexp that makes the store copy-on-write, using TARGET as the
179backing store. This is useful when TARGET is on a hard disk, whereas the
180current store is on a RAM disk."
83a17b62
LC
181
182 (define (set-store-permissions directory)
183 ;; Set the right perms on DIRECTORY to use it as the store.
184 #~(begin
185 (chown #$directory 0 30000) ;use the fixed 'guixbuild' GID
186 (chmod #$directory #o1775)))
187
188 #~(begin
0adabad7
LC
189 ;; Bind-mount TARGET's /tmp in case we need space to build things.
190 (let ((tmpdir (string-append #$target "/tmp")))
191 (mkdir-p tmpdir)
192 (mount tmpdir "/tmp" "none" MS_BIND))
193
d9565f7d
HG
194 (let* ((rw-dir (string-append target #$%backing-directory))
195 (work-dir (string-append rw-dir "/../.overlayfs-workdir")))
83a17b62 196 (mkdir-p rw-dir)
d9565f7d 197 (mkdir-p work-dir)
83a17b62
LC
198 (mkdir-p "/.rw-store")
199 #$(set-store-permissions #~rw-dir)
200 #$(set-store-permissions "/.rw-store")
201
d9565f7d
HG
202 ;; Mount the overlay, then atomically make it the store.
203 (mount "none" "/.rw-store" "overlay" 0
204 (string-append "lowerdir=" #$(%store-prefix) ","
205 "upperdir=" rw-dir ","
206 "workdir=" work-dir))
207 (mount "/.rw-store" #$(%store-prefix) "" MS_MOVE)
208 (rmdir "/.rw-store"))))
83a17b62 209
0adfe95a 210(define cow-store-service-type
d4053c71 211 (shepherd-service-type
00184239 212 'cow-store
0adfe95a 213 (lambda _
d4053c71 214 (shepherd-service
0adfe95a
LC
215 (requirement '(root-file-system user-processes))
216 (provision '(cow-store))
217 (documentation
218 "Make the store copy-on-write, with writes going to \
219the given target.")
220
221 ;; This is meant to be explicitly started by the user.
222 (auto-start? #f)
223
224 (start #~(case-lambda
225 ((target)
226 #$(make-cow-store #~target)
227 target)
228 (else
229 ;; Do nothing, and mark the service as stopped.
230 #f)))
231 (stop #~(lambda (target)
232 ;; Delete the temporary directory, but leave everything
233 ;; mounted as there may still be processes using it since
6c445817 234 ;; 'user-processes' doesn't depend on us. The 'user-file-systems'
0adfe95a
LC
235 ;; service will unmount TARGET eventually.
236 (delete-file-recursively
237 (string-append target #$%backing-directory))))))))
238
83a17b62
LC
239(define (cow-store-service)
240 "Return a service that makes the store copy-on-write, such that writes go to
241the user's target storage device rather than on the RAM disk."
242 ;; See <http://bugs.gnu.org/18061> for the initial report.
0adfe95a
LC
243 (service cow-store-service-type 'mooooh!))
244
245
246(define (/etc/configuration-files _)
247 "Return a list of tuples representing configuration templates to add to
248/etc."
0adfe95a
LC
249 (define directory
250 (computed-file "configuration-templates"
4ee96a79
LC
251 (with-imported-modules '((guix build utils))
252 #~(begin
253 (mkdir #$output)
254 (for-each (lambda (file target)
255 (copy-file file
256 (string-append #$output "/"
257 target)))
33d1c970
LC
258 '(#$(local-file "examples/bare-bones.tmpl")
259 #$(local-file "examples/beaglebone-black.tmpl")
260 #$(local-file "examples/desktop.tmpl")
261 #$(local-file "examples/lightweight-desktop.tmpl"))
4ee96a79 262 '("bare-bones.scm"
9f1e39d1 263 "beaglebone-black.scm"
4ee96a79
LC
264 "desktop.scm"
265 "lightweight-desktop.scm"))
266 #t))))
0adfe95a
LC
267
268 `(("configuration" ,directory)))
269
270(define configuration-template-service-type
271 (service-type (name 'configuration-template)
272 (extensions
273 (list (service-extension etc-service-type
274 /etc/configuration-files)))))
275
276(define %configuration-template-service
277 (service configuration-template-service-type #t))
be1c2c54 278
1dac8566 279
61ff0a3a
LC
280(define %nscd-minimal-caches
281 ;; Minimal in-memory caching policy for nscd.
282 (list (nscd-cache (database 'hosts)
283 (positive-time-to-live (* 3600 12))
c96ba2cf
LC
284
285 ;; Do not cache lookup failures at all since they are
286 ;; quite likely (for instance when someone tries to ping a
287 ;; host before networking is functional.)
288 (negative-time-to-live 0)
289
61ff0a3a
LC
290 (persistent? #f)
291 (max-database-size (* 5 (expt 2 20)))))) ;5 MiB
292
557e6820
FP
293\f
294;; These define a service to load the uvesafb kernel module with the
295;; appropriate options. The GUI installer needs it when the machine does not
296;; support Kernel Mode Setting. Otherwise kmscon is missing /dev/fb0.
297(define (uvesafb-shepherd-service _)
298 (list (shepherd-service
299 (documentation "Load the uvesafb kernel module.")
300 (provision '(uvesafb))
301 (requirement '(file-systems))
302 (start #~(lambda ()
303 ;; uvesafb is only supported on x86 and x86_64.
304 (or (not (and (string-suffix? "linux-gnu" %host-type)
305 (or (string-prefix? "x86_64" %host-type)
306 (string-prefix? "i686" %host-type))))
307 (invoke #+(file-append kmod "/bin/modprobe")
308 "uvesafb"
309 (string-append "v86d=" #$v86d "/sbin/v86d")
310 "mode_option=1024x768"))))
311 (respawn? #f)
312 (one-shot? #t))))
313
314(define uvesafb-service-type
315 (service-type
316 (name 'uvesafb)
317 (extensions
318 (list (service-extension shepherd-root-service-type
319 uvesafb-shepherd-service)))
320 (description
321 "Load the @code{uvesafb} kernel module with the right options.")
322 (default-value #t)))
323
58b21e1e
LC
324(define %installation-services
325 ;; List of services of the installation system.
a7961746 326 (let ((motd (plain-file "motd" "
6fb6dd13 327\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
a7961746 328
5a663d87
LC
329\x1b[2m\
330Using this shell, you can carry out the installation process \"manually.\"
331Access documentation at any time by pressing Alt-F2.\x1b[0m
a7961746
MO
332")))
333 (define (normal-tty tty)
334 (mingetty-service (mingetty-configuration (tty tty)
335 (auto-login "root")
336 (login-pause? #t))))
337
338 (define bare-bones-os
339 (load "examples/bare-bones.tmpl"))
340
341 (list (service virtual-terminal-service-type)
342
343 (service kmscon-service-type
344 (kmscon-configuration
345 (virtual-terminal "tty1")
a49d633c 346 (login-program (installer-program))))
a7961746
MO
347
348 (login-service (login-configuration
349 (motd motd)))
350
351 ;; Documentation. The manual is in UTF-8, but
352 ;; 'console-font-service' sets up Unicode support and loads a font
353 ;; with all the useful glyphs like em dash and quotation marks.
126d4c12 354 (service documentation-service-type "tty2")
a7961746
MO
355
356 ;; Documentation add-on.
357 %configuration-template-service
358
359 ;; A bunch of 'root' ttys.
360 (normal-tty "tty3")
361 (normal-tty "tty4")
362 (normal-tty "tty5")
363 (normal-tty "tty6")
364
365 ;; The usual services.
366 (syslog-service)
367
3a8bfebe
TGR
368 ;; The build daemon. Register the default substitute server key(s)
369 ;; as trusted to allow the installation process to use substitutes by
a7961746
MO
370 ;; default.
371 (service guix-service-type
372 (guix-configuration (authorize-key? #t)))
373
374 ;; Start udev so that useful device nodes are available.
375 ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
376 ;; regulations-compliant WiFi access.
377 (udev-service #:rules (list lvm2 crda))
378
379 ;; Add the 'cow-store' service, which users have to start manually
380 ;; since it takes the installation directory as an argument.
381 (cow-store-service)
382
13fd0a30 383 ;; Install Unicode support and a suitable font.
a7961746 384 (service console-font-service-type
13fd0a30
LC
385 (map (match-lambda
386 ("tty2"
387 ;; Use a font that contains characters such as
388 ;; curly quotes as found in the manual.
389 '("tty2" . "LatGrkCyr-8x16"))
390 (tty
391 ;; Use a font that doesn't have more than 256
392 ;; glyphs so that we can use colors with varying
393 ;; brightness levels (see note in setfont(8)).
394 `(,tty . "lat9u-16")))
a7961746
MO
395 '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
396
397 ;; To facilitate copy/paste.
398 (service gpm-service-type)
399
400 ;; Add an SSH server to facilitate remote installs.
401 (service openssh-service-type
402 (openssh-configuration
403 (port-number 22)
404 (permit-root-login #t)
405 ;; The root account is passwordless, so make sure
406 ;; a password is set before allowing logins.
407 (allow-empty-passwords? #f)
408 (password-authentication? #t)
409
410 ;; Don't start it upfront.
411 (%auto-start? #f)))
412
413 ;; Since this is running on a USB stick with a overlayfs as the root
414 ;; file system, use an appropriate cache configuration.
415 (nscd-service (nscd-configuration
416 (caches %nscd-minimal-caches)))
417
418 ;; Having /bin/sh is a good idea. In particular it allows Tramp
419 ;; connections to this system to work.
420 (service special-files-service-type
421 `(("/bin/sh" ,(file-append (canonical-package bash)
422 "/bin/sh"))))
423
424 ;; Loopback device, needed by OpenSSH notably.
425 (service static-networking-service-type
426 (list (static-networking (interface "lo")
427 (ip "127.0.0.1")
428 (requirement '())
429 (provision '(loopback)))))
430
431 (service wpa-supplicant-service-type)
432 (dbus-service)
433 (service connman-service-type
434 (connman-configuration
435 (disable-vpn? #t)))
436
437 ;; Keep a reference to BARE-BONES-OS to make sure it can be
438 ;; installed without downloading/building anything. Also keep the
439 ;; things needed by 'profile-derivation' to minimize the amount of
440 ;; download.
441 (service gc-root-service-type
442 (list bare-bones-os
443 glibc-utf8-locales
444 texinfo
557e6820
FP
445 (canonical-package guile-2.2)))
446
447 ;; Machines without Kernel Mode Setting (those with many old and
448 ;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI
449 ;; installer. Some may also need a kernel parameter like nomodeset
450 ;; or vga=793, but we leave that for the user to specify in GRUB.
451 (service uvesafb-service-type))))
fc91c17a
LC
452
453(define %issue
454 ;; Greeting.
455 "
8638362f 456\x1b[1;37mThis is an installation image of the GNU system. Welcome.\x1b[0m
fc91c17a 457
8638362f 458\x1b[1;33mUse Alt-F2 for documentation.\x1b[0m
fc91c17a
LC
459")
460
461(define installation-os
462 ;; The operating system used on installation images for USB sticks etc.
463 (operating-system
464 (host-name "gnu")
465 (timezone "Europe/Paris")
9cd0dfaa 466 (locale "en_US.utf8")
fdfdecdb
TGR
467 (bootloader (bootloader-configuration
468 (bootloader grub-bootloader)
469 (target "/dev/sda")))
0134ebc5
LC
470 (label (string-append "GNU Guix installation "
471 (package-version guix)))
472
78591912
LC
473 ;; XXX: The AMD Radeon driver is reportedly broken, which makes kmscon
474 ;; non-functional:
475 ;; <https://lists.gnu.org/archive/html/guix-devel/2019-03/msg00441.html>.
476 ;; Thus, blacklist it.
519177ad 477 (kernel-arguments '("quiet" "modprobe.blacklist=radeon"))
78591912 478
fc91c17a
LC
479 (file-systems
480 ;; Note: the disk image build code overrides this root file system with
481 ;; the appropriate one.
ee03b75d
LC
482 (cons* (file-system
483 (mount-point "/")
59e80445 484 (device (file-system-label "Guix_image"))
ee03b75d
LC
485 (type "ext4"))
486
d9565f7d
HG
487 ;; Make /tmp a tmpfs instead of keeping the overlayfs. This
488 ;; originally was used for unionfs because FUSE creates
489 ;; '.fuse_hiddenXYZ' files for each open file, and this confuses
490 ;; Guix's test suite, for instance (see
491 ;; <http://bugs.gnu.org/23056>). We keep this for overlayfs to be
795ec760 492 ;; on the safe side.
ee03b75d
LC
493 (file-system
494 (mount-point "/tmp")
495 (device "none")
ee03b75d
LC
496 (type "tmpfs")
497 (check? #f))
498
0feefb53
LC
499 ;; XXX: This should be %BASE-FILE-SYSTEMS but we don't need
500 ;; elogind's cgroup file systems.
501 (list %pseudo-terminal-file-system
502 %shared-memory-file-system
503 %immutable-store)))
fc91c17a 504
a7961746
MO
505 (users (list (user-account
506 (name "guest")
507 (group "users")
508 (supplementary-groups '("wheel")) ; allow use of sudo
509 (password "")
cf848cc0 510 (comment "Guest of GNU"))))
fc91c17a
LC
511
512 (issue %issue)
58b21e1e 513 (services %installation-services)
fc91c17a 514
903ae630
LC
515 ;; We don't need setuid programs, except for 'passwd', which can be handy
516 ;; if one is to allow remote SSH login to the machine being installed.
517 (setuid-programs (list (file-append shadow "/bin/passwd")))
fc91c17a
LC
518
519 (pam-services
520 ;; Explicitly allow for empty passwords.
521 (base-pam-services #:allow-empty-passwords? #t))
522
a6312f1d 523 (packages (cons* (canonical-package glibc) ;for 'tzselect' & co.
72524ae8 524 parted gptfdisk ddrescue
d0f3a672
MO
525 fontconfig
526 font-dejavu font-gnu-unifont
7eda0c56 527 grub ;mostly so xrefs to its manual work
b419c7f5 528 cryptsetup
f0fbf2c1 529 mdadm
f731529e 530 dosfstools ;mkfs.fat, for the UEFI boot partition
3a9cfba8 531 btrfs-progs
b24f561c 532 jfsutils
1e8d398a 533 openssh ;we already have sshd, having ssh/scp can help
1ce6f43a 534 wireless-tools iw wpa-supplicant-minimal iproute
8f297d42
LC
535 ;; XXX: We used to have GNU fdisk here, but as of version
536 ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable
537 ;; space; furthermore util-linux's fdisk is already
538 ;; available here, so we keep that.
f4bdfe73 539 bash-completion
a8cb87ab 540 nvi ;:wq!
0b767e3d 541 nss-certs ; To access HTTPS, use git, etc.
6f436c54 542 %base-packages))))
fc91c17a 543
4ce4fc50
DM
544(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
545 (triplet "arm-linux-gnueabihf"))
546 "Given OS, amend it with the u-boot bootloader for BOARD,
547installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET.
548
549If you want a serial console, make sure to specify one in your
550operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
551 (operating-system (inherit os)
552 (bootloader (bootloader-configuration
553 (bootloader (bootloader (inherit u-boot-bootloader)
554 (package (make-u-boot-package board triplet))))
555 (target bootloader-target)))))
556
fccdc8c8
DM
557(define* (embedded-installation-os bootloader bootloader-target tty
558 #:key (extra-modules '()))
559 "Return an installation os for embedded systems.
560The initrd gets the extra modules EXTRA-MODULES.
561A getty is provided on TTY.
562The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
ceb39527
MO
563 (operating-system
564 (inherit installation-os)
565 (bootloader (bootloader-configuration
fccdc8c8
DM
566 (bootloader bootloader)
567 (target bootloader-target)))
ceb39527 568 (kernel linux-libre)
5a9902c8
DM
569 (kernel-arguments
570 (cons (string-append "console=" tty)
571 (operating-system-user-kernel-arguments installation-os)))
bc499b11 572 (initrd-modules (append extra-modules %base-initrd-modules))))
ceb39527 573
fccdc8c8
DM
574(define beaglebone-black-installation-os
575 (embedded-installation-os u-boot-beaglebone-black-bootloader
576 "/dev/sda"
577 "ttyO0"
578 #:extra-modules
579 ;; This module is required to mount the sd card.
580 '("omap_hsmmc")))
581
582
0db22b32 583(define a20-olinuxino-lime-installation-os
c55c6985
DM
584 (embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
585 "/dev/mmcblk0" ; SD card storage
586 "ttyS0"))
587
4b9e9abb 588(define a20-olinuxino-lime2-emmc-installation-os
fccdc8c8
DM
589 (embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
590 "/dev/mmcblk1" ; eMMC storage
591 "ttyS0"))
a7bb327e
DM
592
593(define a20-olinuxino-micro-installation-os
fccdc8c8
DM
594 (embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
595 "/dev/mmcblk0" ; SD card storage
596 "ttyS0"))
4b9e9abb 597
e830c9d0
DM
598(define bananapi-m2-ultra-installation-os
599 (embedded-installation-os u-boot-bananapi-m2-ultra-bootloader
fccdc8c8
DM
600 "/dev/mmcblk1" ; eMMC storage
601 "ttyS0"))
30aeb846 602
545ff7b7
VC
603(define firefly-rk3399-installation-os
604 (embedded-installation-os u-boot-firefly-rk3399-bootloader
605 "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
606 "ttyS2")) ; UART2 connected on the Pi2 bus
607
07ca9045
VC
608(define mx6cuboxi-installation-os
609 (embedded-installation-os u-boot-mx6cuboxi-bootloader
610 "/dev/mmcblk0" ; SD card storage
611 "ttymxc0"))
612
1b960787
VC
613(define novena-installation-os
614 (embedded-installation-os u-boot-novena-bootloader
615 "/dev/mmcblk1" ; SD card storage
616 "ttymxc1"))
617
84ee3378
DM
618(define nintendo-nes-classic-edition-installation-os
619 (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
620 "/dev/mmcblk0" ; SD card (solder it yourself)
621 "ttyS0"))
622
9f7d6665
VC
623(define pine64-plus-installation-os
624 (embedded-installation-os u-boot-pine64-plus-bootloader
625 "/dev/mmcblk0" ; SD card storage
626 "ttyS0"))
627
74e35e8c
VC
628(define pinebook-installation-os
629 (embedded-installation-os u-boot-pinebook-bootloader
630 "/dev/mmcblk0" ; SD card storage
631 "ttyS0"))
632
2fce14af
VC
633(define rock64-installation-os
634 (embedded-installation-os u-boot-rock64-rk3328-bootloader
635 "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
636 "ttyS2")) ; UART2 connected on the Pi2 bus
637
fa747018
CN
638(define rockpro64-installation-os
639 (embedded-installation-os u-boot-rockpro64-rk3399-bootloader
640 "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
641 "ttyS2")) ; UART2 connected on the Pi2 bus
642
6fe16577
VC
643(define rk3399-puma-installation-os
644 (embedded-installation-os u-boot-puma-rk3399-bootloader
645 "/dev/mmcblk0" ; SD card storage
646 "ttyS0"))
647
fd5536e3
VC
648(define wandboard-installation-os
649 (embedded-installation-os u-boot-wandboard-bootloader
650 "/dev/mmcblk0" ; SD card storage
651 "ttymxc0"))
652
ceb39527 653;; Return the default os here so 'guix system' can consume it directly.
fc91c17a
LC
654installation-os
655
656;;; install.scm ends here