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