bug-guix
[Top][All Lists]
Advanced

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

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


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

Heya Danny,

Danny Milosavljevic <address@hidden> skribis:

> On Thu, 14 Dec 2017 09:52:07 +0100
> address@hidden (Ludovic Courtès) wrote:
>
>> Hello!
>> 
>> AIUI this will solve lack of /dev/fuse at startup (among other things),
>> right?  I always wondered why it wasn’t showing up automatically.
>
> Yep.
>
> (The reason it works in other distros is because there's an executable 
> "systemd-tmpfiles" which does what I do in this patch, before udevd is 
> started)

OK.

>> Rather:
>> 
>>   (define (report-system-error . args)
>>     (let ((errno (system-error-errno args)))
>>       (format (current-error-port) "could not create…: ~a~%" (strerror 
>> errno))))
>> 
>>   (define-syntax-rule (catch-system-error exp)
>>     (catch 'system-error
>>       (lambda ()
>>         exp)
>>       report-system-error))
>
> I'd like this to include the file name in the error message.  I rather hate 
> UNIXoid error messages like "mknod: Permission denied" where it doesn't say 
> which arguments mknod had :P

Good point, and I agree!  In (guix ui) there’s a hack for that, but here
we could simply add a ‘file’ parameter to ‘report-system-error’ and
‘catch-system-error’ I suppose.

>> Could we read that directly instead of invoking ‘kmod’?
>
> Probably, but it would mean that we'd duplicate kmod and take up maintenance 
> of something extraneous.  We could do it - but what does it buy us?

The code would be slightly simpler (no pipe, etc.), and the .devname
file might be more stable than the kmod output, being a kernel
interface.

WDYT?

>> What about having a ‘static-device-nodes’ procedure that would parse
>> that and return a list of <device-node>, where:
>> 
>>   ;; TYPE is 'char or 'block, MAJOR and MINOR are integers.
>>   (define-record-type <device-node>
>>     (device-node name type major minor module)
>>     device-node?
>>     …)
>> 
>> and then:
>> 
>>   (define create-device-node
>>     (match-lambda
>>       (($ <device-node> name type major minor)
>>        (mknod …))))
>> 
>> finally:
>> 
>>   (for-each create-device-node (static-device-nodes))
>> 
>> ?
>
> The kmod format has entries not only for mknod but also for mkdir (it 
> actually mkdirs the same directory twice sometimes which is why there was 
> another version of this patch...).

OK, I had overlooked that.  Hopefully the general approach remains
valid?

Thank you,
Ludo’.





reply via email to

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