/* GNU Guix --- Functional package management for GNU Copyright 1996-1997,2000-2001,2006,2008,2011,2013,2018,2020 Free Software Foundation, Inc. Copyright (C) 2020 Ludovic Courtès This file is part of GNU Guix. GNU Guix is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Guix. If not, see . */ /* This file implements a variant of the 'guile' executable that does not complain about locale issues and arranges to reduce startup time by ignoring GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH until it has booted. */ #include #include #include #include /* Saved values of GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH. */ static const char *load_path, *load_compiled_path; static void inner_main (void *unused, int argc, char **argv) { if (load_path != NULL) { setenv ("GUILE_LOAD_PATH", load_path, 1); SCM load_path_var = scm_c_public_lookup ("guile", "%load-path"); SCM addition = scm_parse_path (scm_from_locale_string (load_path), SCM_EOL); scm_variable_set_x (load_path_var, scm_append (scm_list_2 (scm_variable_ref (load_path_var), addition))); } if (load_compiled_path != NULL) { setenv ("GUILE_LOAD_COMPILED_PATH", load_compiled_path, 1); SCM load_compiled_path_var = scm_c_public_lookup ("guile", "%load-compiled-path"); SCM addition = scm_parse_path (scm_from_locale_string (load_compiled_path), SCM_EOL); scm_variable_set_x (load_compiled_path_var, scm_append (scm_list_2 (scm_variable_ref (load_compiled_path_var), addition))); } scm_shell (argc, argv); } int main (int argc, char **argv) { /* Try to install the current locale; remain silent if it fails. */ if (setlocale (LC_ALL, "") == NULL) /* The 'guix pull'-provided 'guix' includes at least en_US.utf8 so use that. That gives us UTF-8 support for 'scm_to_locale_string', etc., which is always preferable over the C locale. */ setlocale (LC_ALL, "en_US.utf8"); const char *str; str = getenv ("GUILE_LOAD_PATH"); load_path = str != NULL ? strdup (str) : NULL; str = getenv ("GUILE_LOAD_COMPILED_PATH"); load_compiled_path = str ? strdup (str) : NULL; unsetenv ("GUILE_LOAD_PATH"); unsetenv ("GUILE_LOAD_COMPILED_PATH"); scm_install_gmp_memory_functions = 1; scm_boot_guile (argc, argv, inner_main, 0); return 0; /* never reached */ } r with the option to (cross-) install the Hurd, if applicable (only available on x86 machines for now). * gnu/installer/newt.scm (kernel-page): New procedure. (newt-installer)[kernel-page]: New field. * gnu/installer/kernel.scm, gnu/installer/newt/kernel.scm: New files. * gnu/local.mk (INSTALLER_MODULES): Add them. * gnu/installer.scm (installer-steps): Use them to select kernel if applicable. * gnu/installer/newt/partition.scm (run-label-page): Default to "msdos" when instaling the Hurd. (run-fs-type-page): Add ext2 for the hurd. (run-partitioning-page-partition): Remove `entire-encrypted' option when installing the Hurd. * gnu/installer/services.scm (system-services->configuration): Cater for the Hurd with %base-services/hurd, and with %base-packages/hurd that must always be set. (%system-services): Change to procedure. When installing the the Hurd, do not recommend `ntp-service-type' and USE `openssh-sans-x' package for `openssh-service-type'. (system-service-none): New variable. * gnu/installer/newt/services.scm (run-network-management-page): Include it when installing the Hurd. (run-desktop-environments-cbt-page): When installing the Hurd, recommend to not select any desktop enviroment. Update users. * gnu/installer/parted.scm (efi-installation?): Return #f when installing for the Hurd. (create-ext2-file-system): New procedure. (user-fs-type-name, user-fs-type->mount-type, partition-filesystem-user-type, format-user-partitions): Support `ext2'. (<user-partition> partition->user-partition): Use `ext2' when installing the Hurd. (auto-partition!): Likewise. No swap partition when installing the Hurd. * gnu/installer/final.scm (install-system): Cater for cross installation of the Hurd. (bootloader-configuration): Use `grub-minimal-bootloader' when installing the Hurd. (user-partition-missing-modules): Cater for empty user-partitions. (initrd-configuration, user-partitions->configuration): Cater for the Hurd. * gnu/installer/steps.scm (format-configuration, configuration->file): Cater for the Hurd. * gnu/system/hurd.scm (%desktop-services/hurd): New variable. * gnu/installer/tests.scm (choose-kernel): New procedure. * gnu/tests/install.scm (gui-test-program): Use it. Change-Id: Ifafb27b8a2f933944c77223a27ec151757237e36 Janneke Nieuwenhuizen