GNU bug report logs - #29409
GuixSD ARM port.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>

Date: Thu, 23 Nov 2017 09:46:01 UTC

Severity: normal

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


Message #135 received at 29409 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 29409 <at> debbugs.gnu.org
Subject: Re: [bug#29409] [PATCH] build: utils: Introduce dd.
Date: Mon, 04 Dec 2017 15:43:39 +0100
Mathieu Othacehe <m.othacehe <at> gmail.com> skribis:

>> Granted, that’s a bit more verbose, but it’s also very lightweight
>> compared to using ‘dd’.
>
> Here's a new implementation, using your snippet. I tested it with
> "installed-extlinux-os", it seems ok.
>
> Mathieu
>
> From 742662ceec2a40d664520f01977ddc4cbe64d369 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe <at> gmail.com>
> Date: Fri, 1 Dec 2017 14:09:38 +0100
> Subject: [PATCH] bootloader: extlinux: Stop using dd binary.
>
> * gnu/bootloader/extlinux.scm (dd): Remove it,
> (install-extlinux): replace dd call by Guile I/O procedures.
> * gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to module-closure
> and used-modules list to provide "get-bytevector-n" and "put-bytevector".
> * guix/scripts/system.scm (bootloader-installer-derivation): Ditto.

Nice!

> +        (unless
> +            (and (zero? (system* extlinux "--install" install-dir))
> +                 (call-with-input-file (string-append syslinux-dir "/" #$mbr)
> +                   (lambda (input)
> +                     (let ((bv (get-bytevector-n input 440))
> +                           (output (open-file device "wb0")))
> +                       (put-bytevector output bv)
> +                       (close-port output)))))

I think you can use ‘call-with-output-file’ for DEVICE no?

> --- a/gnu/system/vm.scm
> +++ b/gnu/system/vm.scm
> @@ -274,11 +274,13 @@ the image."
>    (expression->derivation-in-linux-vm
>     name
>     (with-imported-modules (source-module-closure '((gnu build vm)
> -                                                   (guix build utils)))
> +                                                   (guix build utils)
> +                                                   (ice-9 binary-ports)))

No: this would import the host Guile’s (ice-9 binary-ports) module into
the guest, thereby making the result dependent on the Guile version
being used “outside”.

>       #~(begin
>           (use-modules (gnu build vm)
>                        (guix build utils)
> -                      (srfi srfi-26))
> +                      (srfi srfi-26)
> +                      (ice-9 binary-ports))

This yes.

>           (let ((inputs
>                  '#$(append (list qemu parted e2fsprogs dosfstools)
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index 91d151d..5116b82 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -674,9 +674,11 @@ any, are available.  Raise an error if they're not."
>  and TARGET arguments."
>    (with-monad %store-monad
>      (gexp->file "bootloader-installer"
> -                (with-imported-modules '((guix build utils))
> +                (with-imported-modules '((guix build utils)
> +                                         (ice-9 binary-ports))

No.

>                    #~(begin
> -                      (use-modules (guix build utils))
> +                      (use-modules (guix build utils)
> +                                   (ice-9 binary-ports))

OK.

Could you send an updated patch?

Thanks!

Ludo’.




This bug report was last modified 7 years and 107 days ago.

Previous Next


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