From b419c7f5fb5774b3af201550c11d9c5f867570ae Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 23 Nov 2014 21:53:24 +0100 Subject: install: Add Cryptsetup to the image. Reported by Nikita Karetnikov. * gnu/system/install.scm (installation-os)[packages]: Add CRYPTSETUP. * doc/guix.texi (System Installation): Mention it. --- gnu/system/install.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 961361b93..dd3a3eb29 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -22,6 +22,7 @@ #:use-module (guix monads) #:use-module ((guix store) #:select (%store-prefix)) #:use-module (gnu packages linux) + #:use-module (gnu packages cryptsetup) #:use-module (gnu packages package-management) #:use-module (gnu packages disk) #:use-module (gnu packages grub) @@ -254,6 +255,7 @@ Use Alt-F2 for documentation. (packages (cons* texinfo-4 ;for the standalone Info reader parted ddrescue grub ;mostly so xrefs to its manual work + cryptsetup wireless-tools ;; XXX: We used to have GNU fdisk here, but as of version ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable -- cgit v1.3 From db84467a904c36093dd1476ac5e26c8764ba278b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Nov 2014 15:39:24 +0100 Subject: install: Add wpa-supplicant to the image. Reported by Amirouche Boubekki . * gnu/system/install.scm (installation-os)[packages]: Add WPA-SUPPLICANT. --- gnu/system/install.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index dd3a3eb29..d3d6764a7 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -21,6 +21,7 @@ #:use-module (guix gexp) #:use-module (guix monads) #:use-module ((guix store) #:select (%store-prefix)) + #:use-module (gnu packages admin) #:use-module (gnu packages linux) #:use-module (gnu packages cryptsetup) #:use-module (gnu packages package-management) @@ -256,7 +257,7 @@ Use Alt-F2 for documentation. parted ddrescue grub ;mostly so xrefs to its manual work cryptsetup - wireless-tools + wireless-tools wpa-supplicant ;; XXX: We used to have GNU fdisk here, but as of version ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable ;; space; furthermore util-linux's fdisk is already -- cgit v1.3 From 4d6b879cb5313c30910330763dca1f1642623c4d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Nov 2014 16:01:21 +0100 Subject: file-systems: 'file-system-needed-for-boot?' always returns #t for "/". Reported by Nikita Karetnikov. * gnu/system/file-systems.scm (): Rename 'needed-for-boot?' accessor to '%file-system-needed-for-boot?'. (file-system-needed-for-boot?): New inlinable procedure. * gnu/system.scm (other-file-system-services)[file-systems]: Rely on 'file-system-needed-for-boot?' to handle the "/" case. (operating-system-initrd-file)[boot-file-systems]: Likewise. --- gnu/system.scm | 11 ++--------- gnu/system/file-systems.scm | 8 +++++++- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system.scm b/gnu/system.scm index f98aa83f6..5c915d396 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -204,9 +204,7 @@ file." "Return file system services for the file systems of OS that are not marked as 'needed-for-boot'." (define file-systems - (remove (lambda (fs) - (or (file-system-needed-for-boot? fs) - (string=? "/" (file-system-mount-point fs)))) + (remove file-system-needed-for-boot? (operating-system-file-systems os))) (define (device-mappings fs) @@ -638,12 +636,7 @@ we're running in the final root." (define (operating-system-initrd-file os) "Return a gexp denoting the initrd file of OS." (define boot-file-systems - (filter (match-lambda - (($ device title "/") - #t) - (($ device title mount-point type flags - options boot?) - boot?)) + (filter file-system-needed-for-boot? (operating-system-file-systems os))) (define mapped-devices diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index ed9d70587..476082184 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -70,13 +70,19 @@ (default '())) (options file-system-options ; string or #f (default #f)) - (needed-for-boot? file-system-needed-for-boot? ; Boolean + (needed-for-boot? %file-system-needed-for-boot? ; Boolean (default #f)) (check? file-system-check? ; Boolean (default #t)) (create-mount-point? file-system-create-mount-point? ; Boolean (default #f))) +(define-inlinable (file-system-needed-for-boot? fs) + "Return true if FS has the 'needed-for-boot?' flag set, or if it's the root +file system." + (or (%file-system-needed-for-boot? fs) + (string=? "/" (file-system-mount-point fs)))) + (define %fuse-control-file-system ;; Control file system for Linux' file systems in user-space (FUSE). (file-system -- cgit v1.3 From 598e19dca1677aebfe235e974f480b5bdd322694 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Nov 2014 22:49:11 +0100 Subject: system: Build system-wide locale definitions. * gnu/system/locale.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * gnu/system.scm ()[locale]: Change the default to "en_US.utf8". (operating-system-locale-directory): New procecure. (operating-system-derivation): Use it. * doc/guix.texi (Using the Configuration System): Change example locale to "fr_FR.utf8". (operating-system Reference): Add xref to "Locales". Document 'locale-definitions'. (Locales): New section. * po/guix/POTFILES.in: Add gnu/system.scm. --- doc/guix.texi | 86 ++++++++++++++++++++++++++++++++-- gnu-system.am | 1 + gnu/system.scm | 23 ++++++++- gnu/system/locale.scm | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++ po/guix/POTFILES.in | 1 + 5 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 gnu/system/locale.scm (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index fe1f8a8b7..d4bc74f8a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -139,6 +139,7 @@ System Configuration * File Systems:: Configuring file system mounts. * Mapped Devices:: Block device extra processing. * User Accounts:: Specifying user accounts. +* Locales:: Language and cultural convention settings. * Services:: Specifying system services. * Setuid Programs:: Programs running with root privileges. * Initial RAM Disk:: Linux-Libre bootstrapping. @@ -3470,6 +3471,7 @@ instance to support new system services. * File Systems:: Configuring file system mounts. * Mapped Devices:: Block device extra processing. * User Accounts:: Specifying user accounts. +* Locales:: Language and cultural convention settings. * Services:: Specifying system services. * Setuid Programs:: Programs running with root privileges. * Initial RAM Disk:: Linux-Libre bootstrapping. @@ -3496,7 +3498,7 @@ kernel, initial RAM disk, and boot loader looks like this: (operating-system (host-name "komputilo") (timezone "Europe/Paris") - (locale "fr_FR.UTF-8") + (locale "fr_FR.utf8") (bootloader (grub-configuration (device "/dev/sda"))) (file-systems (cons (file-system @@ -3649,9 +3651,13 @@ package}). @item @code{timezone} A timezone identifying string---e.g., @code{"Europe/Paris"}. -@item @code{locale} (default: @code{"en_US.UTF-8"}) -The name of the default locale (@pxref{Locales,,, libc, The GNU C -Library Reference Manual}). +@item @code{locale} (default: @code{"en_US.utf8"}) +The name of the default locale (@pxref{Locale Names,,, libc, The GNU C +Library Reference Manual}). @xref{Locales}, for more information. + +@item @code{locale-definitions} (default: @var{%default-locale-definitions}) +The list of locale definitions to be compiled and that may be used at +run time. @xref{Locales}. @item @code{services} (default: @var{%base-services}) A list of monadic values denoting system services. @xref{Services}. @@ -3958,6 +3964,78 @@ to be present on the system. This includes groups such as ``root'', specific devices such as ``audio'', ``disk'', and ``cdrom''. @end defvr +@node Locales +@subsection Locales + +@cindex locale +A @dfn{locale} defines cultural conventions for a particular language +and region of the world (@pxref{Locales,,, libc, The GNU C Library +Reference Manual}). Each locale has a name that typically has the form +@code{@var{language}_@var{territory}.@var{charset}}---e.g., +@code{fr_LU.utf8} designates the locale for the French language, with +cultural conventions from Luxembourg, and using the UTF-8 encoding. + +@cindex locale definition +Usually, you will want to specify the default locale for the machine +using the @code{locale} field of the @code{operating-system} declaration +(@pxref{operating-system Reference, @code{locale}}). + +That locale must be among the @dfn{locale definitions} that are known to +the system---and these are specified in the @code{locale-definitions} +slot of @code{operating-system}. The default value includes locale +definition for some widely used locales, but not for all the available +locales, in order to save space. + +If the locale specified in the @code{locale} field is not among the +definitions listed in @code{locale-definitions}, @command{guix system} +raises an error. In that case, you should add the locale definition to +the @code{locale-definitions} field. For instance, to add the North +Frisian locale for Germany, the value of that field may be: + +@example +(cons (locale-definition + (name "fy_DE.utf8") (source "fy_DE")) + %default-locale-definitions) +@end example + +Likewise, to save space, one might want @code{locale-definitions} to +list only the locales that are actually used, as in: + +@example +(list (locale-definition + (name "ja_JP.eucjp") (source "ja_JP") + (charset "EUC-JP"))) +@end example + +The @code{locale-definition} form is provided by the @code{(gnu system +locale)} module. Details are given below. + +@deftp {Data Type} locale-definition +This is the data type of a locale definition. + +@table @asis + +@item @code{name} +The name of the locale. @xref{Locale Names,,, libc, The GNU C Library +Reference Manual}, for more information on locale names. + +@item @code{source} +The name of the source for that locale. This is typically the +@code{@var{language}_@var{territory}} part of the locale name. + +@item @code{charset} (default: @code{"UTF-8"}) +The ``character set'' or ``code set'' for that locale, +@uref{http://www.iana.org/assignments/character-sets, as defined by +IANA}. + +@end table +@end deftp + +@defvr {Scheme Variable} %default-locale-definitions +An arbitrary list of commonly used locales, used as the default value of +the @code{locale-definitions} field of @code{operating-system} +declarations. +@end defvr @node Services @subsection Services diff --git a/gnu-system.am b/gnu-system.am index 4c9fcda8b..bd1ac5d27 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -294,6 +294,7 @@ GNU_SYSTEM_MODULES = \ gnu/system/install.scm \ gnu/system/linux.scm \ gnu/system/linux-initrd.scm \ + gnu/system/locale.scm \ gnu/system/shadow.scm \ gnu/system/vm.scm \ \ diff --git a/gnu/system.scm b/gnu/system.scm index 5c915d396..8883d3e75 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -46,12 +46,15 @@ #:use-module (gnu services base) #:use-module (gnu system grub) #:use-module (gnu system shadow) + #:use-module (gnu system locale) #:use-module (gnu system linux) #:use-module (gnu system linux-initrd) #:use-module (gnu system file-systems) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:export (operating-system operating-system? @@ -69,6 +72,7 @@ operating-system-packages operating-system-timezone operating-system-locale + operating-system-locale-definitions operating-system-mapped-devices operating-system-file-systems operating-system-activation-script @@ -129,7 +133,9 @@ (timezone operating-system-timezone) ; string (locale operating-system-locale ; string - (default "en_US.UTF-8")) + (default "en_US.utf8")) + (locale-definitions operating-system-locale-definitions ; list of + (default %default-locale-definitions)) (services operating-system-user-services ; list of monadic services (default %base-services)) @@ -649,6 +655,19 @@ we're running in the final root." #:mapped-devices mapped-devices))) (return #~(string-append #$initrd "/initrd")))) +(define (operating-system-locale-directory os) + "Return the directory containing the locales compiled for the definitions +listed in OS. The C library expects to find it under +/run/current-system/locale." + ;; While we're at it, check whether the locale of OS is defined. + (unless (member (operating-system-locale os) + (map locale-definition-name + (operating-system-locale-definitions os))) + (raise (condition + (&message (message "system locale lacks a definition"))))) + + (locale-directory (operating-system-locale-definitions os))) + (define (kernel->grub-label kernel) "Return a label for the GRUB menu entry that boots KERNEL." (string-append "GNU with " @@ -698,6 +717,7 @@ this file is the reconstruction of GRUB menu entries for old configurations." (boot (operating-system-boot-script os)) (kernel -> (operating-system-kernel os)) (initrd (operating-system-initrd-file os)) + (locale (operating-system-locale-directory os)) (params (operating-system-parameters-file os))) (file-union "system" `(("boot" ,#~#$boot) @@ -705,6 +725,7 @@ this file is the reconstruction of GRUB menu entries for old configurations." ("parameters" ,#~#$params) ("initrd" ,initrd) ("profile" ,#~#$profile) + ("locale" ,#~#$locale) ;used by libc ("etc" ,#~#$etc))))) ;;; system.scm ends here diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm new file mode 100644 index 000000000..9c5c4d2fd --- /dev/null +++ b/gnu/system/locale.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 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 . + +(define-module (gnu system locale) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (srfi srfi-26) + #:export (locale-definition + locale-definition? + locale-definition-name + locale-definition-source + locale-definition-charset + + locale-directory + + %default-locale-definitions)) + +;;; Commentary: +;;; +;;; Locale definitions, and compilation thereof. +;;; +;;; Code: + +(define-record-type* locale-definition + make-locale-definition + locale-definition? + (name locale-definition-name) ;string--e.g., "fr_FR.utf8" + (source locale-definition-source) ;string--e.g., "fr_FR" + (charset locale-definition-charset ;string--e.g., "UTF-8" + (default "UTF-8"))) + +(define* (localedef-command locale + #:key (libc (canonical-package glibc))) + "Return a gexp that runs 'localdef' from LIBC to build LOCALE." + #~(begin + (format #t "building locale '~a'...~%" + #$(locale-definition-name locale)) + (zero? (system* (string-append #$libc "/bin/localedef") + "--no-archive" "--prefix" #$output + "-i" #$(locale-definition-source locale) + "-f" #$(locale-definition-charset locale) + (string-append #$output "/" + #$(locale-definition-name locale)))))) + +(define* (locale-directory locales + #:key (libc (canonical-package glibc))) + "Return a directory containing all of LOCALES compiled." + (define build + #~(begin + (mkdir #$output) + + ;; 'localedef' executes 'gzip' to access compressed locale sources. + (setenv "PATH" (string-append #$gzip "/bin")) + + (exit + (and #$@(map (cut localedef-command <> #:libc libc) + locales))))) + + (gexp->derivation "locale" build + #:local-build? #t)) + +(define %default-locale-definitions + ;; Arbitrary set of locales that are built by default. They are here mostly + ;; to facilitate first-time use to some people, while others may have to add + ;; a specific . + (letrec-syntax ((utf8-locale (syntax-rules () + ((_ name*) + (locale-definition + (name (string-append name* ".utf8")) + (source name*) + (charset "UTF-8"))))) + (utf8-locales (syntax-rules () + ((_ name ...) + (list (utf8-locale name) ...))))) + (utf8-locales "ca_ES" + "cs_CZ" + "da_DK" + "de_DE" + "el_GR" + "en_AU" + "en_CA" + "en_GB" + "en_US" + "es_AR" + "es_CL" + "es_ES" + "es_MX" + "fi_FI" + "fr_BE" + "fr_CA" + "fr_CH" + "fr_FR" + "ga_IE" + "it_IT" + "ja_JP" + "ko_KR" + "nb_NO" + "nl_NL" + "pl_PL" + "pt_PT" + "ro_RO" + "ru_RU" + "sv_SE" + "tr_TR" + "uk_UA" + "vi_VN" + "zh_CN"))) + +;;; locale.scm ends here diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index 5cc68ff40..591b6a1c9 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -1,6 +1,7 @@ # List of source files which contain translatable strings. # This should be source files of the various tools, and not package modules. gnu/packages.scm +gnu/system.scm guix/scripts/build.scm guix/scripts/download.scm guix/scripts/package.scm -- cgit v1.3 From 600c285b6345d8b0cc04f9e92e47ad5bcd437948 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Nov 2014 00:01:29 +0100 Subject: linux-initrd: Copy modules and their dependencies to the initrd. * gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]: Add 'lookup' procedure. Use 'recursive-module-dependencies' to compute the list of modules to copy. Adjust #:modules parameter. --- gnu/system/linux-initrd.scm | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 3279172da..71aba1e23 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -92,7 +92,9 @@ MODULES and taken from LINUX." (define build-exp #~(begin (use-modules (ice-9 match) (ice-9 regex) - (guix build utils)) + (srfi srfi-1) + (guix build utils) + (gnu build linux-modules)) (define (string->regexp str) ;; Return a regexp that matches STR exactly. @@ -101,21 +103,35 @@ MODULES and taken from LINUX." (define module-dir (string-append #$linux "/lib/modules")) + (define (lookup module) + (let ((name (ensure-dot-ko module))) + (match (find-files module-dir (string->regexp name)) + ((file) + file) + (() + (error "module not found" name module-dir)) + ((_ ...) + (error "several modules by that name" + name module-dir))))) + + (define modules + (let ((modules (map lookup '#$modules))) + (append modules + (recursive-module-dependencies modules + #:lookup-module lookup)))) + (mkdir #$output) (for-each (lambda (module) - (match (find-files module-dir (string->regexp module)) - ((file) - (format #t "copying '~a'...~%" file) - (copy-file file (string-append #$output "/" module))) - (() - (error "module not found" module module-dir)) - ((_ ...) - (error "several modules by that name" - module module-dir)))) - '#$modules))) + (format #t "copying '~a'...~%" module) + (copy-file module + (string-append #$output "/" + (basename module)))) + (delete-duplicates modules)))) (gexp->derivation "linux-modules" build-exp - #:modules '((guix build utils)))) + #:modules '((guix build utils) + (guix elf) + (gnu build linux-modules)))) (define (file-system->spec fs) "Return a list corresponding to file-system FS that can be passed to the -- cgit v1.3 From 0e704a2d4ea9b65cde79240f4433296645c5a220 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 27 Nov 2014 23:59:26 +0100 Subject: linux-boot: Load modules and their dependencies, à la 'modprobe'. * gnu/build/linux-boot.scm: Use (gnu build linux-modules). (load-linux-module*): Remove. (boot-system): Add #:linux-module-directory parameter. [lookup-module]: New procedure. Call 'current-module-debugging-port'. Pass #:lookup-module to 'load-linux-module*'. Map LOOKUP-MODULE on LINUX-MODULES. * gnu/system/linux-initrd.scm (base-initrd): Adjust 'boot-system' call accordingly. Adjust #:modules argument as well. * gnu/system.scm (operating-system-activation-script)[%modules]: Likewise. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise. --- gnu/build/linux-boot.scm | 30 +++++++++++++++--------------- gnu/system.scm | 4 +++- gnu/system/linux-initrd.scm | 9 +++++---- gnu/system/vm.scm | 2 ++ 4 files changed, 25 insertions(+), 20 deletions(-) (limited to 'gnu/system') diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 3bf3268b2..b2ed1a8b5 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -26,6 +26,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 ftw) #:use-module (guix build utils) + #:use-module (gnu build linux-modules) #:use-module (gnu build file-systems) #:export (mount-essential-file-systems linux-command-line @@ -34,7 +35,6 @@ configure-qemu-networking bind-mount - load-linux-module* device-number boot-system)) @@ -218,14 +218,6 @@ networking values.) Return #t if INTERFACE is up, #f otherwise." (logand (network-interface-flags sock interface) IFF_UP))) -(define (load-linux-module* file) - "Load Linux module from FILE, the name of a `.ko' file." - (define (slurp module) - ;; TODO: Use 'mmap' to reduce memory usage. - (call-with-input-file file get-bytevector-all)) - - (load-linux-module (slurp file))) - (define (device-number major minor) "Return the device number for the device with MAJOR and MINOR, for use as the last argument of `mknod'." @@ -332,16 +324,17 @@ bailing out.~%root contents: ~s~%" (scandir "/")) (define* (boot-system #:key (linux-modules '()) + linux-module-directory qemu-guest-networking? volatile-root? pre-mount (mounts '())) "This procedure is meant to be called from an initrd. Boot a system by -first loading LINUX-MODULES (a list of absolute file names of '.ko' files), -then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, -calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally -booting into the new root if any. The initrd supports kernel command-line -options '--load', '--root', and '--repl'. +first loading LINUX-MODULES (a list of module names) from +LINUX-MODULE-DIRECTORY, then setting up QEMU guest networking if +QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems +specified in MOUNTS, and finally booting into the new root if any. The initrd +supports kernel command-line options '--load', '--root', and '--repl'. Mount the root file system, specified by the '--root' command-line argument, if any. @@ -362,6 +355,10 @@ to it are lost." mounts) "ext4")) + (define (lookup-module name) + (string-append linux-module-directory "/" + (ensure-dot-ko name))) + (display "Welcome, this is GNU's early boot Guile.\n") (display "Use '--repl' for an initrd REPL.\n\n") @@ -376,7 +373,10 @@ to it are lost." (start-repl)) (display "loading kernel modules...\n") - (for-each load-linux-module* linux-modules) + (current-module-debugging-port (current-output-port)) + (for-each (cut load-linux-module* <> + #:lookup-module lookup-module) + (map lookup-module linux-modules)) (when qemu-guest-networking? (unless (configure-qemu-networking) diff --git a/gnu/system.scm b/gnu/system.scm index 8883d3e75..e1ed1a2f1 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -529,8 +529,10 @@ etc." (define %modules '((gnu build activation) (gnu build linux-boot) + (gnu build linux-modules) (gnu build file-systems) - (guix build utils))) + (guix build utils) + (guix elf))) (define (service-activations services) ;; Return the activation scripts for SERVICES. diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 71aba1e23..8129f9017 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -236,14 +236,15 @@ loaded at boot time in the order in which they appear." (boot-system #:mounts '#$(map file-system->spec file-systems) #:pre-mount (lambda () (and #$@device-mapping-commands)) - #:linux-modules (map (lambda (file) - (string-append #$kodir "/" file)) - '#$linux-modules) + #:linux-modules '#$linux-modules + #:linux-module-directory '#$kodir #:qemu-guest-networking? #$qemu-networking? #:volatile-root? '#$volatile-root?)) #:name "base-initrd" #:modules '((guix build utils) (gnu build linux-boot) - (gnu build file-systems))))) + (gnu build linux-modules) + (gnu build file-systems) + (guix elf))))) ;;; linux-initrd.scm ends here diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 07b13deec..33ca396eb 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -104,7 +104,9 @@ '((gnu build vm) (gnu build install) (gnu build linux-boot) + (gnu build linux-modules) (gnu build file-systems) + (guix elf) (guix build utils) (guix build store-copy))) (guile-for-build -- cgit v1.3 From d7e66f629525a670d1f4751b26c3d2e8e088eeb2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Nov 2014 00:03:08 +0100 Subject: linux-initrd: Remove now redundant module names. * gnu/system/linux-initrd.scm (base-initrd)[virtio-modules]: Remove "virtio.ko" and "virtio_ring.ko". [virtio-9p-modules]: Remove "fscache.ko" and "9pnet.ko". [linux-modules]: Remove "libahci.ko". --- gnu/system/linux-initrd.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 8129f9017..31a1c2e51 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -166,8 +166,7 @@ modules can be listed in EXTRA-MODULES. They will be added to the initrd, and loaded at boot time in the order in which they appear." (define virtio-modules ;; Modules for Linux para-virtualized devices, for use in QEMU guests. - '("virtio.ko" "virtio_ring.ko" "virtio_pci.ko" - "virtio_balloon.ko" "virtio_blk.ko" "virtio_net.ko")) + '("virtio_pci.ko" "virtio_balloon.ko" "virtio_blk.ko" "virtio_net.ko")) (define cifs-modules ;; Modules needed to mount CIFS file systems. @@ -175,7 +174,7 @@ loaded at boot time in the order in which they appear." (define virtio-9p-modules ;; Modules for the 9p paravirtualized file system. - '("fscache.ko" "9pnet.ko" "9p.ko" "9pnet_virtio.ko")) + '("9p.ko" "9pnet_virtio.ko")) (define (file-system-type-predicate type) (lambda (fs) @@ -183,7 +182,7 @@ loaded at boot time in the order in which they appear." (define linux-modules ;; Modules added to the initrd and loaded from the initrd. - `("libahci.ko" "ahci.ko" ;for SATA controllers + `("ahci.ko" ;for SATA controllers "pata_acpi.ko" "pata_atiixp.ko" ;for ATA controllers ,@(if (or virtio? qemu-networking?) virtio-modules -- cgit v1.3 From 08b1990a9368a5b33c13f6ec319b899c897822e7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Nov 2014 00:06:54 +0100 Subject: linux-initrd: Remove the ".ko" suffix from module names in 'base-initrd'. * gnu/system/linux-initrd.scm (base-initrd): Remove the .ko suffix from module names. --- gnu/system/linux-initrd.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 31a1c2e51..27e3f1940 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -166,15 +166,15 @@ modules can be listed in EXTRA-MODULES. They will be added to the initrd, and loaded at boot time in the order in which they appear." (define virtio-modules ;; Modules for Linux para-virtualized devices, for use in QEMU guests. - '("virtio_pci.ko" "virtio_balloon.ko" "virtio_blk.ko" "virtio_net.ko")) + '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net")) (define cifs-modules ;; Modules needed to mount CIFS file systems. - '("md4.ko" "ecb.ko" "cifs.ko")) + '("md4" "ecb" "cifs")) (define virtio-9p-modules ;; Modules for the 9p paravirtualized file system. - '("9p.ko" "9pnet_virtio.ko")) + '("9p" "9pnet_virtio")) (define (file-system-type-predicate type) (lambda (fs) @@ -182,8 +182,8 @@ loaded at boot time in the order in which they appear." (define linux-modules ;; Modules added to the initrd and loaded from the initrd. - `("ahci.ko" ;for SATA controllers - "pata_acpi.ko" "pata_atiixp.ko" ;for ATA controllers + `("ahci" ;for SATA controllers + "pata_acpi" "pata_atiixp" ;for ATA controllers ,@(if (or virtio? qemu-networking?) virtio-modules '()) @@ -194,7 +194,7 @@ loaded at boot time in the order in which they appear." virtio-9p-modules '()) ,@(if volatile-root? - '("fuse.ko") + '("fuse") '()) ,@extra-modules)) -- cgit v1.3 From 9cd0dfaa4654e49cd0af82993b91789cb3012354 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 29 Nov 2014 11:37:53 +0100 Subject: system: Change "en_US.UTF-8" to "en_US.utf8". * build-aux/hydra/demo-os.scm (locale): Change to "en_US.utf8". * gnu/system/install.scm (installation-os)[locale]: Ditto. --- build-aux/hydra/demo-os.scm | 2 +- gnu/system/install.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/build-aux/hydra/demo-os.scm b/build-aux/hydra/demo-os.scm index 9164500d7..d96cdce49 100644 --- a/build-aux/hydra/demo-os.scm +++ b/build-aux/hydra/demo-os.scm @@ -37,7 +37,7 @@ (operating-system (host-name "gnu") (timezone "Europe/Paris") - (locale "en_US.UTF-8") + (locale "en_US.utf8") (bootloader (grub-configuration (device "/dev/sda"))) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index d3d6764a7..01e79480b 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -221,7 +221,7 @@ Use Alt-F2 for documentation. (operating-system (host-name "gnu") (timezone "Europe/Paris") - (locale "en_US.UTF-8") + (locale "en_US.utf8") (bootloader (grub-configuration (device "/dev/sda"))) (file-systems -- cgit v1.3 From 3b09332adf7ce8e976a4d117a62c586a53af04aa Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 29 Nov 2014 14:40:26 +0100 Subject: system: Add a 'needed-for-boot?' field to 'mapped-device'. * gnu/system/file-systems.scm ()[needed-for-boot?]: New field. * gnu/system.scm (operating-system-user-mapped-devices, operating-system-boot-mapped-devices): Use it instead of trying to guess. Guessing doesn't work when one refers to a partition using its label, for instance. * doc/guix.texi (Mapped Devices): Document 'needed-for-boot?'. --- doc/guix.texi | 16 ++++++++++++---- gnu/system.scm | 17 ++++------------- gnu/system/file-systems.scm | 5 ++++- 3 files changed, 20 insertions(+), 18 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index aad201771..9aeec41f8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3837,19 +3837,27 @@ detailed below. Objects of this type represent device mappings that will be made when the system boots up. -@table @code -@item source +@table @asis +@item @code{source} This string specifies the name of the block device to be mapped, such as @code{"/dev/sda3"}. -@item target +@item @code{target} This string specifies the name of the mapping to be established. For example, specifying @code{"my-partition"} will lead to the creation of the @code{"/dev/mapper/my-partition"} device. -@item type +@item @code{type} This must be a @code{mapped-device-kind} object, which specifies how @var{source} is mapped to @var{target}. + +@item @code{needed-for-boot?} (default: @code{#f}) +This Boolean value indicates whether the device mapping must be made at +boot time---i.e., from the initial RAM disk, before any user file +systems are mounted. + +You would set it to @code{#t} for instance when the mapped device is +used by the root file system. @end table @end deftp diff --git a/gnu/system.scm b/gnu/system.scm index e1ed1a2f1..731f9de55 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -250,23 +250,14 @@ as 'needed-for-boot'." (define (operating-system-user-mapped-devices os) "Return the subset of mapped devices that can be installed in user-land--i.e., those not needed during boot." - (let ((devices (operating-system-mapped-devices os)) - (file-systems (operating-system-file-systems os))) - (filter (lambda (md) - (let ((user (mapped-device-user md file-systems))) - (or (not user) - (not (file-system-needed-for-boot? user))))) - devices))) + (remove mapped-device-needed-for-boot? + (operating-system-mapped-devices os))) (define (operating-system-boot-mapped-devices os) "Return the subset of mapped devices that must be installed during boot, from the initrd." - (let ((devices (operating-system-mapped-devices os)) - (file-systems (operating-system-file-systems os))) - (filter (lambda (md) - (let ((user (mapped-device-user md file-systems))) - (and user (file-system-needed-for-boot? user)))) - devices))) + (filter mapped-device-needed-for-boot? + (operating-system-mapped-devices os))) (define (device-mapping-services os) "Return the list of device-mapping services for OS as a monadic list." diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 476082184..356b4826b 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -45,6 +45,7 @@ mapped-device-source mapped-device-target mapped-device-type + mapped-device-needed-for-boot? mapped-device-kind mapped-device-kind? @@ -157,7 +158,9 @@ file system." mapped-device? (source mapped-device-source) ;string (target mapped-device-target) ;string - (type mapped-device-type)) ; + (type mapped-device-type) ; + (needed-for-boot? mapped-device-needed-for-boot? ;Boolean + (default #f))) (define-record-type* mapped-device-kind make-mapped-device-kind -- cgit v1.3 From 1cc8f3a63c4d229899720fbd552b3dd78346e198 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 30 Nov 2014 00:32:06 +0300 Subject: system: locale: Fix typo in docstring. * gnu/system/locale.scm (localedef-command): Fix typo. --- gnu/system/locale.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 9c5c4d2fd..17b1dead5 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -48,7 +48,7 @@ (define* (localedef-command locale #:key (libc (canonical-package glibc))) - "Return a gexp that runs 'localdef' from LIBC to build LOCALE." + "Return a gexp that runs 'localedef' from LIBC to build LOCALE." #~(begin (format #t "building locale '~a'...~%" #$(locale-definition-name locale)) -- cgit v1.3 From 9cb426b8bf91830c2df76f9285ed98f45265ecc4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 30 Nov 2014 17:50:07 +0100 Subject: Revert "system: Add a 'needed-for-boot?' field to 'mapped-device'." This reverts commit 3b09332adf7ce8e976a4d117a62c586a53af04aa, which turned out to be a bad idea because we need to have dependency information between the device-mapping service and the file-system service that uses it. --- doc/guix.texi | 16 ++++------------ gnu/system.scm | 17 +++++++++++++---- gnu/system/file-systems.scm | 5 +---- 3 files changed, 18 insertions(+), 20 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 53bfb293b..7c059b923 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3837,27 +3837,19 @@ detailed below. Objects of this type represent device mappings that will be made when the system boots up. -@table @asis -@item @code{source} +@table @code +@item source This string specifies the name of the block device to be mapped, such as @code{"/dev/sda3"}. -@item @code{target} +@item target This string specifies the name of the mapping to be established. For example, specifying @code{"my-partition"} will lead to the creation of the @code{"/dev/mapper/my-partition"} device. -@item @code{type} +@item type This must be a @code{mapped-device-kind} object, which specifies how @var{source} is mapped to @var{target}. - -@item @code{needed-for-boot?} (default: @code{#f}) -This Boolean value indicates whether the device mapping must be made at -boot time---i.e., from the initial RAM disk, before any user file -systems are mounted. - -You would set it to @code{#t} for instance when the mapped device is -used by the root file system. @end table @end deftp diff --git a/gnu/system.scm b/gnu/system.scm index 731f9de55..e1ed1a2f1 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -250,14 +250,23 @@ as 'needed-for-boot'." (define (operating-system-user-mapped-devices os) "Return the subset of mapped devices that can be installed in user-land--i.e., those not needed during boot." - (remove mapped-device-needed-for-boot? - (operating-system-mapped-devices os))) + (let ((devices (operating-system-mapped-devices os)) + (file-systems (operating-system-file-systems os))) + (filter (lambda (md) + (let ((user (mapped-device-user md file-systems))) + (or (not user) + (not (file-system-needed-for-boot? user))))) + devices))) (define (operating-system-boot-mapped-devices os) "Return the subset of mapped devices that must be installed during boot, from the initrd." - (filter mapped-device-needed-for-boot? - (operating-system-mapped-devices os))) + (let ((devices (operating-system-mapped-devices os)) + (file-systems (operating-system-file-systems os))) + (filter (lambda (md) + (let ((user (mapped-device-user md file-systems))) + (and user (file-system-needed-for-boot? user)))) + devices))) (define (device-mapping-services os) "Return the list of device-mapping services for OS as a monadic list." diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 356b4826b..476082184 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -45,7 +45,6 @@ mapped-device-source mapped-device-target mapped-device-type - mapped-device-needed-for-boot? mapped-device-kind mapped-device-kind? @@ -158,9 +157,7 @@ file system." mapped-device? (source mapped-device-source) ;string (target mapped-device-target) ;string - (type mapped-device-type) ; - (needed-for-boot? mapped-device-needed-for-boot? ;Boolean - (default #f))) + (type mapped-device-type)) ; (define-record-type* mapped-device-kind make-mapped-device-kind -- cgit v1.3 From a182e94e2535e13f8c18132ec461f5c8abd3e003 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Dec 2014 23:06:57 +0100 Subject: linux-initrd: Add the 'virtio_console' module for QEMU guests. * gnu/system/linux-initrd.scm (base-initrd)[virtio-modules]: Add "virtio_console". --- gnu/system/linux-initrd.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 27e3f1940..ee6ce4882 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -166,7 +166,8 @@ modules can be listed in EXTRA-MODULES. They will be added to the initrd, and loaded at boot time in the order in which they appear." (define virtio-modules ;; Modules for Linux para-virtualized devices, for use in QEMU guests. - '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net")) + '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net" + "virtio_console")) (define cifs-modules ;; Modules needed to mount CIFS file systems. -- cgit v1.3 From 4e2a21d3d2d72146059ad58b4832317990d37b24 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Fri, 5 Dec 2014 20:01:07 +0800 Subject: system: Cleanup bash startup files. * gnu/system.scm (etc-directory) (bashrc): Rename to 'profile'. * gnu/system/shadow.scm (default-skeletons): Rename '.bashrc' to '.bash_profile'. Don't source /etc/profile. --- gnu/system.scm | 15 +++++---------- gnu/system/shadow.scm | 13 +++++++++---- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system.scm b/gnu/system.scm index 899a16d6e..5cb6c9e94 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -386,11 +386,10 @@ This is the GNU system. Welcome.\n") (nsswitch (text-file "nsswitch.conf" "hosts: files dns\n")) - ;; TODO: Generate bashrc from packages' search-paths. - (bashrc (text-file* "bashrc" " -export PS1='\\u@\\h \\w\\$ ' - -export LC_ALL=\"" locale "\" + ;; Startup file for POSIX-compliant login shells, which set system-wide + ;; environment variables. + (profile (text-file* "profile" "\ +export LANG=\"" locale "\" export TZ=\"" timezone "\" export TZDIR=\"" tzdata "/share/zoneinfo\" @@ -399,11 +398,7 @@ export LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules export PATH=$HOME/.guix-profile/bin:/run/current-system/profile/bin export PATH=/run/setuid-programs:/run/current-system/profile/sbin:$PATH -export CPATH=$HOME/.guix-profile/include:" profile "/include -export LIBRARY_PATH=$HOME/.guix-profile/lib:" profile "/lib export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info -alias ls='ls -p --color' -alias ll='ls -l' ")) (skel (skeleton-directory skeletons))) (file-union "etc" @@ -416,7 +411,7 @@ alias ll='ls -l' ("nsswitch.conf" ,#~#$nsswitch) ("skel" ,#~#$skel) ("shells" ,#~#$shells) - ("profile" ,#~#$bashrc) + ("profile" ,#~#$profile) ("hosts" ,#~#$hosts-file) ("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/" #$timezone)) diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 6970021e1..4a2322bf6 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -115,9 +115,13 @@ (copy-file (car (find-files #$guile-wm "wm-init-sample.scm")) #$output))) - (mlet %store-monad ((bashrc (text-file "bashrc" "\ -# Allow non-login shells such as an xterm to get things right. -test -f /etc/profile && source /etc/profile\n")) + (mlet %store-monad ((profile (text-file "bash_profile" "\ +# Honor per-interactive-shell startup file +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\n")) + (bashrc (text-file "bashrc" "\ +PS1='\\u@\\h \\w\\$ ' +alias ls='ls -p --color' +alias ll='ls -l'\n")) (guile-wm (gexp->derivation "guile-wm" copy-guile-wm #:modules '((guix build utils)))) @@ -127,7 +131,8 @@ XTerm*metaSendsEscape: true\n")) (gdbinit (text-file "gdbinit" "\ # Tell GDB where to look for separate debugging files. set debug-file-directory ~/.guix-profile/lib/debug\n"))) - (return `((".bashrc" ,bashrc) + (return `((".bash_profile" ,profile) + (".bashrc" ,bashrc) (".Xdefaults" ,xdefaults) (".guile-wm" ,guile-wm) (".gdbinit" ,gdbinit))))) -- cgit v1.3 From 02f707c590fa3c5bbd74168468bf561b47317f71 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Fri, 5 Dec 2014 21:17:49 +0800 Subject: system: Add skeleton '.zlogin'. * gnu/system/shadow.scm (default-skeletons): Add .zlogin. --- gnu/system/shadow.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/system') diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 4a2322bf6..b4ba0060b 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -122,6 +122,9 @@ if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\n")) PS1='\\u@\\h \\w\\$ ' alias ls='ls -p --color' alias ll='ls -l'\n")) + (zlogin (text-file "zlogin" "\ +# Honor system-wide environment variables +source /etc/profile\n")) (guile-wm (gexp->derivation "guile-wm" copy-guile-wm #:modules '((guix build utils)))) @@ -133,6 +136,7 @@ XTerm*metaSendsEscape: true\n")) set debug-file-directory ~/.guix-profile/lib/debug\n"))) (return `((".bash_profile" ,profile) (".bashrc" ,bashrc) + (".zlogin" ,zlogin) (".Xdefaults" ,xdefaults) (".guile-wm" ,guile-wm) (".gdbinit" ,gdbinit))))) -- cgit v1.3 From 5c5e7bdafd38e2bed2c4e0b0f64fefb16855aded Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Dec 2014 17:18:05 +0100 Subject: vm: Use QEMU's standard VGA emulation by default. * gnu/system/vm.scm (common-qemu-options): Add "-vga std". --- gnu/system/vm.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 33ca396eb..437425653 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -472,7 +472,7 @@ with '-virtfs' options for the host file systems listed in SHARED-FS." " -enable-kvm -no-reboot -net nic,model=virtio \ " #$@(map virtfs-option shared-fs) " \ -net user \ - -serial stdio \ + -serial stdio -vga std \ -drive file=" #$image ",if=virtio,cache=writeback,werror=report,readonly \ -m 256")) -- cgit v1.3 From 6c777cf88c84c164e825f6e875bb4d2812892ed9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Dec 2014 21:28:12 +0100 Subject: system: Adjust 'grub.cfg' to work on systems with a separate /boot. Fixes . Reported by Nikita Karetnikov . * gnu/system/grub.scm (grub-configuration-file)[entry->gexp]: Add 'search --file --set'. (grub-configuration-file)[builder]: Remove 'search.file'. --- gnu/system/grub.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm index 00e09f973..76fde2089 100644 --- a/gnu/system/grub.scm +++ b/gnu/system/grub.scm @@ -209,11 +209,14 @@ entries corresponding to old generations of the system." (match-lambda (($ label linux arguments initrd) #~(format port "menuentry ~s { + # Set 'root' to the partition that contains the kernel. + search --file --set ~a/bzImage~% + linux ~a/bzImage ~a initrd ~a }~%" #$label - #$linux (string-join (list #$@arguments)) + #$linux #$linux (string-join (list #$@arguments)) #$initrd)))) (mlet %store-monad ((sugar (eye-candy config #~port))) @@ -223,14 +226,9 @@ entries corresponding to old generations of the system." #$sugar (format port " set default=~a -set timeout=~a -search.file ~a/bzImage~%" +set timeout=~a~%" #$(grub-configuration-default-entry config) - #$(grub-configuration-timeout config) - #$(any (match-lambda - (($ _ linux) - linux)) - all-entries)) + #$(grub-configuration-timeout config)) #$@(map entry->gexp all-entries) #$@(if (pair? old-entries) -- cgit v1.3 From ccc2678b0d43dd2c265502805312710b3f5d5459 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Dec 2014 22:15:01 +0100 Subject: system: grub: Make sure the font and background image are always found. * gnu/system/grub.scm (eye-candy): Add 'search --file --set'. --- gnu/system/grub.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm index 76fde2089..ecffee311 100644 --- a/gnu/system/grub.scm +++ b/gnu/system/grub.scm @@ -170,6 +170,9 @@ function load_video { insmod video_cirrus } +# Set 'root' to the partition that contains /gnu/store. +search --file --set ~a/share/grub/unicode.pf2 + if loadfont ~a/share/grub/unicode.pf2; then set gfxmode=640x480 load_video @@ -185,7 +188,7 @@ else set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi~%" - #$grub + #$grub #$grub #$image #$(theme-colors grub-theme-color-normal) #$(theme-colors grub-theme-color-highlight)))))) -- cgit v1.3