guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.


From: Maxim Cournoyer
Subject: [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
Date: Sun, 14 Jun 2020 14:56:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello Danny,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> Hi Maxim,
> Hi Stefan,
>
> On Thu, 11 Jun 2020 00:21:11 -0400
> Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> >   (define (device-string->file-system-device device-string)
>> >     ;; The "--root=SPEC" kernel command-line option always provides a
>> >     ;; string, but the string can represent a device, a UUID, a
>> >     ;; label or a NFS spec.  So check for all three.
>> >     (cond ((string-prefix? "/" device-string) device-string)
>> >           ((uuid device-string) => identity)
>> >           (else (file-system-label device-string))))
>> >
>> > But looking at the condition (uuid device-string) I have no idea what that 
>> > means,
>> > or is bound to!  
>> 
>> It means that if the device-string (a string as its name imply) contains
>> something that represent a UUID, return its corresponding UUID object.
>> `uuid' comes from (gnu system uuid).  Does that answer your question?
>
> Oh!  I've looked at now it but I still don't get it.

Perhaps the '=>' syntax is the reason why? The the Guile Reference info
manual defines it as such:

     For the ‘=>’ clause type, EXPRESSION is
     evaluated and the resulting procedure is applied to the value of
     TEST.  The result of this procedure application is then the result
     of the ‘cond’-expression.

(uuid device-string) returns either #f or a uuid object.  So applying
the identity function to a uuid object yields that same object.

HTH!

Maxim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]