[PATCH] use udevadm to get device map

Dan Nicholson dbn.lists at gmail.com
Wed Aug 27 07:55:52 PDT 2008


On Tue, Aug 26, 2008 at 8:18 PM, Lucas Hazel <lucas at die.net.au> wrote:
> ---
>  hald/linux/blockdev.c |    2 +-
>  hald/linux/coldplug.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
> index 396dd9e..235e9d1 100644
> --- a/hald/linux/blockdev.c
> +++ b/hald/linux/blockdev.c
> @@ -1770,7 +1770,7 @@ udev_get_device_file_for_sysfs_path (const char *sysfs_path)
>         char *ret;
>         char *u_stdout;
>         int u_exit_status;
> -        const char *argv[] = {"/usr/bin/udevinfo", "--root", "--query", "name", "--path", NULL, NULL};
> +        const char *argv[] = {"/sbin/udevadm", "--root", "--query", "name", "--path", NULL, NULL};

Don't you have to actually have to pass the "info" command to udevadm?
So, this would become:

const char *argv[] = {"/sbin/udevadm", "info", "--root", "--query",
"name", "--path", NULL, NULL};

>         GError *g_error;
>
>         ret = NULL;
> diff --git a/hald/linux/coldplug.c b/hald/linux/coldplug.c
> index 1d10131..e5835eb 100644
> --- a/hald/linux/coldplug.c
> +++ b/hald/linux/coldplug.c
> @@ -149,8 +149,8 @@ udev_info_to_hotplug_event (const UdevInfo *info)
>  static gboolean
>  hal_util_init_sysfs_to_udev_map (void)
>  {
> -       char *udevdb_export_argv[] = { "/usr/bin/udevinfo", "-e", NULL };
> -       char *udevroot_argv[] = { "/usr/bin/udevinfo", "-r", NULL };
> +       char *udevdb_export_argv[] = { "/sbin/udevadm", "-e", NULL };
> +       char *udevroot_argv[] = { "/sbin/udevadm", "-r", NULL };

Same here.

--
Dan


More information about the hal mailing list