[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’.
- bug#22050: [PATCH v3 1/2] linux-boot: Add make-static-device-nodes., (continued)
bug#22050: [PATCH v4 0/2] Create static device nodes before starting udev., Danny Milosavljevic, 2017/12/14
bug#22050: [PATCH v5 0/2] Create static device nodes before starting udev., Danny Milosavljevic, 2017/12/14
bug#22050: [PATCH v5 2/2] services: base: Use make-static-device-nodes., Danny Milosavljevic, 2017/12/14
bug#22050: [PATCH v5 2/2] services: base: Use make-static-device-nodes., Ludovic Courtès, 2017/12/15
bug#22050: [PATCH v5 1/2] linux-boot: Add make-static-device-nodes., Danny Milosavljevic, 2017/12/14