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