Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

...and scantily clad females, of course. Who cares if it's below zero outside. -- Linus Torvalds


devel / comp.arch.embedded / Re: Udev-based serial number dependent symlinks for PCIe UIO devices

SubjectAuthor
* Re: Udev-based serial number dependent symlinks for PCIe UIO devicesTheo
`* Re: Udev-based serial number dependent symlinks for PCIe UIO devicesDon Y
 `- Re: Udev-based serial number dependent symlinks for PCIe UIO devicesWojciech Zabolotny

1
Re: Udev-based serial number dependent symlinks for PCIe UIO devices

<Aqf*Tmtky@news.chiark.greenend.org.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=463&group=comp.arch.embedded#463

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!news.niel.me!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED!not-for-mail
From: theom+news@chiark.greenend.org.uk (Theo)
Newsgroups: comp.arch.embedded
Subject: Re: Udev-based serial number dependent symlinks for PCIe UIO devices
Date: 19 May 2021 09:30:46 +0100 (BST)
Organization: University of Cambridge, England
Lines: 27
Message-ID: <Aqf*Tmtky@news.chiark.greenend.org.uk>
References: <3105b67e-544d-476f-89e1-89bd2b6fb77dn@googlegroups.com> <s8239g$fc8$1@dont-email.me>
NNTP-Posting-Host: chiark.greenend.org.uk
X-Trace: chiark.greenend.org.uk 1621413048 2818 212.13.197.229 (19 May 2021 08:30:48 GMT)
X-Complaints-To: abuse@chiark.greenend.org.uk
NNTP-Posting-Date: Wed, 19 May 2021 08:30:48 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/3.16.0-7-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Wed, 19 May 2021 08:30 UTC

Don Y <blockedofcourse@foo.invalid> wrote:
> Can't you adjust the kernel configuration so that it forces
> certain probes to yield certain "devices"?
>
> E.g., instead of letting NetBSD probe disk drives in whatever order
> it encounters them -- and assigning device names in that order -- I
> build my kernels so certain device names are set aside for specific
> devices (which may or may not be present at any given boot).

That's what udev does. udev has a set of rules that indicate how devices
should be turned into device nodes, be it by physical location (PCI slot),
vendor/product ID, serial number, etc. It also sets ownership and
permissions of those device nodes (so only certain users can access a
device node). It handles creating and removing device nodes as devices are
hot plugged. It's all just some textual config files, no kernel compilation
needed.

The problem in this case is that PCI devices don't as standard support a
serial number in the way that USB or SATA does, and so this manufacturer has
done their own thing in the way the serial number is embedded. That is why
some helper code is needed to expose the serial number to udev to use in its
device naming.

(although I would have expected a rule that sets up device nodes named by
PCI slot to be equally predictable)

Theo

Re: Udev-based serial number dependent symlinks for PCIe UIO devices

<s82jjh$9q6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=464&group=comp.arch.embedded#464

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: blockedofcourse@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Udev-based serial number dependent symlinks for PCIe UIO devices
Date: Wed, 19 May 2021 01:51:45 -0700
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <s82jjh$9q6$1@dont-email.me>
References: <3105b67e-544d-476f-89e1-89bd2b6fb77dn@googlegroups.com>
<s8239g$fc8$1@dont-email.me> <Aqf*Tmtky@news.chiark.greenend.org.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 19 May 2021 08:52:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="267984be5faaebda6c34f798e9856c05";
logging-data="10054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1ukfG6ChLEK9HNSyu7VQR"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.1.1
Cancel-Lock: sha1:DuOYjIE81nvSnr/tRnI3dfqLwRM=
In-Reply-To: <Aqf*Tmtky@news.chiark.greenend.org.uk>
Content-Language: en-US
 by: Don Y - Wed, 19 May 2021 08:51 UTC

