unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 22050@debbugs.gnu.org
Subject: bug#22050: [PATCH v3 1/2] linux-boot: Add make-static-device-nodes.
Date: Thu, 14 Dec 2017 14:14:09 +0100	[thread overview]
Message-ID: <87o9n1qwny.fsf@gnu.org> (raw)
In-Reply-To: <20171214113230.78990529@scratchpost.org> (Danny Milosavljevic's message of "Thu, 14 Dec 2017 11:32:30 +0100")

Heya Danny,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> On Thu, 14 Dec 2017 09:52:07 +0100
> ludo@gnu.org (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	other threads:[~2017-12-14 13:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 11:36 bug#22050: fuse.ko not automatically loaded on GuixSD Ludovic Courtès
2017-12-13 22:04 ` bug#22050: [PATCH 0/2] Create static device nodes before starting udev Danny Milosavljevic
2017-12-13 22:05   ` bug#22050: [PATCH 1/2] linux-boot: Add make-static-device-nodes Danny Milosavljevic
2017-12-13 22:05     ` bug#22050: [PATCH 2/2] services: base: Use make-static-device-nodes Danny Milosavljevic
2017-12-13 22:17   ` bug#22050: [PATCH v2 0/2] Create static device nodes before starting udev Danny Milosavljevic
2017-12-13 22:17     ` bug#22050: [PATCH v2 1/2] linux-boot: Add make-static-device-nodes Danny Milosavljevic
2017-12-13 22:17     ` bug#22050: [PATCH v2 2/2] services: base: Use make-static-device-nodes Danny Milosavljevic
2017-12-13 22:32   ` bug#22050: [PATCH v3 0/2] Create static device nodes before starting udev Danny Milosavljevic
2017-12-13 22:32     ` bug#22050: [PATCH v3 1/2] linux-boot: Add make-static-device-nodes Danny Milosavljevic
2017-12-14  8:52       ` Ludovic Courtès
2017-12-14 10:32         ` Danny Milosavljevic
2017-12-14 13:14           ` Ludovic Courtès [this message]
2017-12-14 18:21             ` Danny Milosavljevic
2017-12-13 22:32     ` bug#22050: [PATCH v3 2/2] services: base: Use make-static-device-nodes Danny Milosavljevic
2017-12-14 19:56     ` bug#22050: [PATCH v4 0/2] Create static device nodes before starting udev Danny Milosavljevic
2017-12-14 19:56       ` bug#22050: [PATCH v4 1/2] linux-boot: Add make-static-device-nodes Danny Milosavljevic
2017-12-15  9:41         ` Ludovic Courtès
2017-12-15 17:27           ` Danny Milosavljevic
2017-12-15 22:37             ` Ludovic Courtès
2017-12-14 19:56       ` bug#22050: [PATCH v4 2/2] services: base: Use make-static-device-nodes Danny Milosavljevic
2017-12-14 21:25       ` bug#22050: [PATCH v5 0/2] Create static device nodes before starting udev Danny Milosavljevic
2017-12-14 21:25         ` bug#22050: [PATCH v5 1/2] linux-boot: Add make-static-device-nodes Danny Milosavljevic
2017-12-14 21:25         ` bug#22050: [PATCH v5 2/2] services: base: Use make-static-device-nodes Danny Milosavljevic
2017-12-15  9:44           ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o9n1qwny.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=22050@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).