diff --git a/gnu/system.scm b/gnu/system.scm index 476720b..874be43 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -47,6 +47,7 @@ #:use-module (gnu services shepherd) #:use-module (gnu services base) #:use-module (gnu system grub) + #:use-module (gnu system u-boot) #:use-module (gnu system shadow) #:use-module (gnu system nss) #:use-module (gnu system locale) @@ -89,11 +90,13 @@ operating-system-derivation operating-system-profile - operating-system-grub.cfg + operating-system-bootloader-configuration-file operating-system-etc-directory operating-system-locale-directory operating-system-boot-script + bootloader-configuration-device + boot-parameters boot-parameters? boot-parameters-label @@ -122,7 +125,7 @@ (default linux-libre)) (kernel-arguments operating-system-kernel-arguments (default '())) ; list of gexps/strings - (bootloader operating-system-bootloader) ; + (bootloader operating-system-bootloader) ; or (initrd operating-system-initrd ; (list fs) -> M derivation (default base-initrd)) @@ -695,8 +698,15 @@ listed in OS. The C library expects to find it under "Return the file system that contains the store of OS." (store-file-system (operating-system-file-systems os))) -(define* (operating-system-grub.cfg os #:optional (old-entries '())) - "Return the GRUB configuration file for OS. Use OLD-ENTRIES to populate the +(define (bootloader-configuration-device bootloader-configuration) + (match bootloader-configuration + ((? grub-configuration? config) + (grub-configuration-device config)) + ((? u-boot-configuration? config) + (u-boot-configuration-device config)))) + +(define* (operating-system-bootloader-configuration-file os #:optional (old-entries '())) + "Return the bootloader configuration file for OS. Use OLD-ENTRIES to populate the \"old entries\" menu." (mlet* %store-monad ((system (operating-system-derivation os)) @@ -716,13 +726,19 @@ listed in OS. The C library expects to find it under "/boot") (operating-system-kernel-arguments os))) (initrd #~(string-append #$system "/initrd")))))) - (grub-configuration-file (operating-system-bootloader os) - store-fs entries - #:old-entries old-entries))) + (match (operating-system-bootloader os) + ((? grub-configuration? config) + (grub-configuration-file config + store-fs entries + #:old-entries old-entries)) + ((? u-boot-configuration? config) + (u-boot-configuration-file config + store-fs entries + #:old-entries old-entries))))) (define (operating-system-parameters-file os) "Return a file that describes the boot parameters of OS. The primary use of -this file is the reconstruction of GRUB menu entries for old configurations." +this file is the reconstruction of bootloader menu entries for old configurations." (mlet %store-monad ((initrd (operating-system-initrd-file os)) (root -> (operating-system-root-file-system os)) (label -> (kernel->grub-label