Commit graph

19 commits

Author SHA1 Message Date
Mathieu Othacehe
cafbc5f390
installer: final: Introduce call-with-mnt-container.
* gnu/installer/final.scm (call-with-mnt-container): New procedure,
(install-system): use it instead of call-with-container, to make sure that the
container is not jailed.
2020-09-10 09:38:52 +02:00
Mathieu Othacehe
8ce6f4dc28
installer: Run the installation inside a container.
When the store overlay is mounted, other processes such as kmscon, udev
and guix-daemon may open files from the store, preventing the
underlying install support from being umounted. See:
https://lists.gnu.org/archive/html/guix-devel/2018-12/msg00161.html.

To avoid this situation, mount the store overlay inside a container,
and run the installation from within that container.

* gnu/build/shepherd.scm (fork+exec-command/container): New procedure.
* gnu/services/base.scm (guix-shepherd-service): Support an optional PID
argument passed to the "start" method. If that argument is passed, ensure that
guix-daemon enters the given PID MNT namespace by using
fork+exec-command/container procedure.
* gnu/installer/final.scm (umount-cow-store): Remove it,
(install-system): run the installation from within a container.
* gnu/installer/newt/final.scm (run-install-shell): Remove the display hack.
2020-09-02 17:05:23 +02:00
Mathieu Othacehe
4febc38d9f
installer: final: Remove restart-service procedure.
* gnu/installer/final.scm (umount-cow-store): Remove "restart-service" that is
now provided by (gnu services herd).
2020-06-16 16:33:55 +02:00
Mathieu Othacehe
478d1270ce
install: final: Add some logging.
* gnu/installer/final.scm (umount-cow-store): Add some logging.
2020-06-13 15:21:20 +02:00
Mathieu Othacehe
9392652e91
installer: final: Dump "guix system init" command output when testing.
When debugging the installation tests, it can be very handy to be able to read
"guix system init" command output.

* gnu/installer/final.scm (install-system): Dump installation command output
to the console when running the installation tests.
2020-06-09 17:59:05 +02:00
Mathieu Othacehe
ce16b07d10
installer: final: Remove left-over pk call.
* gnu/installer/final.scm (kill-cow-users): Remove pk call.
2020-06-09 17:59:05 +02:00
Mathieu Othacehe
7730f41afd
installer: final: Add some extra logging.
* gnu/installer/final.scm (kill-cow-users): Log the killed process name,
(umount-cow-store): inform that we are umounting the cow-store.
2020-06-05 09:04:23 +02:00
Mathieu Othacehe
f9b6f75d1c
installer: Fix cow-store umount issue.
* gnu/installer/final.scm (kill-cow-users): Ignore exception that could be
raised if a process disappears between reading its pid and its maps file.
2020-03-23 18:46:40 +01:00
Mathieu Othacehe
64704be417
installer: Fix cow-store umount.
This fixes <https://bugs.gnu.org/39712>.

The guix-daemon was preventing the cow-store umount, so restart it.  Some
udevd workers, using cow-store files might also still be around, so have some
umount retries.

* gnu/installer/final.scm (kill-cow-users): New procedure,
(umount-cow-store): restart guix-daemon and kill all processes started from
within the cow-store before trying to umount the store overlay. Also try 5
times to umount the overlay in case it is still busy.
2020-03-05 23:40:24 +01:00
Ludovic Courtès
e458726ab4
installer: Honor /tmp/installer-system-init-options.
* gnu/installer/final.scm (install-system): Honor
"/tmp/installer-system-init-options".
2020-03-05 23:40:23 +01: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
Mathieu Othacehe
1d02052067
installer: Remove the cow-store overlay after system installation.
Fixes <https://issues.guix.info/issue/39217>.
Fixes <https://issues.guix.info/issue/38447>.

* gnu/installer/final.scm (umount-cow-store): New procedure ...,
(install-system): ... used here, to remove the store overlay so that the
target device is not seen as busy during further umount calls.
2020-02-12 10:49:48 +01:00
Ludovic Courtès
a4ee6ac444
installer: Pass '--fallback' to 'guix system init'.
Fixes <https://bugs.gnu.org/38608>.
Reported by Nathan Dehnel <ncdehnel@gmail.com>.

* gnu/installer/final.scm (install-system): Pass '--fallback' to 'guix
system init'.
2019-12-29 18:24:55 +01:00
Ludovic Courtès
0e8e963d73
installer: User accounts can now have a "real name."
* gnu/installer/newt/user.scm (run-user-add-page): Add #:real-name.  Add
a label and entry for the real name and initialize the 'real-name' field
of the <user> record.
* gnu/installer/final.scm (create-user-database): Set the 'comment'
field of the <user-account> record.
2019-04-28 22:57:07 +02: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
91a7c4998f
installer: Ask for the root account password.
Fixes <https://bugs.gnu.org/35399>.

* gnu/installer/newt/user.scm (run-root-password-page): New procedure.
* gnu/installer/user.scm (users->configuration): Filter out the "root"
account.
* gnu/installer/final.scm (create-user-database): Set 'uid' field in
'user-account' form.
2019-04-25 00:45:35 +02:00
Ludovic Courtès
898677ed17
installer: Ask for user password and initialize /etc/shadow.
Partly fixes <https://bugs.gnu.org/35399>.

* gnu/installer/user.scm (<user>)[password]: New field.
* gnu/installer/final.scm (%seed): New variable.
(integer->alphanumeric-char, random-string)
(create-user-database): New procedures.
(install-system): Call 'create-user-database'.
* gnu/installer/newt/final.scm (run-install-shell): Add #:users and pass
it to 'install-system'.
(run-final-page): Pass #:users to 'run-install-shell'.
* gnu/installer/newt/user.scm (run-user-add-page): Add password entry.
Pass its result as the 'password' field of <user>.
2019-04-25 00:45:34 +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
dc5f3275ec
installer: Add configuration formatter.
* gnu/installer.scm (installer-steps): Add configuration-formatter procedures.
* gnu/installer/final.scm: New file.
* gnu/installer/locale.scm (locale->configuration): New exported procedure.
* gnu/installer/newt.scm (newt-installer): Add final page.
* gnu/installer/newt/final.scm: New file.
* gnu/installer/record.scm (installer): Add final-page field.
* gnu/installer/timezone.scm (posix-tz->configuration): New exported
procedure.
* gnu/installer/steps.scm (installer-step): Rename configuration-proc field to
configuration-formatter.
(%installer-configuration-file): New exported parameter,
(%installer-target-dir): ditto,
(%configuration-file-width): ditto,
(format-configuration): new exported procedure,
(configuration->file): new exported procedure.
2019-01-17 14:04:22 +01:00