On 5/19/2021 1:30 AM, Theo wrote:
> Don Y <blockedofcourse@foo.invalid> wrote:
>> Can't you adjust the kernel configuration so that it forces
>> certain probes to yield certain "devices"?
>>
>> E.g., instead of letting NetBSD probe disk drives in whatever order
>> it encounters them -- and assigning device names in that order -- I
>> build my kernels so certain device names are set aside for specific
>> devices (which may or may not be present at any given boot).
>
> That's what udev does. udev has a set of rules that indicate how devices
> should be turned into device nodes, be it by physical location (PCI slot),
> vendor/product ID, serial number, etc. It also sets ownership and
> permissions of those device nodes (so only certain users can access a
> device node).

OK. In NetBSD, that's part of the kernel configuration.
Things like permissions and device types (char vs block)
are handled in reasonably static files:

---------
device-major ccd char 300 block 300 ccd
device-major vnd char 301 block 301 vnd
device-major md char 302 block 302 md
device-major ld char 303 block 303 ld
device-major raid char 304 block 304 raid
device-major cgd char 305 block 305 cgd

# scsibus and its children
device-major scsibus char 310 scsibus
device-major sd char 311 block 311 sd
device-major st char 312 block 312 st
device-major cd char 313 block 313 cd
device-major ch char 314 ch
device-major ss char 315 ss
device-major uk char 316 uk
device-major ses char 317 ses
device-major se char 318 se

device-major fd char 320 block 320 fdc
....
device-major com char 260 com
device-major lpt char 261 lpt
....
-------

while the binding of device identifiers is part of the "config"
file:

------
# SCSI devices
sd* at scsibus? target ? lun ? # SCSI disk drives
st* at scsibus? target ? lun ? # SCSI tape drives
cd* at scsibus? target ? lun ? # SCSI CD-ROM drives
ch* at scsibus? target ? lun ? # SCSI autochangers
ses* at scsibus? target ? lun ? # SCSI Enclosure Services devices
ss* at scsibus? target ? lun ? # SCSI scanners
uk* at scsibus? target ? lun ? # SCSI unknown
----

E.g., in the above, I could ensure sd3 was always a particular
device on a particular scsibus at a particular SCSI ID by
creating an entry with the various wildcards (? *) replaced
by specific values. The probe will preallocate those so
they aren't assigned to some other device that happened
to be Nth in order of detection.

> It handles creating and removing device nodes as devices are
> hot plugged. It's all just some textual config files, no kernel compilation
> needed.
>
> The problem in this case is that PCI devices don't as standard support a
> serial number in the way that USB or SATA does, and so this manufacturer has
> done their own thing in the way the serial number is embedded. That is why
> some helper code is needed to expose the serial number to udev to use in its
> device naming.

Ah. I'd have thought an alternative would just be to ensure devices
of that specific *type* (manufacturer) were probed in an order that
could be enforced by the equivalent of the scheme I mentioned above.

> (although I would have expected a rule that sets up device nodes named by
> PCI slot to be equally predictable)

I guess one unanswered question is whether Wojciech is bolting his solution
onto an existing system *or* designing a system from scratch (in which case,
you would assume he could exercise some control over how the hardware is
"built"/pieced together)

Re: Udev-based serial number dependent symlinks for PCIe UIO devices

<1f482843-f180-445a-8b33-c9bede407b08n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=465&group=comp.arch.embedded#465

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:a0c:ef45:: with SMTP id t5mr12157781qvs.26.1621418395784;
Wed, 19 May 2021 02:59:55 -0700 (PDT)
X-Received: by 2002:a25:6f85:: with SMTP id k127mr14712397ybc.270.1621418395449;
Wed, 19 May 2021 02:59:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Wed, 19 May 2021 02:59:55 -0700 (PDT)
In-Reply-To: <s82jjh$9q6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=95.160.103.141; posting-account=9fBPtgoAAADEI8zwcnuogZ04nxC8bclF
NNTP-Posting-Host: 95.160.103.141
References: <3105b67e-544d-476f-89e1-89bd2b6fb77dn@googlegroups.com>
<s8239g$fc8$1@dont-email.me> <Aqf*Tmtky@news.chiark.greenend.org.uk> <s82jjh$9q6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1f482843-f180-445a-8b33-c9bede407b08n@googlegroups.com>
Subject: Re: Udev-based serial number dependent symlinks for PCIe UIO devices
From: wzab01@gmail.com (Wojciech Zabolotny)
Injection-Date: Wed, 19 May 2021 09:59:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5369
 by: Wojciech Zabolotny - Wed, 19 May 2021 09:59 UTC

