Commit Graph

9 Commits

Author SHA1 Message Date
Mathieu Othacehe 0bd7a6bad9
gnu: installer: Fix issue with "Esperanto" locale.
According to glibc manual, locale are under the following form:
          language[_territory[.codeset]][@modifier]

The esperanto locale "epo" does not have a territory. Modify run-command to
take this into account.

Reported by Alex Sassmannshausen here:
https://lists.gnu.org/archive/html/guix-devel/2020-04/msg00192.html.

* gnu/installer/utils.scm (run-command): Handle locale without territory such
as "epo".
2020-04-10 16:05:38 +02:00
Ludovic Courtès 8a4b11c6a9
installer: Run commands without hopping through the shell.
* gnu/installer/utils.scm (run-shell-command): Rename to...
(run-command): Remove call to 'call-with-temporary-output-file' and hop
through Bash.  Expect COMMAND to be a list of strings rather than a
string.
* gnu/installer/final.scm (install-system): Turn INSTALL-COMMAND into a
list of strings and pass it to 'run-command'.
* gnu/installer/newt/page.scm (edit-file): Likewise.
2020-03-05 23:40:23 +01:00
Ludovic Courtès 63b8c089c1
installer: Implement a dialog on /var/guix/installer-socket.
This will allow us to automate testing of the installer.

* gnu/installer/utils.scm (%client-socket-file)
(current-server-socket, current-clients): New variables.
(open-server-socket, call-with-server-socket): New procedure.
(with-server-socket): New macro.
(run-shell-command): Add call to 'send-to-clients'.  Select on both
current-input-port and current-clients.
* gnu/installer/steps.scm (run-installer-steps): Wrap 'call-with-prompt'
in 'with-socket-server'.  Call 'sigaction' for SIGPIPE.
* gnu/installer/newt/page.scm (watch-clients!, close-port-and-reuse-fd)
(run-form-with-clients, send-to-clients): New procedures.
(draw-info-page): Add call to 'run-form-with-clients'.
(run-input-page): Likewise.  Handle EXIT-REASON equal to 'exit-fd-ready.
(run-confirmation-page): Likewise.
(run-listbox-selection-page): Likewise.  Define 'choice->item' and use it.
(run-checkbox-tree-page): Likewise.
(run-file-textbox-page): Add call to 'run-form-with-clients'.  Handle
'exit-fd-ready'.
* gnu/installer/newt/partition.scm (run-disk-page): Pass
 #:client-callback-procedure to 'run-listbox-selection-page'.
* gnu/installer/newt/user.scm (run-user-page): Call
'run-form-with-clients'.  Handle 'exit-fd-ready'.
* gnu/installer/newt/welcome.scm (run-menu-page): Define
'choice->item' and use it.  Call 'run-form-with-clients'.
* gnu/installer/newt/final.scm (run-install-success-page)
(run-install-failed-page): When (current-clients) is non-empty, call
'send-to-clients' without displaying a choice window.
2020-03-05 23:40:22 +01:00
Ludovic Courtès 5c04b00cf4
installer: Log important bits to syslog.
* gnu/installer.scm (installer-program): Log crashes with 'syslog'.
* gnu/installer/parted.scm (luks-format-and-open, luks-close)
(mount-user-partitions, umount-user-partitions): Add 'syslog' calls.
* gnu/installer/steps.scm (run-installer-steps): Log the running step
with 'syslog'.
* gnu/installer/utils.scm (run-shell-command): Add calls to 'syslog'.
2020-02-22 00:45:42 +01:00
Ludovic Courtès 2cf65e1d54
installer: Add 'syslog' macro to write to syslog.
* gnu/installer/utils.scm (open-syslog-port, syslog-port): New
procedures.
(syslog): New macro.
2020-02-22 00:45:42 +01:00
Ludovic Courtès 9529f7850e
installer: Take 'guix system init' exit code into account.
This allows the installer to distinguish success from failure, and also
ensures the shell that runs 'guix system init' exits upon completion.

* gnu/installer/utils.scm (run-shell-command)[pause]: New procedure.
Add "exec" before COMMAND in the script.  Guard 'invoke' call and handle
'invoke-error?'.  Add call to 'pause' on completion.
* gnu/installer/final.scm (install-system): Remove 'false-if-exception'.
2019-04-26 14:19:36 +02:00
Ludovic Courtès 7611074f67
installer: Run 'guix system init' with the right locale.
* gnu/installer/utils.scm (run-shell-command): Add #:locale and honor it.
* gnu/installer/newt/final.scm (run-install-shell): Add 'locale'
parameter; pass it to 'install-system'.
(run-final-page): Obtain locale from RESULT; pass it to 'run-install-shell'.
* gnu/installer/final.scm (install-system): Add 'locale' parameter; pass
it to 'run-shell-command'.
2019-04-23 00:34:47 +02:00
Mathieu Othacehe 3ad8f7757c
installer: Add new utils.
* gnu/installer/utils.scm (nearest-exact-integer): New exported procedure,
(read-percentage): ditto,
(run-shell-command): ditto.
2019-01-17 14:04:22 +01:00
Mathieu Othacehe d0f3a672dc
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.
2019-01-17 14:04:20 +01:00