bug-guix
[Top][All Lists]
Advanced

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

bug#22050: [PATCH v4 1/2] linux-boot: Add make-static-device-nodes.


From: Ludovic Courtès
Subject: bug#22050: [PATCH v4 1/2] linux-boot: Add make-static-device-nodes.
Date: Fri, 15 Dec 2017 23:37:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Danny Milosavljevic <address@hidden> skribis:

> Hi Ludo,
>
> On Fri, 15 Dec 2017 10:41:37 +0100
> address@hidden (Ludovic Courtès) wrote:
>
>> This looks good, but would it be enough to do:
>> 
>>   (mkdir-p (dirname (string-append "/dev/" name)))
>
> mkdir permission needs to be specified to be #o755.
>
> I've seen some variants in guix - but they are all buried somewhere deep:
>
> ./gnu/services/cups.scm:        (define (mkdir-p/perms directory owner perms)
> ./gnu/services/dns.scm:      (define (mkdir-p/perms directory owner perms)
> ./gnu/services/mail.scm:      (define (mkdir-p/perms directory owner perms)
> ./guix/build/utils.scm:(define (mkdir-p dir)
> ./guix/build/graft.scm:(define* (mkdir-p* dir #:optional (mode #o755))

Oh, I didn’t think we had this many variants.

> I don't feel good relying on magical unspecified permissions in code required 
> to boot the system.  I think mkdir-p itself subtracts the umask or something. 
>  Is the umask guaranteed to be 0 at the point of usage of 
> make-static-device-nodes ?

I’m not 100% sure.  You could set ‘umask’ explicitly given that it’s
single-threaded and all at this point, but it’s probably clearer to
explicitly specify the mode like you did initially.

So I guess you can forget my comment and apply the original variant (or
perhaps explicitly copy ‘mkdir-p/perms’ so we can find it more easily
when we factorize!).

Thanks for explaining!

Ludo’.





reply via email to

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