środa, 19 maja 2021 o 10:52:06 UTC+2 Don Y napisał(a):
> On 5/19/2021 1:30 AM, Theo wrote:
> > Don Y <blocked...@foo.invalid> wrote:
> >> Can't you adjust the kernel configuration so that it forces
> >> certain probes to yield certain "devices"?
> >>
> >> E.g., instead of letting NetBSD probe disk drives in whatever order
> >> it encounters them -- and assigning device names in that order -- I
> >> build my kernels so certain device names are set aside for specific
> >> devices (which may or may not be present at any given boot).
> >
> > That's what udev does. udev has a set of rules that indicate how devices
> > should be turned into device nodes, be it by physical location (PCI slot),
> > vendor/product ID, serial number, etc. It also sets ownership and
> > permissions of those device nodes (so only certain users can access a
> > device node).
> OK. In NetBSD, that's part of the kernel configuration.
> Things like permissions and device types (char vs block)
> are handled in reasonably static files:
>
> ---------
> device-major ccd char 300 block 300 ccd
> device-major vnd char 301 block 301 vnd
> device-major md char 302 block 302 md
> device-major ld char 303 block 303 ld
> device-major raid char 304 block 304 raid
> device-major cgd char 305 block 305 cgd
>
> # scsibus and its children
> device-major scsibus char 310 scsibus
> device-major sd char 311 block 311 sd
> device-major st char 312 block 312 st
> device-major cd char 313 block 313 cd
> device-major ch char 314 ch
> device-major ss char 315 ss
> device-major uk char 316 uk
> device-major ses char 317 ses
> device-major se char 318 se
>
> device-major fd char 320 block 320 fdc
> ...
> device-major com char 260 com
> device-major lpt char 261 lpt
> ...
> -------
>
> while the binding of device identifiers is part of the "config"
> file:
>
> ------
> # SCSI devices
> sd* at scsibus? target ? lun ? # SCSI disk drives
> st* at scsibus? target ? lun ? # SCSI tape drives
> cd* at scsibus? target ? lun ? # SCSI CD-ROM drives
> ch* at scsibus? target ? lun ? # SCSI autochangers
> ses* at scsibus? target ? lun ? # SCSI Enclosure Services devices
> ss* at scsibus? target ? lun ? # SCSI scanners
> uk* at scsibus? target ? lun ? # SCSI unknown
> ----
>
> E.g., in the above, I could ensure sd3 was always a particular
> device on a particular scsibus at a particular SCSI ID by
> creating an entry with the various wildcards (? *) replaced
> by specific values. The probe will preallocate those so
> they aren't assigned to some other device that happened
> to be Nth in order of detection.
> > It handles creating and removing device nodes as devices are
> > hot plugged. It's all just some textual config files, no kernel compilation
> > needed.
> >
> > The problem in this case is that PCI devices don't as standard support a
> > serial number in the way that USB or SATA does, and so this manufacturer has
> > done their own thing in the way the serial number is embedded. That is why
> > some helper code is needed to expose the serial number to udev to use in its
> > device naming.
> Ah. I'd have thought an alternative would just be to ensure devices
> of that specific *type* (manufacturer) were probed in an order that
> could be enforced by the equivalent of the scheme I mentioned above.
> > (although I would have expected a rule that sets up device nodes named by
> > PCI slot to be equally predictable)
> I guess one unanswered question is whether Wojciech is bolting his solution
> onto an existing system *or* designing a system from scratch (in which case,
> you would assume he could exercise some control over how the hardware is
> "built"/pieced together)

The end user wants to be able to run it on standard Debian GNU/Linux OS.

BR,
Wojtek


devel / comp.arch.embedded / Re: Udev-based serial number dependent symlinks for PCIe UIO devices

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor