system: Factorize GRUB menu entry label.
* gnu/system.scm (kernel->grub-label): New procedure. (operating-system-grub.cfg): Use it.
This commit is contained in:
		
							parent
							
								
									7cd157e221
								
							
						
					
					
						commit
						2d23e6f051
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -486,6 +486,13 @@ we're running in the final root." | ||||||
|       ((initrd ((operating-system-initrd os) boot-file-systems))) |       ((initrd ((operating-system-initrd os) boot-file-systems))) | ||||||
|     (return #~(string-append #$initrd "/initrd")))) |     (return #~(string-append #$initrd "/initrd")))) | ||||||
| 
 | 
 | ||||||
|  | (define (kernel->grub-label kernel) | ||||||
|  |   "Return a label for the GRUB menu entry that boots KERNEL." | ||||||
|  |   (string-append "GNU system with " | ||||||
|  |                  (string-titlecase (package-name kernel)) " " | ||||||
|  |                  (package-version kernel) | ||||||
|  |                  " (technology preview)")) | ||||||
|  | 
 | ||||||
| (define (operating-system-grub.cfg os) | (define (operating-system-grub.cfg os) | ||||||
|   "Return the GRUB configuration file for OS." |   "Return the GRUB configuration file for OS." | ||||||
|   (mlet* %store-monad |   (mlet* %store-monad | ||||||
|  | @ -493,10 +500,7 @@ we're running in the final root." | ||||||
|        (root-fs ->  (operating-system-root-file-system os)) |        (root-fs ->  (operating-system-root-file-system os)) | ||||||
|        (kernel ->   (operating-system-kernel os)) |        (kernel ->   (operating-system-kernel os)) | ||||||
|        (entries ->  (list (menu-entry |        (entries ->  (list (menu-entry | ||||||
|                            (label (string-append |                            (label (kernel->grub-label kernel)) | ||||||
|                                    "GNU system with " |  | ||||||
|                                    (package-full-name kernel) |  | ||||||
|                                    " (technology preview)")) |  | ||||||
|                            (linux kernel) |                            (linux kernel) | ||||||
|                            (linux-arguments |                            (linux-arguments | ||||||
|                             (list (string-append "--root=" |                             (list (string-append "--root=" | ||||||
|  |  | ||||||
		Reference in a new issue