From 1c755acb8b54d6f80f5596caa88a09843742ae97 Mon Sep 17 00:00:00 2001 From: Alexander Pyhalov Date: Fri, 8 Jul 2016 10:37:48 +0300 Subject: [PATCH] 7174 Hal searches for fdi files in wrong directories Reviewed by: Andy Stormont Reviewed by: Adam Stevko Approved by: Robert Mustacchi --- usr/src/cmd/hal/Makefile.hal | 3 ++- usr/src/cmd/hal/hald/device_info.c | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/usr/src/cmd/hal/Makefile.hal b/usr/src/cmd/hal/Makefile.hal index fc3a54f617..d95bc3e498 100644 --- a/usr/src/cmd/hal/Makefile.hal +++ b/usr/src/cmd/hal/Makefile.hal @@ -36,7 +36,8 @@ HAL_USER = daemon HAL_GROUP = daemon # derived from the generated config.h -HAL_CONFIG_CPPFLAGS = -DPACKAGE_DATA_DIR=\"/usr/lib\" \ +HAL_CONFIG_CPPFLAGS = -DPACKAGE_DATA_DIR=\"/usr/share\" \ + -DPACKAGE_OLD_DATA_DIR=\"/usr/lib\" \ -DPACKAGE_BIN_DIR=\"/usr/bin\" \ -DPACKAGE_LIBEXEC_DIR=\"/usr/lib/hal\" \ -DPACKAGE_SCRIPT_DIR=\"/usr/lib/hal\" \ diff --git a/usr/src/cmd/hal/hald/device_info.c b/usr/src/cmd/hal/hald/device_info.c index 20359201e8..e4e1ae7fee 100644 --- a/usr/src/cmd/hal/hald/device_info.c +++ b/usr/src/cmd/hal/hald/device_info.c @@ -1589,6 +1589,7 @@ di_search_and_merge (HalDevice *d, DeviceInfoType type) dbus_bool_t ret; char *s1; char *s2; + char *s3; ret = FALSE; @@ -1604,9 +1605,11 @@ di_search_and_merge (HalDevice *d, DeviceInfoType type) if (hal_fdi_source_preprobe != NULL) { s1 = hal_fdi_source_preprobe; s2 = NULL; + s3 = NULL; } else { - s1 = PACKAGE_DATA_DIR "/hal/fdi/preprobe"; - s2 = PACKAGE_SYSCONF_DIR "/hal/fdi/preprobe"; + s1 = PACKAGE_OLD_DATA_DIR "/hal/fdi/preprobe"; + s2 = PACKAGE_DATA_DIR "/hal/fdi/preprobe"; + s3 = PACKAGE_SYSCONF_DIR "/hal/fdi/preprobe"; } break; @@ -1614,9 +1617,11 @@ di_search_and_merge (HalDevice *d, DeviceInfoType type) if (hal_fdi_source_information != NULL) { s1 = hal_fdi_source_information; s2 = NULL; + s3 = NULL; } else { - s1 = PACKAGE_DATA_DIR "/hal/fdi/information"; - s2 = PACKAGE_SYSCONF_DIR "/hal/fdi/information"; + s1 = PACKAGE_OLD_DATA_DIR "/hal/fdi/information"; + s2 = PACKAGE_DATA_DIR "/hal/fdi/information"; + s3 = PACKAGE_SYSCONF_DIR "/hal/fdi/information"; } break; @@ -1624,15 +1629,18 @@ di_search_and_merge (HalDevice *d, DeviceInfoType type) if (hal_fdi_source_policy != NULL) { s1 = hal_fdi_source_policy; s2 = NULL; + s3 = NULL; } else { - s1 = PACKAGE_DATA_DIR "/hal/fdi/policy"; - s2 = PACKAGE_SYSCONF_DIR "/hal/fdi/policy"; + s1 = PACKAGE_OLD_DATA_DIR "/hal/fdi/policy"; + s2 = PACKAGE_DATA_DIR "/hal/fdi/policy"; + s3 = PACKAGE_SYSCONF_DIR "/hal/fdi/policy"; } break; default: s1 = NULL; s2 = NULL; + s3 = NULL; HAL_ERROR (("Bogus device information type %d", type)); break; } @@ -1641,6 +1649,8 @@ di_search_and_merge (HalDevice *d, DeviceInfoType type) ret = scan_fdi_files (s1, d) || ret; if (s2 != NULL) ret = scan_fdi_files (s2, d) || ret; + if (s3 != NULL) + ret = scan_fdi_files (s3, d) || ret; return ret; } -- 2.11.4.GIT