| 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 | (define-module (gnu system install)
|
| 35 | #:use-module ((guix licenses) #:prefix license:)
|
| 36 | #:use-module (gnu)
|
| 37 | #:use-module (gnu system)
|
| 38 | #:use-module (gnu system privilege)
|
| 39 | #:use-module (guix build-system trivial)
|
| 40 | #:use-module (gnu bootloader)
|
| 41 | #:use-module (gnu bootloader u-boot)
|
| 42 | #:use-module (guix gexp)
|
| 43 | #:use-module (guix store)
|
| 44 | #:use-module (guix modules)
|
| 45 | #:use-module ((guix packages) #:select (package-version supported-package?))
|
| 46 | #:autoload (guix channels) (channel? channel-commit)
|
| 47 | #:use-module (guix platform)
|
| 48 | #:use-module (guix utils)
|
| 49 | #:use-module (guix packages)
|
| 50 | #:use-module ((guix channels)
|
| 51 | #:select (%default-guix-channel
|
| 52 | channel
|
| 53 | channel-commit))
|
| 54 | #:use-module (gnu installer)
|
| 55 | #:use-module (gnu system locale)
|
| 56 | #:use-module (gnu services avahi)
|
| 57 | #:use-module (gnu services dbus)
|
| 58 | #:use-module (gnu services networking)
|
| 59 | #:use-module (gnu services shepherd)
|
| 60 | #:use-module (gnu services ssh)
|
| 61 | #:use-module (gnu packages admin)
|
| 62 | #:use-module (gnu packages bash)
|
| 63 | #:use-module (gnu packages bootloaders)
|
| 64 | #:use-module (gnu packages compression)
|
| 65 | #:use-module (gnu packages cryptsetup)
|
| 66 | #:use-module (gnu packages disk)
|
| 67 | #:use-module (gnu packages file-systems)
|
| 68 | #:use-module (gnu packages fonts)
|
| 69 | #:use-module (gnu packages fontutils)
|
| 70 | #:use-module (gnu packages guile)
|
| 71 | #:use-module (gnu packages linux)
|
| 72 | #:use-module (gnu packages package-management)
|
| 73 | #:use-module (gnu packages terminals)
|
| 74 | #:use-module (gnu packages texinfo)
|
| 75 | #:use-module (gnu packages xorg)
|
| 76 | #:use-module (ice-9 match)
|
| 77 | #:export (installation-os
|
| 78 | make-installation-os
|
| 79 | a20-olinuxino-lime-installation-os
|
| 80 | a20-olinuxino-lime2-emmc-installation-os
|
| 81 | a20-olinuxino-micro-installation-os
|
| 82 | bananapi-m2-ultra-installation-os
|
| 83 | am335x-evm-installation-os
|
| 84 | beaglebone-black-installation-os
|
| 85 | mx6cuboxi-installation-os
|
| 86 | novena-installation-os
|
| 87 | orangepi-r1-plus-lts-rk3328-installation-os
|
| 88 | firefly-rk3399-installation-os
|
| 89 | pine64-plus-installation-os
|
| 90 | pinebook-installation-os
|
| 91 | rock64-installation-os
|
| 92 | rock-4c-plus-installation-os
|
| 93 | rockpro64-installation-os
|
| 94 | rk3399-puma-installation-os
|
| 95 | wandboard-installation-os
|
| 96 | os-with-u-boot))
|
| 97 |
|
| 98 |
|
| 99 | |
| 100 | |
| 101 | |
| 102 |
|
| 103 | (define %installation-node-names
|
| 104 | |
| 105 | |
| 106 | |
| 107 | '(("de" . "Systeminstallation")
|
| 108 | ("en" . "System Installation")
|
| 109 | ("es" . "Instalación del sistema")
|
| 110 | ("fr" . "Installation du système")
|
| 111 | ("it" . "Installazione del Sistema")
|
| 112 | ("pt_BR" . "Instalação do sistema")
|
| 113 | ("ru" . "Установка системы")
|
| 114 | ("zh_CN" . "系统安装")))
|
| 115 |
|
| 116 | (define (log-to-info tty user)
|
| 117 | "Return a script that spawns the Info reader on the right section of the
|
| 118 | manual."
|
| 119 | (program-file "log-to-info"
|
| 120 | #~(let* ((tty (open-file #$(string-append "/dev/" tty)
|
| 121 | "r0+"))
|
| 122 | (locale (cadr (command-line)))
|
| 123 | (language (string-take locale
|
| 124 | (string-index locale #\_)))
|
| 125 | (with-region (string-take locale
|
| 126 | (string-index
|
| 127 | locale
|
| 128 | (char-set #\. #\/ #\@))))
|
| 129 | (infodir "/run/current-system/profile/share/info")
|
| 130 | (per-lang (lambda (code)
|
| 131 | (string-append infodir "/guix." code
|
| 132 | ".info.gz")))
|
| 133 | (file ((@ (srfi srfi-1) find) file-exists?
|
| 134 | (list (per-lang with-region)
|
| 135 | (per-lang language)
|
| 136 | (string-append infodir
|
| 137 | "/guix.info.gz"))))
|
| 138 | (node (or (assoc-ref '#$%installation-node-names
|
| 139 | with-region)
|
| 140 | (assoc-ref '#$%installation-node-names
|
| 141 | language)
|
| 142 | "System Installation")))
|
| 143 | (redirect-port tty (current-output-port))
|
| 144 | (redirect-port tty (current-error-port))
|
| 145 | (redirect-port tty (current-input-port))
|
| 146 |
|
| 147 | (let ((pw (getpwnam #$user)))
|
| 148 | (setgid (passwd:gid pw))
|
| 149 | (setuid (passwd:uid pw)))
|
| 150 |
|
| 151 | |
| 152 | (setenv "PATH" (string-append #$gzip "/bin"))
|
| 153 |
|
| 154 | |
| 155 | |
| 156 | (catch #t
|
| 157 | (lambda ()
|
| 158 | (setlocale LC_ALL locale)
|
| 159 | (setenv "LC_ALL" locale))
|
| 160 | (lambda _
|
| 161 | |
| 162 | |
| 163 | |
| 164 | (setlocale LC_ALL "en_US.utf8")
|
| 165 | (setenv "LC_ALL" "en_US.utf8")))
|
| 166 |
|
| 167 | (execl #$(file-append info-reader "/bin/info")
|
| 168 | "info" "-d" infodir "-f" file "-n" node))))
|
| 169 |
|
| 170 | (define (documentation-shepherd-service tty)
|
| 171 | (list (shepherd-service
|
| 172 | (provision (list (symbol-append 'term- (string->symbol tty))))
|
| 173 | (requirement '(user-processes host-name udev virtual-terminal))
|
| 174 | (start #~(lambda* (#:optional (locale "en_US.utf8"))
|
| 175 | (fork+exec-command
|
| 176 | (list #$(log-to-info tty "documentation") locale)
|
| 177 | #:environment-variables
|
| 178 | `("GUIX_LOCPATH=/run/current-system/locale"
|
| 179 | "TERM=linux"))))
|
| 180 | (stop #~(make-kill-destructor)))))
|
| 181 |
|
| 182 | (define %documentation-users
|
| 183 | |
| 184 | (list (user-account (name "documentation")
|
| 185 | (system? #t)
|
| 186 | (group "nogroup")
|
| 187 | (home-directory "/var/empty"))))
|
| 188 |
|
| 189 | (define documentation-service-type
|
| 190 | |
| 191 | (service-type (name 'documentation)
|
| 192 | (extensions
|
| 193 | (list (service-extension shepherd-root-service-type
|
| 194 | documentation-shepherd-service)
|
| 195 | (service-extension account-service-type
|
| 196 | (const %documentation-users))))
|
| 197 | (description "Run the Info reader on a tty.")))
|
| 198 |
|
| 199 |
|
| 200 | (define %backing-directory
|
| 201 | |
| 202 | "/tmp/guix-inst")
|
| 203 |
|
| 204 | (define cow-store-service-type
|
| 205 | (shepherd-service-type
|
| 206 | 'cow-store
|
| 207 | (lambda _
|
| 208 | (define (import-module? module)
|
| 209 | |
| 210 | |
| 211 | |
| 212 | (and (guix-module-name? module)
|
| 213 | (not (equal? module '(guix store deduplication)))))
|
| 214 |
|
| 215 | (shepherd-service
|
| 216 | (requirement '(root-file-system user-processes))
|
| 217 | (provision '(cow-store))
|
| 218 | (documentation
|
| 219 | "Make the store copy-on-write, with writes going to \
|
| 220 | the given target.")
|
| 221 |
|
| 222 | |
| 223 | (auto-start? #f)
|
| 224 |
|
| 225 | (modules `((gnu build install)
|
| 226 | ,@%default-modules))
|
| 227 | (start
|
| 228 | (with-imported-modules (source-module-closure
|
| 229 | '((gnu build install))
|
| 230 | #:select? import-module?)
|
| 231 | #~(case-lambda
|
| 232 | ((target)
|
| 233 | (mount-cow-store target #$%backing-directory)
|
| 234 | target)
|
| 235 | (else
|
| 236 | |
| 237 | #f))))
|
| 238 | (stop #~(lambda (target)
|
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | (delete-file-recursively
|
| 244 | (string-append target #$%backing-directory))))))
|
| 245 | (description "Make the store copy-on-write, with writes going to \
|
| 246 | the given target.")))
|
| 247 |
|
| 248 | (define (cow-store-service)
|
| 249 | "Return a service that makes the store copy-on-write, such that writes go to
|
| 250 | the user's target storage device rather than on the RAM disk."
|
| 251 | |
| 252 | (service cow-store-service-type 'mooooh!))
|
| 253 |
|
| 254 |
|
| 255 | (define (/etc/configuration-files _)
|
| 256 | "Return a list of tuples representing configuration templates to add to
|
| 257 | /etc."
|
| 258 | (define directory
|
| 259 | (computed-file "configuration-templates"
|
| 260 | (with-imported-modules '((guix build utils))
|
| 261 | #~(begin
|
| 262 | (mkdir #$output)
|
| 263 | (for-each (lambda (file target)
|
| 264 | (copy-file file
|
| 265 | (string-append #$output "/"
|
| 266 | target)))
|
| 267 | '(#$(local-file "examples/bare-bones.tmpl")
|
| 268 | #$(local-file "examples/beaglebone-black.tmpl")
|
| 269 | #$(local-file "examples/desktop.tmpl")
|
| 270 | #$(local-file "examples/lightweight-desktop.tmpl"))
|
| 271 | '("bare-bones.scm"
|
| 272 | "beaglebone-black.scm"
|
| 273 | "desktop.scm"
|
| 274 | "lightweight-desktop.scm"))
|
| 275 | #t))))
|
| 276 |
|
| 277 | `(("configuration" ,directory)))
|
| 278 |
|
| 279 | (define configuration-template-service-type
|
| 280 | (service-type (name 'configuration-template)
|
| 281 | (extensions
|
| 282 | (list (service-extension etc-service-type
|
| 283 | /etc/configuration-files)))
|
| 284 | (description "Install the operating system configuration file
|
| 285 | templates under @file{/etc/configuration}.")))
|
| 286 |
|
| 287 | (define %configuration-template-service
|
| 288 | (service configuration-template-service-type #t))
|
| 289 |
|
| 290 |
|
| 291 | (define %nscd-minimal-caches
|
| 292 | |
| 293 | (list (nscd-cache (database 'hosts)
|
| 294 | (positive-time-to-live (* 3600 12))
|
| 295 |
|
| 296 | |
| 297 | |
| 298 | |
| 299 | (negative-time-to-live 0)
|
| 300 |
|
| 301 | (persistent? #f)
|
| 302 | (max-database-size (* 5 (expt 2 20)))))) |
| 303 |
|
| 304 |
|
| 305 | |
| 306 | |
| 307 | |
| 308 | (define (uvesafb-shepherd-service _)
|
| 309 | (define modprobe
|
| 310 | (program-file "modprobe-wrapper"
|
| 311 | #~(begin
|
| 312 | |
| 313 | |
| 314 | |
| 315 | (setenv "LINUX_MODULE_DIRECTORY"
|
| 316 | "/run/booted-system/kernel/lib/modules")
|
| 317 | (apply execl #$(file-append kmod "/bin/modprobe")
|
| 318 | "modprobe" (cdr (command-line))))))
|
| 319 |
|
| 320 | (list (shepherd-service
|
| 321 | (documentation "Load the uvesafb kernel module if needed.")
|
| 322 | (provision '(maybe-uvesafb))
|
| 323 | (requirement '(file-systems))
|
| 324 | (start #~(lambda ()
|
| 325 | (or (file-exists? "/dev/fb0")
|
| 326 | (invoke #+modprobe
|
| 327 | "uvesafb"
|
| 328 | (string-append "v86d=" #$v86d "/sbin/v86d")
|
| 329 | "mode_option=1024x768"))))
|
| 330 | (respawn? #f)
|
| 331 | (one-shot? #t))))
|
| 332 |
|
| 333 | (define uvesafb-service-type
|
| 334 | (service-type
|
| 335 | (name 'uvesafb)
|
| 336 | (extensions
|
| 337 | (list (service-extension shepherd-root-service-type
|
| 338 | uvesafb-shepherd-service)))
|
| 339 | (description
|
| 340 | "Load the @code{uvesafb} kernel module with the right options.")
|
| 341 | (default-value #t)))
|
| 342 |
|
| 343 | (define %installation-login-pam-service
|
| 344 | |
| 345 | |
| 346 | |
| 347 | (let* ((unix (pam-entry
|
| 348 | (control "required")
|
| 349 | (module "pam_unix.so")))
|
| 350 | (env (pam-entry |
| 351 | (control "required")
|
| 352 | (module "pam_env.so")))
|
| 353 | (motd (plain-file "motd" "
|
| 354 | \x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
|
| 355 |
|
| 356 | \x1b[2m\
|
| 357 | Using this shell, you can carry out the installation process \"manually.\"
|
| 358 | Access documentation at any time by pressing Alt-F2.\x1b[0m
|
| 359 | "))
|
| 360 | (console-motd (plain-file "console-motd" "
|
| 361 | \x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
|
| 362 |
|
| 363 | You are in a headless console. If you can use a display, you should see the
|
| 364 | graphical installer on TTY1, it's opened by default. In case you cannot use a
|
| 365 | display, you can carry out the installation process in this shell \"manually\"
|
| 366 | or by starting the installer, using `guix-system-installer` command.
|
| 367 |
|
| 368 | \x1b[2mYou can access the Guix documentation using `info \"(guix)\"`.\x1b[0m
|
| 369 | "))
|
| 370 | (show-motd (program-file "show-motd"
|
| 371 | #~(begin
|
| 372 | (use-modules (ice-9 textual-ports))
|
| 373 |
|
| 374 | (call-with-input-file
|
| 375 | (if (file-exists?
|
| 376 | (string-append
|
| 377 | "/tmp/console_"
|
| 378 | (basename (getenv "PAM_TTY"))))
|
| 379 | #$console-motd
|
| 380 | #$motd)
|
| 381 | (lambda (port)
|
| 382 | (display (get-string-all port))))))))
|
| 383 | (pam-service
|
| 384 | (name "login")
|
| 385 | (account (list unix))
|
| 386 | (auth (list (pam-entry
|
| 387 | (control "required")
|
| 388 | (module "pam_unix.so")
|
| 389 | (arguments '("nullok")))))
|
| 390 | (password (list (pam-entry
|
| 391 | (control "required")
|
| 392 | (module "pam_unix.so")
|
| 393 | (arguments '("sha512" "shadow")))))
|
| 394 | (session `(,(pam-entry
|
| 395 | (control "optional")
|
| 396 | (module "pam_exec.so")
|
| 397 | (arguments
|
| 398 | (list "type=open_session" "stdout" show-motd)))
|
| 399 | ,(pam-entry |
| 400 | (control "required")
|
| 401 | (module "pam_loginuid.so"))
|
| 402 | ,env ,unix)))))
|
| 403 |
|
| 404 | (define %installation-console-login
|
| 405 | |
| 406 | |
| 407 | |
| 408 | (program-file
|
| 409 | "login-with-motd"
|
| 410 | #~(begin
|
| 411 | (call-with-output-file
|
| 412 | (string-append "/tmp/console_"
|
| 413 | (basename (ttyname (current-output-port))))
|
| 414 | (const #t))
|
| 415 |
|
| 416 | (apply execlp
|
| 417 | #$(file-append shadow "/bin/login")
|
| 418 | (command-line)))))
|
| 419 |
|
| 420 | (define* (installer-command-package installer-program
|
| 421 | #:key executable)
|
| 422 | (package
|
| 423 | (name executable)
|
| 424 | (version "0")
|
| 425 | (source #f)
|
| 426 | (build-system trivial-build-system)
|
| 427 | (arguments
|
| 428 | (list #:builder (with-imported-modules '((guix build utils))
|
| 429 | #~(begin
|
| 430 | (use-modules (guix build utils))
|
| 431 |
|
| 432 | (mkdir-p (string-append #$output "/bin"))
|
| 433 |
|
| 434 | (symlink #$installer-program
|
| 435 | (string-append #$output "/bin/" #$executable))))))
|
| 436 | (home-page #f)
|
| 437 | (synopsis "Provides the Guix System installer as run-guix-installer command")
|
| 438 | (description "Provides the Guix System installer as run-guix-installer command.")
|
| 439 | (license license:gpl3+)))
|
| 440 |
|
| 441 | (define* (%installation-services
|
| 442 | #:key
|
| 443 | (system (or (and=>
|
| 444 | (%current-target-system)
|
| 445 | platform-target->system)
|
| 446 | (%current-system)))
|
| 447 | (guix-for-system (current-guix)))
|
| 448 | |
| 449 | (define (normal-tty tty)
|
| 450 | (service mingetty-service-type
|
| 451 | (mingetty-configuration (tty tty)
|
| 452 | (auto-login "root")
|
| 453 | (login-pause? #t))))
|
| 454 |
|
| 455 | (define bare-bones-os
|
| 456 | (load "examples/bare-bones.tmpl"))
|
| 457 |
|
| 458 | (define installer
|
| 459 | (installer-program
|
| 460 | #:guix-for-installer guix-for-system))
|
| 461 |
|
| 462 | (append
|
| 463 | |
| 464 | (list (service virtual-terminal-service-type)
|
| 465 |
|
| 466 | (service kmscon-service-type
|
| 467 | (kmscon-configuration
|
| 468 | (kmscon kmscon-8)
|
| 469 | (virtual-terminal "tty1")
|
| 470 | (login-program installer)))
|
| 471 |
|
| 472 | (simple-service 'installer-login
|
| 473 | pam-root-service-type
|
| 474 | (list %installation-login-pam-service))
|
| 475 |
|
| 476 | |
| 477 | |
| 478 | |
| 479 | (service documentation-service-type "tty2")
|
| 480 |
|
| 481 | |
| 482 | %configuration-template-service
|
| 483 |
|
| 484 | |
| 485 | (normal-tty "tty3")
|
| 486 | (normal-tty "tty4")
|
| 487 | (normal-tty "tty5")
|
| 488 | (normal-tty "tty6")
|
| 489 |
|
| 490 | |
| 491 | (service shepherd-system-log-service-type)
|
| 492 |
|
| 493 | |
| 494 | |
| 495 | (service avahi-service-type)
|
| 496 |
|
| 497 | |
| 498 | (simple-service 'installer-program-profile
|
| 499 | profile-service-type
|
| 500 | (list (installer-command-package
|
| 501 | installer
|
| 502 | #:executable "guix-system-installer")))
|
| 503 |
|
| 504 | |
| 505 | (service guix-service-type
|
| 506 | (guix-configuration
|
| 507 | |
| 508 | |
| 509 | |
| 510 | (authorize-key? #t)
|
| 511 |
|
| 512 | |
| 513 | |
| 514 | (guix guix-for-system)))
|
| 515 |
|
| 516 | |
| 517 | |
| 518 | |
| 519 | (service udev-service-type
|
| 520 | (udev-configuration
|
| 521 | (rules (list lvm2 crda))))
|
| 522 |
|
| 523 | |
| 524 | |
| 525 | (cow-store-service)
|
| 526 |
|
| 527 | |
| 528 | (service console-font-service-type
|
| 529 | (map (match-lambda
|
| 530 | ("tty2"
|
| 531 | |
| 532 | |
| 533 | '("tty2" . "LatGrkCyr-8x16"))
|
| 534 | (tty
|
| 535 | |
| 536 | |
| 537 | |
| 538 | `(,tty . "lat9u-16")))
|
| 539 | '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
|
| 540 |
|
| 541 | |
| 542 | (service gpm-service-type)
|
| 543 |
|
| 544 | |
| 545 | (service openssh-service-type
|
| 546 | (openssh-configuration
|
| 547 | (port-number 22)
|
| 548 | (permit-root-login #t)
|
| 549 | |
| 550 | |
| 551 | (allow-empty-passwords? #f)
|
| 552 | (password-authentication? #t)
|
| 553 |
|
| 554 | |
| 555 | (%auto-start? #f)))
|
| 556 |
|
| 557 | |
| 558 | |
| 559 | (service nscd-service-type
|
| 560 | (nscd-configuration
|
| 561 | (caches %nscd-minimal-caches)))
|
| 562 |
|
| 563 | |
| 564 | |
| 565 | (service special-files-service-type
|
| 566 | `(("/bin/sh" ,(file-append bash "/bin/sh"))))
|
| 567 |
|
| 568 | |
| 569 | (service static-networking-service-type
|
| 570 | (list %loopback-static-networking))
|
| 571 |
|
| 572 | (service wpa-supplicant-service-type)
|
| 573 | (service dbus-root-service-type)
|
| 574 | (service connman-service-type
|
| 575 | (connman-configuration
|
| 576 | (disable-vpn? #t)))
|
| 577 |
|
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | (service gc-root-service-type
|
| 583 | (append
|
| 584 | (list bare-bones-os
|
| 585 | (libc-utf8-locales-for-target system)
|
| 586 | texinfo
|
| 587 | guile-3.0)
|
| 588 | %default-locale-libcs)))
|
| 589 |
|
| 590 | |
| 591 |
|
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | `(,@(if (target-aarch64? system)
|
| 597 | (list (service agetty-service-type
|
| 598 | (agetty-configuration (tty #f)
|
| 599 | (auto-login "root")
|
| 600 | (login-pause? #t)
|
| 601 | (login-program
|
| 602 | %installation-console-login))))
|
| 603 | '()))
|
| 604 |
|
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | `(,@(if (supported-package? v86d system)
|
| 610 | (list (service uvesafb-service-type))
|
| 611 | '()))))
|
| 612 |
|
| 613 | (define %issue
|
| 614 | |
| 615 | "
|
| 616 | \x1b[1;37mThis is an installation image of the GNU system. Welcome.\x1b[0m
|
| 617 |
|
| 618 | \x1b[1;33mUse Alt-F2 for documentation.\x1b[0m
|
| 619 | ")
|
| 620 |
|
| 621 | (define %installer-disk-utilities
|
| 622 | |
| 623 | |
| 624 | (list parted gptfdisk ddrescue
|
| 625 | |
| 626 | lvm2-static
|
| 627 | |
| 628 | |
| 629 | |
| 630 | cryptsetup mdadm
|
| 631 | dosfstools
|
| 632 | btrfs-progs
|
| 633 | e2fsprogs
|
| 634 | f2fs-tools
|
| 635 | jfsutils
|
| 636 | xfsprogs))
|
| 637 |
|
| 638 | (define* (%installation-initrd-modules
|
| 639 | #:key
|
| 640 | (system (or (and=>
|
| 641 | (%current-target-system)
|
| 642 | platform-target->system)
|
| 643 | (%current-system))))
|
| 644 | |
| 645 | |
| 646 | |
| 647 | `(,@(if (target-aarch64? system)
|
| 648 | '("sr_mod" "sd_mod"
|
| 649 | "usb_common" "usbcore"
|
| 650 | |
| 651 | "xhci_pci" "xhci_hcd"
|
| 652 | "xhci_plat_hcd"
|
| 653 | |
| 654 | "dwc3" "dwc3_pci"
|
| 655 | |
| 656 | "phy_sun4i_usb" "phy_sun50i_usb3"
|
| 657 | |
| 658 | "dwc3_qcom"
|
| 659 | "phy_qcom_qmp_usb" "phy_qcom_qusb2"
|
| 660 | "phy_qcom_snps_femto_v2" "phy_qcom_usb_hs"
|
| 661 | "phy_qcom_usb_ss"
|
| 662 | |
| 663 | "phy_tusb1210"
|
| 664 | |
| 665 | "phy_rockchip_usb"
|
| 666 | "phy_rockchip_inno_usb2" "phy_rockchip_typec"
|
| 667 | |
| 668 | "phy_fsl_imx8mq_usb"
|
| 669 | |
| 670 | "phy_generic"
|
| 671 | |
| 672 | |
| 673 | "dwc2"
|
| 674 | "ehci_pci" "ehci_hcd"
|
| 675 | "ehci_platform"
|
| 676 | |
| 677 | "ohci_pci" "ohci_hcd"
|
| 678 | |
| 679 | "mmc_hsq" "mmc_spi"
|
| 680 | "mmc_core" "mmc_block"
|
| 681 | "sdhci" "sdhci_pci"
|
| 682 | "mmc_spi"
|
| 683 | "sdhci_acpi"
|
| 684 | |
| 685 | "dw_mmc" "dw_mmc-pltfm" "dw_mmc-rockchip"
|
| 686 | "sunxi_mmc" "sdhci_pltfm" "sdhci_msm"
|
| 687 | "sdhci_of_arasan" "sdhci_of_esdhc" "sdhci_brcmstb"
|
| 688 | "sdhci_tegra" "phy_rockchip_emmc"
|
| 689 | "sdhci_esdhc_imx")
|
| 690 | '())
|
| 691 | ,@%base-initrd-modules))
|
| 692 |
|
| 693 | (define* (make-installation-os #:key
|
| 694 | |
| 695 | (grub-displayed-version
|
| 696 | (package-version guix))
|
| 697 | |
| 698 | |
| 699 | |
| 700 | (efi-only? #f))
|
| 701 | |
| 702 | (operating-system
|
| 703 | (host-name "gnu")
|
| 704 | (timezone "Europe/Paris")
|
| 705 | (locale "en_US.utf8")
|
| 706 | (name-service-switch %mdns-host-lookup-nss)
|
| 707 |
|
| 708 | (initrd-modules (%installation-initrd-modules))
|
| 709 |
|
| 710 | (bootloader (if efi-only?
|
| 711 | (bootloader-configuration
|
| 712 | (bootloader grub-efi-bootloader)
|
| 713 | (targets '("/boot/efi")))
|
| 714 | (bootloader-configuration
|
| 715 | (bootloader grub-bootloader)
|
| 716 | (targets '("/dev/sda")))))
|
| 717 | (label (string-append "GNU Guix installation " grub-displayed-version))
|
| 718 |
|
| 719 | |
| 720 | |
| 721 | |
| 722 | |
| 723 | (kernel-arguments '("quiet" "modprobe.blacklist=radeon,amdgpu"))
|
| 724 |
|
| 725 | (file-systems
|
| 726 | |
| 727 | |
| 728 | (append %base-live-file-systems
|
| 729 |
|
| 730 | |
| 731 | |
| 732 | (list %pseudo-terminal-file-system
|
| 733 | %shared-memory-file-system
|
| 734 | %efivars-file-system
|
| 735 | %immutable-store)))
|
| 736 |
|
| 737 | (users (list (user-account
|
| 738 | (name "guest")
|
| 739 | (group "users")
|
| 740 | (supplementary-groups '("wheel")) |
| 741 | (password "")
|
| 742 | (comment "Guest of GNU"))))
|
| 743 |
|
| 744 | (issue %issue)
|
| 745 | (services (%installation-services))
|
| 746 |
|
| 747 | |
| 748 | |
| 749 | (privileged-programs (list (privileged-program
|
| 750 | (program (file-append shadow "/bin/passwd"))
|
| 751 | (setuid? #t))))
|
| 752 |
|
| 753 | (pam-services
|
| 754 | |
| 755 | (base-pam-services #:allow-empty-passwords? #t))
|
| 756 |
|
| 757 | (packages (append
|
| 758 | (list glibc |
| 759 | fontconfig
|
| 760 | font-dejavu font-gnu-unifont
|
| 761 |
|
| 762 | |
| 763 | (bootloader-package
|
| 764 | (bootloader-configuration-bootloader bootloader)))
|
| 765 | %installer-disk-utilities
|
| 766 | %base-packages))))
|
| 767 |
|
| 768 | (define installation-os (make-installation-os))
|
| 769 |
|
| 770 | (define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
|
| 771 | (triplet "arm-linux-gnueabihf"))
|
| 772 | "Given OS, amend it with the u-boot bootloader for BOARD,
|
| 773 | installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET.
|
| 774 |
|
| 775 | If you want a serial console, make sure to specify one in your
|
| 776 | operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
|
| 777 | (operating-system (inherit os)
|
| 778 | (bootloader (bootloader-configuration
|
| 779 | (bootloader (bootloader (inherit u-boot-bootloader)
|
| 780 | (package (make-u-boot-package board triplet))))
|
| 781 | (targets (list bootloader-target))))))
|
| 782 |
|
| 783 | (define* (embedded-installation-os bootloader bootloader-target tty
|
| 784 | #:key (extra-modules '()))
|
| 785 | "Return an installation os for embedded systems.
|
| 786 | The initrd gets the extra modules EXTRA-MODULES.
|
| 787 | A getty is provided on TTY.
|
| 788 | The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
|
| 789 | (operating-system
|
| 790 | (inherit installation-os)
|
| 791 | (bootloader (bootloader-configuration
|
| 792 | (bootloader bootloader)
|
| 793 | (targets (list bootloader-target))))
|
| 794 | (kernel linux-libre)
|
| 795 | (kernel-arguments
|
| 796 | (cons (string-append "console=" tty)
|
| 797 | (operating-system-user-kernel-arguments installation-os)))
|
| 798 | (initrd-modules (append extra-modules %base-initrd-modules))))
|
| 799 |
|
| 800 | (define am335x-evm-installation-os
|
| 801 | (embedded-installation-os u-boot-am335x-evm-bootloader
|
| 802 | "/dev/sda"
|
| 803 | "ttyO0"
|
| 804 | #:extra-modules
|
| 805 | |
| 806 | '("omap_hsmmc")))
|
| 807 |
|
| 808 | (define beaglebone-black-installation-os
|
| 809 | (embedded-installation-os u-boot-beaglebone-black-bootloader
|
| 810 | "/dev/sda"
|
| 811 | "ttyO0"
|
| 812 | #:extra-modules
|
| 813 | |
| 814 | '("omap_hsmmc")))
|
| 815 |
|
| 816 |
|
| 817 | (define a20-olinuxino-lime-installation-os
|
| 818 | (embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
|
| 819 | "/dev/mmcblk0" |
| 820 | "ttyS0"))
|
| 821 |
|
| 822 | (define a20-olinuxino-lime2-emmc-installation-os
|
| 823 | (embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
|
| 824 | "/dev/mmcblk1" |
| 825 | "ttyS0"))
|
| 826 |
|
| 827 | (define a20-olinuxino-micro-installation-os
|
| 828 | (embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
|
| 829 | "/dev/mmcblk0" |
| 830 | "ttyS0"))
|
| 831 |
|
| 832 | (define bananapi-m2-ultra-installation-os
|
| 833 | (embedded-installation-os u-boot-bananapi-m2-ultra-bootloader
|
| 834 | "/dev/mmcblk1" |
| 835 | "ttyS0"))
|
| 836 |
|
| 837 | (define firefly-rk3399-installation-os
|
| 838 | (embedded-installation-os u-boot-firefly-rk3399-bootloader
|
| 839 | "/dev/mmcblk0" |
| 840 | "ttyS2")) |
| 841 |
|
| 842 | (define mx6cuboxi-installation-os
|
| 843 | (embedded-installation-os u-boot-mx6cuboxi-bootloader
|
| 844 | "/dev/mmcblk0" |
| 845 | "ttymxc0"))
|
| 846 |
|
| 847 | (define novena-installation-os
|
| 848 | (embedded-installation-os u-boot-novena-bootloader
|
| 849 | "/dev/mmcblk1" |
| 850 | "ttymxc1"))
|
| 851 |
|
| 852 | (define orangepi-r1-plus-lts-rk3328-installation-os
|
| 853 | (embedded-installation-os u-boot-orangepi-r1-plus-lts-rk3328-bootloader
|
| 854 | "/dev/mmcblk0" |
| 855 | "ttyS0"))
|
| 856 |
|
| 857 | (define pine64-plus-installation-os
|
| 858 | (embedded-installation-os u-boot-pine64-plus-bootloader
|
| 859 | "/dev/mmcblk0" |
| 860 | "ttyS0"))
|
| 861 |
|
| 862 | (define pinebook-installation-os
|
| 863 | (embedded-installation-os u-boot-pinebook-bootloader
|
| 864 | "/dev/mmcblk0" |
| 865 | "ttyS0"))
|
| 866 |
|
| 867 | (define rock64-installation-os
|
| 868 | (embedded-installation-os u-boot-rock64-rk3328-bootloader
|
| 869 | "/dev/mmcblk0" |
| 870 | "ttyS2")) |
| 871 |
|
| 872 | (define rock-4c-plus-installation-os
|
| 873 | (embedded-installation-os u-boot-rock-4c-plus-rk3399-bootloader
|
| 874 | "/dev/mmcblk0" |
| 875 | "ttyS2")) |
| 876 |
|
| 877 | (define rockpro64-installation-os
|
| 878 | (embedded-installation-os u-boot-rockpro64-rk3399-bootloader
|
| 879 | "/dev/mmcblk0" |
| 880 | "ttyS2")) |
| 881 |
|
| 882 | (define rk3399-puma-installation-os
|
| 883 | (embedded-installation-os u-boot-puma-rk3399-bootloader
|
| 884 | "/dev/mmcblk0" |
| 885 | "ttyS0"))
|
| 886 |
|
| 887 | (define wandboard-installation-os
|
| 888 | (embedded-installation-os u-boot-wandboard-bootloader
|
| 889 | "/dev/mmcblk0" |
| 890 | "ttymxc0"))
|
| 891 |
|
| 892 | |
| 893 | installation-os
|
| 894 |
|
| 895 | |