diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2018-11-16 20:43:55 +0900 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-01-17 14:04:20 +0100 |
| commit | d0f3a672dcbdfefd3556b6a21985ff0e35eed3be (patch) | |
| tree | 6ca7cc2fc874343791a3b555181177be488a3a8a /gnu/installer.scm | |
| parent | 08af580bde01ffd8e6968b6f9f9eff14c4f9cc5a (diff) | |
gnu: Add graphical installer support.
* configure.ac: Require that guile-newt is available.
* gnu/installer.scm: New file.
* gnu/installer/aux-files/logo.txt: New file.
* gnu/installer/build-installer.scm: New file.
* gnu/installer/connman.scm: New file.
* gnu/installer/keymap.scm: New file.
* gnu/installer/locale.scm: New file.
* gnu/installer/newt.scm: New file.
* gnu/installer/newt/ethernet.scm: New file.
* gnu/installer/newt/hostname.scm: New file.
* gnu/installer/newt/keymap.scm: New file.
* gnu/installer/newt/locale.scm: New file.
* gnu/installer/newt/menu.scm: New file.
* gnu/installer/newt/network.scm: New file.
* gnu/installer/newt/page.scm: New file.
* gnu/installer/newt/timezone.scm: New file.
* gnu/installer/newt/user.scm: New file.
* gnu/installer/newt/utils.scm: New file.
* gnu/installer/newt/welcome.scm: New file.
* gnu/installer/newt/wifi.scm: New file.
* gnu/installer/steps.scm: New file.
* gnu/installer/timezone.scm: New file.
* gnu/installer/utils.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add previous files.
* gnu/system.scm: Export %root-account.
* gnu/system/install.scm (%installation-services): Use kmscon instead of linux
VT for all tty.
(installation-os)[users]: Add the graphical installer as shell of the root
account.
[packages]: Add font related packages.
* po/guix/POTFILES.in: Add installer files.
Diffstat (limited to 'gnu/installer.scm')
| -rw-r--r-- | gnu/installer.scm | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm new file mode 100644 index 00000000000..f3323ea3bcd --- /dev/null +++ b/gnu/installer.scm | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 7 | ;;; under the terms of the GNU General Public License as published by | ||
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 9 | ;;; your option) any later version. | ||
| 10 | ;;; | ||
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | ;;; GNU General Public License for more details. | ||
| 15 | ;;; | ||
| 16 | ;;; You should have received a copy of the GNU General Public License | ||
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | (define-module (gnu installer) | ||
| 20 | #:use-module (guix discovery) | ||
| 21 | #:use-module (guix records) | ||
| 22 | #:use-module (guix ui) | ||
| 23 | #:use-module (srfi srfi-1) | ||
| 24 | #:export (<installer> | ||
| 25 | installer | ||
| 26 | make-installer | ||
| 27 | installer? | ||
| 28 | installer-name | ||
| 29 | installer-modules | ||
| 30 | installer-init | ||
| 31 | installer-exit | ||
| 32 | installer-exit-error | ||
| 33 | installer-keymap-page | ||
| 34 | installer-locale-page | ||
| 35 | installer-menu-page | ||
| 36 | installer-network-page | ||
| 37 | installer-timezone-page | ||
| 38 | installer-hostname-page | ||
| 39 | installer-user-page | ||
| 40 | installer-welcome-page | ||
| 41 | |||
| 42 | %installers | ||
| 43 | lookup-installer-by-name)) | ||
| 44 | |||
| 45 | |||
| 46 | ;;; | ||
| 47 | ;;; Installer record. | ||
| 48 | ;;; | ||
| 49 | |||
| 50 | ;; The <installer> record contains pages that will be run to prompt the user | ||
| 51 | ;; for the system configuration. The goal of the installer is to produce a | ||
| 52 | ;; complete <operating-system> record and install it. | ||
| 53 | |||
| 54 | (define-record-type* <installer> | ||
| 55 | installer make-installer | ||
| 56 | installer? | ||
| 57 | ;; symbol | ||
| 58 | (name installer-name) | ||
| 59 | ;; list of installer modules | ||
| 60 | (modules installer-modules) | ||
| 61 | ;; procedure: void -> void | ||
| 62 | (init installer-init) | ||
| 63 | ;; procedure: void -> void | ||
| 64 | (exit installer-exit) | ||
| 65 | ;; procedure (key arguments) -> void | ||
| 66 | (exit-error installer-exit-error) | ||
| 67 | ;; procedure (#:key models layouts) -> (list model layout variant) | ||
| 68 | (keymap-page installer-keymap-page) | ||
| 69 | ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) | ||
| 70 | ;; -> glibc-locale | ||
| 71 | (locale-page installer-locale-page) | ||
| 72 | ;; procedure: (steps) -> step-id | ||
| 73 | (menu-page installer-menu-page) | ||
| 74 | ;; procedure void -> void | ||
| 75 | (network-page installer-network-page) | ||
| 76 | ;; procedure (zonetab) -> posix-timezone | ||
| 77 | (timezone-page installer-timezone-page) | ||
| 78 | ;; procedure void -> void | ||
| 79 | (hostname-page installer-hostname-page) | ||
| 80 | ;; procedure void -> void | ||
| 81 | (user-page installer-user-page) | ||
| 82 | ;; procedure (logo) -> void | ||
| 83 | (welcome-page installer-welcome-page)) | ||
| 84 | |||
| 85 | |||
| 86 | ;;; | ||
| 87 | ;;; Installers. | ||
| 88 | ;;; | ||
| 89 | |||
| 90 | (define (installer-top-modules) | ||
| 91 | "Return the list of installer modules." | ||
| 92 | (all-modules (map (lambda (entry) | ||
| 93 | `(,entry . "gnu/installer")) | ||
| 94 | %load-path) | ||
| 95 | #:warn warn-about-load-error)) | ||
| 96 | |||
| 97 | (define %installers | ||
| 98 | ;; The list of publically-known installers. | ||
| 99 | (delay (fold-module-public-variables (lambda (obj result) | ||
| 100 | (if (installer? obj) | ||
| 101 | (cons obj result) | ||
| 102 | result)) | ||
| 103 | '() | ||
| 104 | (installer-top-modules)))) | ||
| 105 | |||
| 106 | (define (lookup-installer-by-name name) | ||
| 107 | "Return the installer called NAME." | ||
| 108 | (or (find (lambda (installer) | ||
| 109 | (eq? name (installer-name installer))) | ||
| 110 | (force %installers)) | ||
| 111 | (leave (G_ "~a: no such installer~%") name))) | ||
