Hiya, Martin Pitt wrote on 28/10/14 11:18: > @@ -275,30 +281,43 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev > *udev) { > hwdb->refcount = 1; > udev_list_init(udev, &hwdb->properties_list, true); > > - hwdb->f = fopen("/etc/udev/hwdb.bin", "re"); > + /* find hwdb.bin in hwdb_bin_paths */ > + NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) { > + hwdb->f = fopen(hwdb_bin_path, "re"); > + if (hwdb->f) > + break; > + else if (errno == ENOENT) > + continue; > + else { > + udev_dbg(udev, "error reading %s: %m", > hwdb_bin_path); > + udev_hwdb_unref(hwdb); > + return NULL; > + } > + } > + > if (!hwdb->f) { > - udev_dbg(udev, "error reading /etc/udev/hwdb.bin: %m"); > + udev_err(udev, "hwdb.bin does not exist, please run udevadm > hwdb --update"); > udev_hwdb_unref(hwdb); > return NULL; > } >
Pretty sure it's a relatively minor issue, but since this patch, I see the error message "hwdb.bin does not exist, please run udevadm hwdb --update" twice on every boot despite me having a /etc/udev/hwdb.bin file present and correct! With a bit of digging, I looked into the issue and even after reverting this patch, both error messages remained... at which point I realised it was from udev in the initrd (dracut generated), not the installed version. Rebuilding the initrd with the patch reverted udevd solved the problems and the error message disappeared. While it's a nice error message, I wonder if it should be reverted back to being dbg again for the initrd use case or perhaps some other mechanism could be used to suppress the error in that case? AFAIUI, we do not need to ship the complied hwdb.bin in the initrd (it would make it quite large) and thus is quite valid to not include it. Anyone against the attached patch? Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited http://www.tribalogic.net/ Open Source: Mageia Contributor http://www.mageia.org/ PulseAudio Hacker http://www.pulseaudio.org/ Trac Hacker http://trac.edgewall.org/
>From ec66bb59f669a39a0ba4acbbe2d1f3a562d3d2ec Mon Sep 17 00:00:00 2001 From: Colin Guthrie <co...@mageia.org> Date: Wed, 5 Nov 2014 15:29:41 +0000 Subject: [PATCH] udev hwdb: Change error message regarding missing hwdb.bin back to debug. When used in the initrd, it's expected that the hwdb.bin file is not present (it makes for very large initrd's). While it's nice to tell the user about this, as it's not strictly speaking an error we really shouldn't be so forceful in our reporting. --- src/libudev/libudev-hwdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index a1cfc0b..0716072 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -296,7 +296,7 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) { } if (!hwdb->f) { - udev_err(udev, "hwdb.bin does not exist, please run udevadm hwdb --update"); + udev_dbg(udev, "hwdb.bin does not exist, please run udevadm hwdb --update"); udev_hwdb_unref(hwdb); return NULL; } -- 2.1.3
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel