diff mbox series

[v2] tvheadend: add dependency on udev

Message ID 20180105093501.5793-1-daggs@gmx.com
State Rejected
Headers show
Series [v2] tvheadend: add dependency on udev | expand

Commit Message

Dagg Stompler Jan. 5, 2018, 9:35 a.m. UTC
udev is needed in order to detect usb based DVB cards.
reference for none SystemD systems can be found at https://github.com/tvheadend/tvheadend/blob/master/debian/tvheadend.init

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
v1 -> v2:
 - use BR2_PACKAGE_HAS_UDEV instead of ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV (Thomas)
 - add BR2_PACKAGE_HAS_UDEV dependecy to comment

 package/tvheadend/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Yann E. MORIN Jan. 5, 2018, 10:54 p.m. UTC | #1
Dagg, All,

On 2018-01-05 11:35 +0200, Dagg Stompler spake thusly:
> udev is needed in order to detect usb based DVB cards.
> reference for none SystemD systems can be found at https://github.com/tvheadend/tvheadend/blob/master/debian/tvheadend.init

We do not use this startup script in Buildroot, since we have our own:
    https://git.buildroot.org/buildroot/tree/package/tvheadend/S99tvheadend

So I fail to see why their init script calling udevadm is a reason to
force a dependency on udev.

Besides, our own udev startup does an udevadm settle, and it is called
before the tvheadend startup script (S10 vs. S99):
    https://git.buildroot.org/buildroot/tree/package/eudev/S10udev

Furthermore, last time udev was mentioned in the tvheadend repository was
in 2014, commit 517af478ab20, where Adam said:
    "... I've given up on using udev (for various reasons)."

The previous mention of udev was the commit that added the call to
udevadm in 2010, commit 5e20573581f0.

And personal experience has shown that my setup was working OK without
udev as well, at a time _after_ those two commits.

So I still believe we should not add a dependency on udev at all,
because as far as I understand, you claim it is only needed for USB
devices. Other devices seem to be working fine without udev, and it
is perfectly valid to have a setup with a non-USB device and no udev.

So, still no from me...

We may however add a blurb in the help text that states that using
certain devices may require use of udev or another manager of /dev.

Regards,
Yann E. MORIN.

> Signed-off-by: Dagg Stompler <daggs@gmx.com>
> ---
> v1 -> v2:
>  - use BR2_PACKAGE_HAS_UDEV instead of ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV (Thomas)
>  - add BR2_PACKAGE_HAS_UDEV dependecy to comment
> 
>  package/tvheadend/Config.in | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/package/tvheadend/Config.in b/package/tvheadend/Config.in
> index 44a69a27ba..75bb7d0b62 100644
> --- a/package/tvheadend/Config.in
> +++ b/package/tvheadend/Config.in
> @@ -1,6 +1,7 @@
> -comment "tvheadend needs a toolchain w/ NPTL, headers >= 3.2, dynamic library"
> +comment "tvheadend needs a toolchain w/ NPTL, headers >= 3.2, dynamic library, udev /dev management"
>  	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
> -		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2 || BR2_STATIC_LIBS
> +		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2 || BR2_STATIC_LIBS || \
> +		!BR2_PACKAGE_HAS_UDEV
>  	depends on BR2_TOOLCHAIN_HAS_SYNC_4
>  
>  config BR2_PACKAGE_TVHEADEND
> @@ -9,6 +10,7 @@ config BR2_PACKAGE_TVHEADEND
>  	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
>  	depends on BR2_TOOLCHAIN_HAS_SYNC_4
> +	depends on BR2_PACKAGE_HAS_UDEV
>  	select BR2_PACKAGE_DTV_SCAN_TABLES
>  	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
>  	select BR2_PACKAGE_OPENSSL
> -- 
> 2.15.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Dagg Stompler Jan. 6, 2018, 1:31 p.m. UTC | #2
Greetings Yan,

> Dagg, All,
> 
> On 2018-01-05 11:35 +0200, Dagg Stompler spake thusly:
> > udev is needed in order to detect usb based DVB cards.
> > reference for none SystemD systems can be found at https://github.com/tvheadend/tvheadend/blob/master/debian/tvheadend.init
> 
> We do not use this startup script in Buildroot, since we have our own:
>     https://git.buildroot.org/buildroot/tree/package/tvheadend/S99tvheadend
> 
> So I fail to see why their init script calling udevadm is a reason to
> force a dependency on udev.
> 
> Besides, our own udev startup does an udevadm settle, and it is called
> before the tvheadend startup script (S10 vs. S99):
>     https://git.buildroot.org/buildroot/tree/package/eudev/S10udev

