Subject: Re: bug#31159: Reverse order for old grub.cfg entries

From: Mark H Weaver <[email-masked]>
Date: Tue, 17 Apr 2018 14:18:52 -0400

Mathieu Othacehe <[email-masked]> writes:

> This seems like a good idea ! If we decide to make it unconditional the
> patch attached does the job. We can also make it configurable in
> bootloader-configuration for instance.
>
> WDYT ?

Thank you, Mathieu!  I doubt that there's a need to make this
configurable, but I'd like to hear an opinion from Ludovic, since I
guess he was the one who implemented the current ordering.

What do you think, Ludovic?

      Mark

> From 3ec63fb55a074b547724c70d560cc61776c9298e Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <[email-masked]>
> Date: Tue, 17 Apr 2018 09:23:00 +0200
> Subject: [PATCH] scripts: system: Sort profile generations in reverse order.
>
> * guix/scripts/system.scm (profile-boot-parameters): Reverse
> generation-numbers list. This allows old generations to be listed from most
> recent to oldest in bootloaders configuration files.
> ---
>  guix/scripts/system.scm | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index b50cabc..7e1363c 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -393,9 +393,11 @@ it atomically, and then run OS's activation script."
>                    "~Y-~m-~d ~H:~M")))
>  
>  (define* (profile-boot-parameters #:optional (profile %system-profile)
> -                                  (numbers (generation-numbers profile)))
> -  "Return a list of 'boot-parameters' for the generations of PROFILE specified by
> -NUMBERS, which is a list of generation numbers."
> +                                  (numbers
> +                                   (reverse (generation-numbers profile))))
> +  "Return a list of 'boot-parameters' for the generations of PROFILE specified
> +by NUMBERS, which is a list of generation numbers. The list is ordered from
> +the most recent to the oldest profiles."
>    (define (system->boot-parameters system number time)
>      (unless-file-not-found
>       (let* ((params           (read-boot-parameters-file system))