[virt-tools-list] [libosinfo 2/2] Add Udev support

Daniel P. Berrange berrange at redhat.com
Tue Aug 30 15:49:53 UTC 2011


On Mon, Aug 29, 2011 at 11:30:14PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> If enabled, provide a udev rule to listen to insertion/removal of
> ISO9660 media and sets some helpful (to apps) properties on the device
> if media is bootable.
> ---
>  configure.ac            |    5 +++++
>  data/95-osinfo.rules.in |   21 +++++++++++++++++++++
>  data/Makefile.am        |   11 ++++++++++-
>  3 files changed, 36 insertions(+), 1 deletions(-)
>  create mode 100644 data/95-osinfo.rules.in

This is a neat idea. You also want to modify libosinfo.spec.in
to make the RPM have BuildRequires/Requires: udev deps.


> +AC_ARG_ENABLE([udev],
> +        AS_HELP_STRING([--enable-udev], [enable Udev support]),
> +        [], [enable_udev=no])
> +AM_CONDITIONAL([ENABLE_UDEV], [test "x$enable_udev" = "xyes"])
> +
>  AC_ARG_ENABLE([coverage],
>         AS_HELP_STRING([--enable-coverage], [enable GCC code coverage]),
>         [], [enable_coverage=no])

It is slightly more useful to name the conditional  HAVE_UDEV
or perhaps WITH_UDEV.

> diff --git a/data/Makefile.am b/data/Makefile.am
> index 657916a..c49abed 100644
> --- a/data/Makefile.am
> +++ b/data/Makefile.am
> @@ -1,11 +1,20 @@
>  
>  SUBDIRS = devices oses hypervisors
>  
> -EXTRA_DIST = usb.ids pci.ids
> +EXTRA_DIST = usb.ids pci.ids $(udev_DATA)
>  
>  databasedir = $(pkgdatadir)/data/
>  database_DATA = usb.ids pci.ids
>  
> +if ENABLE_UDEV
> +udevdir = /lib/udev/rules.d/
> +udev_DATA = 95-osinfo.rules
> +BUILT_SOURCES = 95-osinfo.rules
> +
> +95-osinfo.rules: 95-osinfo.rules.in
> +	sed 's,\@bindir\@,$(exec_prefix)/bin,' 95-osinfo.rules.in > 95-osinfo.rules
> +endif
> +
>  CLEANFILES = usb.ids pci.ids
>  
>  usb.ids:

This ends up adding 95-osinfo.rules to the EXTRA_DIST
instead of 95-osinfo.rules.in.  We need to add the latter to
EXTRA_DIST, regardless of whether ENABLE_UDEV is present


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list