:: Re: [Dng] libsysdev preview
Top Pagina
Delete this message
Reply to this message
Auteur: karl
Datum:  
Aan: dng
Onderwerp: Re: [Dng] libsysdev preview
Isaac Dunham:
> On Sun, Jan 18, 2015 at 01:11:15PM +0100, karl@??? wrote:

...
> > Mesa uses the name sysfs, which might be better than sysdev.
> > The following two might be a good start:
> >
> > $ grep ^sysfs src/loader/loader.c
> > sysfs_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
> > sysfs_get_device_name_for_fd(int fd)
> >
> > and
> >
> > dev_node_from_fd(int fd, unsigned int *maj, unsigned int *min)

...
> Optimally, the API will be simple enough that developers then say
> "And why aren't we using this *instead* of libudev?"


If I get some time over I'd like to try replacing mesa's routines with
libsysdev.

...
> There's a basic example at util/devinfo.c, and the header has comments
> tersely explaining what inputs each function takes.


devinfo doesn't handle partitions ?

$ devinfo /dev/sda
/sys//devices/pci0000:00/0000:00:13.1/0000:03:06.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/device
$ devinfo /dev/sda1
$

...
> It builds with "make" (no ./configure).
> It will build and install into /usr/{bin,lib,include} by default.


You can use:

PREFIX=/usr/local make
PREFIX=/usr/local make install

or similar to make it install in your preferred dir.

> On debian, devuan, and related distros, you will need to install with:
> make LIBDIR="/usr/lib/$TRIPLET" install
> On non-pure64 64-bit installs of other distros, you will need to set
> LIBDIR to point to the appropriate directory (lib32 or lib64).


Works fine on a pure 32-bit debian.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57