system: Optionally limit the entries returned by profile-grub-entries.
* guix/scripts/system.scm (profile-grub-entries): Add an optional parameter which allows the caller to limit the number of returned grub entries. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
45e39eee21
commit
aff7280a0b
|
@ -366,8 +366,10 @@ it atomically, and then run OS's activation script."
|
||||||
(date->string (time-utc->date time)
|
(date->string (time-utc->date time)
|
||||||
"~Y-~m-~d ~H:~M")))
|
"~Y-~m-~d ~H:~M")))
|
||||||
|
|
||||||
(define* (profile-grub-entries #:optional (profile %system-profile))
|
(define* (profile-grub-entries #:optional (profile %system-profile)
|
||||||
"Return a list of 'menu-entry' for the generations of PROFILE."
|
(numbers (generation-numbers profile)))
|
||||||
|
"Return a list of 'menu-entry' for the generations of PROFILE specified by
|
||||||
|
NUMBERS, which is a list of generation numbers."
|
||||||
(define (system->grub-entry system number time)
|
(define (system->grub-entry system number time)
|
||||||
(unless-file-not-found
|
(unless-file-not-found
|
||||||
(let* ((file (string-append system "/parameters"))
|
(let* ((file (string-append system "/parameters"))
|
||||||
|
@ -395,8 +397,7 @@ it atomically, and then run OS's activation script."
|
||||||
kernel-arguments))
|
kernel-arguments))
|
||||||
(initrd initrd)))))
|
(initrd initrd)))))
|
||||||
|
|
||||||
(let* ((numbers (generation-numbers profile))
|
(let* ((systems (map (cut generation-file-name profile <>)
|
||||||
(systems (map (cut generation-file-name profile <>)
|
|
||||||
numbers))
|
numbers))
|
||||||
(times (map (lambda (system)
|
(times (map (lambda (system)
|
||||||
(unless-file-not-found
|
(unless-file-not-found
|
||||||
|
|
Loading…
Reference in New Issue