Introduce UDEV_HWDB_PATH, containing a colon-separated path with hwdb
files in it. The whole path is searched, in addition to the system
locations, when searching for hwdb files.
Due to how conf_files_list_strv is implemented, as a thin wrapper
around the internal function, it is easy to also implement a variant
accepting a search path in the same way. Since the internal function
expects an allocated array of allocated strings, the path scanning is
done in 2 steps, to first get the array length, and then duplicate the
items. It is not possible to use strtok(_r) here because it would work
for only 1 pass.
* src/shared/conf-files.c (conf_files_list_follow_path): New function.
(conf_files_list_strv_path): Use it here.
* src/shared/conf-files.h: Export the signature for the _path variant.
* src/udev/udevadm-hwdb.c (list_conf_file_path): New function
replacing conf_file_dirs.
(help): Document the search path for hwdb files.
(adm_hwdb): Use list_conf_file_path and conf_files_list_strv_path.
* man/udevadm.xml: Mention UDEV_HWDB_PATH.
* man/udev.xml: Same.
* man/udevadm.8: Regenerate.
* man/udev.7: Same.
Instead of always writing /etc/udev/hwdb.bin or UDEV_LIBEXEC_DIR
/hwdb.bin, let the user specify a full file name.
* src/udev/udevadm-hwdb.c (adm_hwdb): New option "output". Construct
hwdb_bin when processing options, and prepend root after processing
options.
* man/udev.xml: Mention --output.
* man/udevadm.xml: Document --output.
* man/udev.7: Regenerate.
* man/udevadm.8: Same.