Opened 15 years ago

Closed 13 years ago

#6137 closed defect (Fixed)

udevinfo has been replaced by 'udevadm info'

Reported by: stuartm Owned by: beirdo
Priority: minor Milestone: 0.25
Component: MythTV - MythSystem Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

It appears that in newer versions of udev, udevinfo no longer exists breaking MediaMonitorUnix::GetDeviceFile?().

I'm told that it has been replaced by "udevadm info" but at least on Mandriva that is restricted to root.

Attachments (3)

mythtv-libudev.patch (3.0 KB) - added by manuel@… 14 years ago.
Patch to use libudev instead of udevinfo
mythtv-libudev-1.patch (3.0 KB) - added by manuel@… 14 years ago.
New patch with correct conditional in configure
40_libudev.patch (2.6 KB) - added by Daviey 14 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 15 years ago by Andreas <miscdreas@…>

on openSUSE 11.1, udevadm is located in /sbin, but can be run by everyone:

hal9004:~ # dir /sbin/udev* -rwxr-xr-x 1 root root 113824 Dec 3 02:29 /sbin/udevadm -rwxr-xr-x 1 root root 101544 Dec 3 02:29 /sbin/udevd lrwxrwxrwx 1 root root 7 Jan 2 02:31 /sbin/udevsettle -> udevadm

comment:2 Changed 15 years ago by Nigel

(In [20009]) Work around missing udevinfo binary. See #6137

comment:3 Changed 15 years ago by Nigel

Priority: criticalminor
Severity: highmedium

On machines that have a root-only udevadm, it isn't really possible to use that tool to check the device. On others, commands like 'udevadm info -q name -rp /block/sdb/sdb1' do the right thing, but I don't really want to try udevinfo, then udevadm, then whatever tool the next 2 versions of the hotplug tools uses?
It is probably possible to parse one of the files under /sys/block/* to get the name, but I haven't found the file/field yet.
For now I'm hoping that the current hack is good enough. That may fail for people with tricky hotplug setups, but if that happens, I can get the config and a tar of their /sys/block/* ?

comment:4 Changed 15 years ago by stuartm

Is there not a proper udev lib and api we can use instead of calling on those applications or digging around /sys? What about HAL and DBus now that QT4 has a dbus module? http://doc.trolltech.com/4.4/intro-to-dbus.html?

comment:5 Changed 15 years ago by Nigel

Milestone: 0.22unknown

comment:6 Changed 15 years ago by stuartm

Component: mythtvMythTV - General

comment:7 Changed 14 years ago by JohnnyJboss <johnnyjboss@…>

What config are you asking for?

I can tar up my /sys/block/*

I'm seeing the issue at http://svn.mythtv.org/trac/ticket/7135 and I've hacked it to not present these defunct processes by symlinking /sbin/udevinfo --> /sbin/udevadm - which as I understand doesn't actually allow udevadm to return the correct data, it should be a wrapper script to call 'udevadm info $1' or something like that.

I think it's interesting that the zombie pids disappear just because there's something present at udevinfo, even if it's not possibly returning the correct information when called.

I'm happy to help test / debug - let me know.

Mythbuntu 9.10

comment:8 Changed 14 years ago by anonymous

create as udevinfo, chmod it +x when done

#!/bin/bash udevadm info $1 $2 $3 $4 $5 $6 $7 $8 $9 $10

comment:9 Changed 14 years ago by Tom Dexter <digitalaudiorock@…>

You can actually just make that udevinfo script do:

/sbin/udevadm info $@

Changed 14 years ago by manuel@…

Attachment: mythtv-libudev.patch added

Patch to use libudev instead of udevinfo

comment:10 Changed 14 years ago by manuel@…

I've just attached a patch that uses libudev to get the information instead of calling udevinfo.

Changed 14 years ago by manuel@…

Attachment: mythtv-libudev-1.patch added

New patch with correct conditional in configure

comment:11 Changed 14 years ago by Daviey

Updated patch with -ludev to the library check.

Changed 14 years ago by Daviey

Attachment: 40_libudev.patch added

comment:12 Changed 14 years ago by Nigel

Status: newaccepted

Well, my newest installed OS still doesn't have a usable libudev:

% cat config.ep
...

BEGIN /tmp/mythtv_conf.JCLnO0SL.c
    1	
    2	#include <libudev.h>
    3	int main(int argc, char **argv){
    4	    return (long) udev_new;
    5	}
END /tmp/mythtv_conf.JCLnO0SL.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -std=c99 -f
omit-frame-pointer -c -o /tmp/mythtv_conf.IrN6GgEI.o /tmp/mythtv_conf.JCLnO0SL.c
In file included from /tmp/mythtv_conf.JCLnO0SL.c:2:
/usr/include/libudev.h:28:2: error: #error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is n
eeded to use this experimental library version"

so this is still untested, but apart from the linux guard in configure that I don't think is needed, it all looks very good.

comment:13 Changed 14 years ago by Nigel

Resolution: fixed
Status: acceptedclosed

(In [25304]) On Linux, use libudev, instead of udevinfo command. Another dependence, but I don't think packagers will care. Untested by me. Thanks Manual. Closes #6137.

comment:14 Changed 13 years ago by Paul <paul@…>

I'm still seeing msg in my output I found a reference in libmyth/mediamontior-unix.cpp

MMUnix::GetDeviceFile?(/sys/block/sr0) - udevinfo error... the program '/usr/bin/mythfrontend' called 'udevinfo', it should use 'udevadm info <options>', this will stop working in a future release

comment:15 Changed 13 years ago by beirdo

Resolution: fixed
Status: closednew

comment:16 Changed 13 years ago by beirdo

Owner: changed from Nigel to beirdo
Status: newassigned

Will rework this as part of the myth_system rewrite since we are modifying that section of code anyways.

comment:17 Changed 13 years ago by beirdo

Component: MythTV - GeneralMythTV - MythSystem

comment:18 Changed 13 years ago by beirdo

Milestone: unknown0.25
Resolution: Fixed
Status: assignedclosed

This has been fixed by the merge of mythsystem-rewrite branch.

Note: See TracTickets for help on using tickets.