I know buildroot has its own init script implementation, I just added it as reference to why I think it is needed.

> 
> Furthermore, last time udev was mentioned in the tvheadend repository was
> in 2014, commit 517af478ab20, where Adam said:
>     "... I've given up on using udev (for various reasons)."
> 
> The previous mention of udev was the commit that added the call to
> udevadm in 2010, commit 5e20573581f0.

the repo still has it in it, if it isn't needed, it should be removed but it isn't my job as I'm not part of the tvheadend dev team.
more over, after my experience, is indeed there is no need for udev, tvheadend has a bug.

> 
> And personal experience has shown that my setup was working OK without
> udev as well, at a time _after_ those two commits.
> 
> So I still believe we should not add a dependency on udev at all,
> because as far as I understand, you claim it is only needed for USB
> devices. Other devices seem to be working fine without udev, and it
> is perfectly valid to have a setup with a non-USB device and no udev.

I'm happy that it worked out of the box for you but fact to the matter, it didn't for me.
it took me three weekends to figure it out. imho, the fact that it works on one scenario doesn't means there isn't a bug.

> 
> So, still no from me...
> 
> We may however add a blurb in the help text that states that using
> certain devices may require use of udev or another manager of /dev.
as said, imho there is still a bug here but this suggestion might be good enough for a possible commit, I didn't liked that I've wasted a lot of my spare time on this, I'm sure that anyone else that will encounter it won't want to waste his time.

Thanks,

Dagg.
Thomas Petazzoni Jan. 6, 2018, 2:25 p.m. UTC | #3
Hello,

On Sat, 6 Jan 2018 14:31:05 +0100, daggs wrote:

> > And personal experience has shown that my setup was working OK without
> > udev as well, at a time _after_ those two commits.
> > 
> > So I still believe we should not add a dependency on udev at all,
> > because as far as I understand, you claim it is only needed for USB
> > devices. Other devices seem to be working fine without udev, and it
> > is perfectly valid to have a setup with a non-USB device and no udev.  
> 
> I'm happy that it worked out of the box for you but fact to the matter, it didn't for me.
> it took me three weekends to figure it out. imho, the fact that it works on one scenario doesn't means there isn't a bug.

Yes, but we can't force a dependency on all users without understanding
if this dependency is really needed.

Could you try to understand *why* udev makes it work for you?

One guess is that udev has some rules that makes your USB capture
device accessible to non-root users. And since tvheadend runs as its
own user, this might explain it.

Could you have a look into this ?

Thanks,

Thomas
Bernd Kuhls Jan. 11, 2018, 7:14 a.m. UTC | #4
Hi Yann, hi Dagg,

Am Fri, 05 Jan 2018 23:54:59 +0100 schrieb Yann E. MORIN:

> So I still believe we should not add a dependency on udev at all,
> because as far as I understand, you claim it is only needed for USB
> devices. Other devices seem to be working fine without udev, and it is
> perfectly valid to have a setup with a non-USB device and no udev.
> 
> So, still no from me...

my tvheadend server also works fine without udev, so NACK from me as well.

Regards, Bernd
Dagg Stompler Jan. 13, 2018, 4:02 p.m. UTC | #5
Greetings Bernd,

> Sent: Thursday, January 11, 2018 at 9:14 AM
> From: "Bernd Kuhls" <bernd.kuhls@t-online.de>
> To: buildroot@uclibc.org
> Subject: Re: [Buildroot] [PATCH v2] tvheadend: add dependency on udev
>
> Hi Yann, hi Dagg,
> 
> Am Fri, 05 Jan 2018 23:54:59 +0100 schrieb Yann E. MORIN:
> 
> > So I still believe we should not add a dependency on udev at all,
> > because as far as I understand, you claim it is only needed for USB
> > devices. Other devices seem to be working fine without udev, and it is
> > perfectly valid to have a setup with a non-USB device and no udev.
> > 
> > So, still no from me...
> 
> my tvheadend server also works fine without udev, so NACK from me as well.
> 
> Regards, Bernd
> 

