GNU bug report logs - #31416
[PATCH 0/4] Generalize bootloader installer selection.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Fri, 11 May 2018 14:36:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: [bug#31416] [PATCH 2/4] bootloader: install-u-boot: Automatically select the correct installer.
Date: Sun, 13 May 2018 11:31:23 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> * gnu/bootloader/u-boot.scm (install-u-boot): Automatically select the correct
> installer.
> ---
>  gnu/bootloader/u-boot.scm | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
> index bc8f98f32..e0941c961 100644
> --- a/gnu/bootloader/u-boot.scm
> +++ b/gnu/bootloader/u-boot.scm
> @@ -41,7 +41,24 @@
>  (define install-u-boot
>    #~(lambda (bootloader device mount-point)
>        (if bootloader
> -        (error "Failed to install U-Boot"))))
> +        (let* ((config-file-name (string-append bootloader "/libexec/.config"))
> +               (soc (call-with-input-file config-file-name
> +                                          (let loop ((line (read-line port)))
> +                                            (if (not (eof-object? line))
> +                                                (let ((match
> +                                                       (string-match
> +                                                        "^CONFIG_SYS_SOC=\"([^\"]*)\""
> +                                                        line)))
> +                                                  (if match
> +                                                      (match:substring match 1)
> +                                                      (loop (read-line port))))
> +                                                #f)))))
> +          (match soc
> +           ("am33xx" (install-beaglebone-black-u-boot bootloader device mount-point))
> +           ("mx6" (install-imx-u-boot bootloader device mount-point))
> +           ("sunxi" (install-allwinner-u-boot bootloader device mount-point))
> +           (_ (error "Failed to install U-Boot (no installation method found)"
> +                     soc)))))))

Hmm ‘install-beaglebone-black-u-boot’ & co are not in the same stage
AFAICS; are you missing #$ escapes here?

Also we’re probably missing (ice-9 rdelim) and (ice-9 regex) as in the
build stage.

Last, isn’t it a bit hacky?  :-)  Previously every <bootloader> would
contain its installation method, so this was unambiguous, but now we’re
back to guessing what installation method to use.

Ludo’.




This bug report was last modified 1 year and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.