From 9d449b945bbad5b7c66ed874b347f7f0ffd012e1 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Arruga Vivas Date: Mon, 21 Oct 2019 12:23:40 +0200 Subject: system: Add locale to boot-parameters. * gnu/system.scm (define-module)[export]: Add boot-parameters-locale. ()[locale]: New field. [boot-parameters-locale]: New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Provide operating-system locale to boot-parameters record. (opeating-system-boot-parameters-file): Likewise. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. * tests/boot-parameters.scm: New test file. --- gnu/system.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gnu') diff --git a/gnu/system.scm b/gnu/system.scm index 59dfeb99b4..e8fe41cc24 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Meiyo Peng +;;; Copyright © 2019 Miguel Ángel Arruga Vivas ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2020 Florian Pelz @@ -148,6 +149,7 @@ (define-module (gnu system) boot-parameters-bootloader-menu-entries boot-parameters-store-device boot-parameters-store-mount-point + boot-parameters-locale boot-parameters-kernel boot-parameters-kernel-arguments boot-parameters-initrd @@ -297,6 +299,7 @@ (define-record-type* boot-parameters-bootloader-menu-entries) (store-device boot-parameters-store-device) (store-mount-point boot-parameters-store-mount-point) + (locale boot-parameters-locale) (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) (initrd boot-parameters-initrd) @@ -374,6 +377,11 @@ (define device-sexp->device ((_ args) args) (#f '()))) + (locale + (match (assq 'locale rest) + ((_ locale) locale) + (#f #f))) + (store-device ;; Linux device names like "/dev/sda1" are not suitable GRUB device ;; identifiers, so we just filter them out. @@ -1284,6 +1292,7 @@ (define* (operating-system-boot-parameters os root-device (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) (store (operating-system-store-file-system os)) + (locale (operating-system-locale os)) (bootloader (bootloader-configuration-bootloader (operating-system-bootloader os))) (bootloader-name (bootloader-name bootloader)) @@ -1302,6 +1311,7 @@ (define* (operating-system-boot-parameters os root-device (bootloader-name bootloader-name) (bootloader-menu-entries (bootloader-configuration-menu-entries (operating-system-bootloader os))) + (locale locale) (store-device (ensure-not-/dev (file-system-device store))) (store-mount-point (file-system-mount-point store))))) @@ -1354,6 +1364,7 @@ (define* (operating-system-boot-parameters-file os (or (and=> (operating-system-bootloader os) bootloader-configuration-menu-entries) '()))) + (locale #$(boot-parameters-locale params)) (store (device #$(device->sexp (boot-parameters-store-device params))) -- cgit v1.2.3