I've posted a question in the tvheadend forums, lets see what they have to say.
btw, just want to know, do you use a usb adapter?

Thanks,
Dagg.
Bernd Kuhls Jan. 13, 2018, 10:22 p.m. UTC | #6
Am Sat, 13 Jan 2018 17:02:58 +0100 schrieb daggs:

> btw, just want to know, do you use a usb adapter?

Hi daggs,

yes, here are some snippets from lsusb -vv:

Bus 001 Device 006: ID 0b48:3017 TechnoTrend AG
  iManufacturer           1 CityCom GmbH
  iProduct                2 TechnoTrend USB2.0

https://cateee.net/lkddb/web-lkddb/DVB_USB_DVBSKY.html

I am using tvheadend on a buildroot-built linux distro (fli4l) which does 
not contain udev but uses BR2_ROOTFS_DEVICE_CREATION_STATIC=y, for this 
distro I created personal packages adding the function I need. Therefore 
I do not use buildroot-provided init scripts but instead coded my own 
init script for tvheadend which suits my needs and works fine without an 
udev daemon. For Kodi I need libudev[1] support for detecting my CEC-USB 
adapter but again, no udev daemon needed.

My init scripts only contain one hardware-specific command relating to 
tvheadend:

modprobe dvb_usb_dvbsky

Everything else worked out-of-the box after configuring all the kernel 
modules needed for my USB device.

Regards, Bernd

[1] https://github.com/bkuhls/buildroot/tree/libudev
Dagg Stompler Jan. 19, 2018, 12:45 p.m. UTC | #7
Greetings Bernd,

> Sent: Sunday, January 14, 2018 at 12:22 AM
> From: "Bernd Kuhls" <bernd.kuhls@t-online.de>
> To: buildroot@uclibc.org
> Subject: Re: [Buildroot] [PATCH v2] tvheadend: add dependency on udev
>
> Am Sat, 13 Jan 2018 17:02:58 +0100 schrieb daggs:
> 
> > btw, just want to know, do you use a usb adapter?
> 
> Hi daggs,
> 
> yes, here are some snippets from lsusb -vv:
> 
> Bus 001 Device 006: ID 0b48:3017 TechnoTrend AG
>   iManufacturer           1 CityCom GmbH
>   iProduct                2 TechnoTrend USB2.0
> 
> https://cateee.net/lkddb/web-lkddb/DVB_USB_DVBSKY.html
this device is similar to what I have.

> 
> I am using tvheadend on a buildroot-built linux distro (fli4l) which does 
> not contain udev but uses BR2_ROOTFS_DEVICE_CREATION_STATIC=y, for this 
> distro I created personal packages adding the function I need. Therefore 
> I do not use buildroot-provided init scripts but instead coded my own 
> init script for tvheadend which suits my needs and works fine without an 
> udev daemon. For Kodi I need libudev[1] support for detecting my CEC-USB 
> adapter but again, no udev daemon needed.
> 
> My init scripts only contain one hardware-specific command relating to 
> tvheadend:
> 
> modprobe dvb_usb_dvbsky
> 
> Everything else worked out-of-the box after configuring all the kernel 
> modules needed for my USB device.
> 
> Regards, Bernd
> 
> [1] https://github.com/bkuhls/buildroot/tree/libudev

maybe this is what I need too. BR2_ROOTFS_DEVICE_CREATION_STATIC=y and modprobe the modules right before tvheadend boots.

I'll look into it.

Dagg.
diff mbox series

Patch

diff --git a/package/tvheadend/Config.in b/package/tvheadend/Config.in
index 44a69a27ba..75bb7d0b62 100644
--- a/package/tvheadend/Config.in
+++ b/package/tvheadend/Config.in
@@ -1,6 +1,7 @@ 
-comment "tvheadend needs a toolchain w/ NPTL, headers >= 3.2, dynamic library"
+comment "tvheadend needs a toolchain w/ NPTL, headers >= 3.2, dynamic library, udev /dev management"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
-		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2 || BR2_STATIC_LIBS
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2 || BR2_STATIC_LIBS || \
+		!BR2_PACKAGE_HAS_UDEV
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 
 config BR2_PACKAGE_TVHEADEND
@@ -9,6 +10,7 @@  config BR2_PACKAGE_TVHEADEND
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
+	depends on BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_DTV_SCAN_TABLES
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	select BR2_PACKAGE_OPENSSL