diff options
Diffstat (limited to 'recipes-extended/openhpi/files')
-rw-r--r-- | recipes-extended/openhpi/files/configure_fix.patch | 18 | ||||
-rw-r--r-- | recipes-extended/openhpi/files/my_changes.patch | 26 | ||||
-rw-r--r-- | recipes-extended/openhpi/files/my_xml.patch | 15 | ||||
-rw-r--r-- | recipes-extended/openhpi/files/openhpi_openclovis.patch | 237 | ||||
-rw-r--r-- | recipes-extended/openhpi/files/xml.patch | 13 |
5 files changed, 309 insertions, 0 deletions
diff --git a/recipes-extended/openhpi/files/configure_fix.patch b/recipes-extended/openhpi/files/configure_fix.patch new file mode 100644 index 0000000..d6c9818 --- /dev/null +++ b/recipes-extended/openhpi/files/configure_fix.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | --- a/configure.ac 2012-08-27 15:08:58.000000000 -0300 | ||
2 | +++ b/configure.ac 2013-07-31 08:55:00.017653886 -0300 | ||
3 | @@ -277,6 +277,7 @@ | ||
4 | if test "x$have_sysfs" = "xyes"; then | ||
5 | AC_SUBST(SYSFS,sysfs) | ||
6 | AC_SUBST(WITH_SYSFS,1) | ||
7 | + AC_CHECK_HEADERS([sysfs/libsysfs.h]) | ||
8 | else | ||
9 | OH_CHECK_FAIL(libsysfs,,http://linux-diag.sf.net, | ||
10 | Can not build sysfs support without libsysfs) | ||
11 | @@ -287,6 +288,7 @@ | ||
12 | [if test "x$have_sysfs" = "xyes"; then | ||
13 | AC_SUBST(SYSFS,sysfs) | ||
14 | AC_SUBST(WITH_SYSFS,1) | ||
15 | + AC_SUBST(SYSFS_INCLUDE) | ||
16 | else | ||
17 | AC_SUBST(WITH_SYSFS,0) | ||
18 | fi | ||
diff --git a/recipes-extended/openhpi/files/my_changes.patch b/recipes-extended/openhpi/files/my_changes.patch new file mode 100644 index 0000000..feb777b --- /dev/null +++ b/recipes-extended/openhpi/files/my_changes.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Index: openhpi-3.2.1/plugins/sysfs/Makefile.am | ||
2 | =================================================================== | ||
3 | --- openhpi-3.2.1.orig/plugins/sysfs/Makefile.am | ||
4 | +++ openhpi-3.2.1/plugins/sysfs/Makefile.am | ||
5 | @@ -33,7 +33,7 @@ MAINTAINERCLEANFILES = Makefile.in | ||
6 | |||
7 | AM_CPPFLAGS = -DG_LOG_DOMAIN=\"sysfs\" | ||
8 | |||
9 | -INCLUDES = @OPENHPI_INCLUDES@ -I/usr/include/sysfs | ||
10 | +INCLUDES = @OPENHPI_INCLUDES@ | ||
11 | |||
12 | pkglib_LTLIBRARIES = libsysfs2hpi.la | ||
13 | |||
14 | Index: openhpi-3.2.1/plugins/sysfs/sysfs2hpi.c | ||
15 | =================================================================== | ||
16 | --- openhpi-3.2.1.orig/plugins/sysfs/sysfs2hpi.c | ||
17 | +++ openhpi-3.2.1/plugins/sysfs/sysfs2hpi.c | ||
18 | @@ -18,7 +18,7 @@ | ||
19 | |||
20 | #include <stdlib.h> | ||
21 | #include <string.h> | ||
22 | -#include <libsysfs.h> | ||
23 | +#include <sysfs/libsysfs.h> | ||
24 | |||
25 | #include <SaHpi.h> | ||
26 | #include <oh_utils.h> | ||
diff --git a/recipes-extended/openhpi/files/my_xml.patch b/recipes-extended/openhpi/files/my_xml.patch new file mode 100644 index 0000000..4d9aa15 --- /dev/null +++ b/recipes-extended/openhpi/files/my_xml.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Index: openhpi-3.2.1/plugins/ilo2_ribcl/ilo2_ribcl_xml.c | ||
2 | =================================================================== | ||
3 | --- openhpi-3.2.1.orig/plugins/ilo2_ribcl/ilo2_ribcl_xml.c | ||
4 | +++ openhpi-3.2.1/plugins/ilo2_ribcl/ilo2_ribcl_xml.c | ||
5 | @@ -44,8 +44,8 @@ | ||
6 | #include <ctype.h> | ||
7 | #include <errno.h> | ||
8 | #include <sys/types.h> | ||
9 | -#include <libxml/parser.h> | ||
10 | -#include <libxml/xmlmemory.h> | ||
11 | +#include <libxml2/libxml/parser.h> | ||
12 | +#include <libxml2/libxml/xmlmemory.h> | ||
13 | #include <ilo2_ribcl.h> | ||
14 | #include <ilo2_ribcl_xml.h> | ||
15 | #include <ilo2_ribcl_cmnds.h> | ||
diff --git a/recipes-extended/openhpi/files/openhpi_openclovis.patch b/recipes-extended/openhpi/files/openhpi_openclovis.patch new file mode 100644 index 0000000..5e51bb4 --- /dev/null +++ b/recipes-extended/openhpi/files/openhpi_openclovis.patch | |||
@@ -0,0 +1,237 @@ | |||
1 | diff -Naur openhpi-3.0.0/plugins/dynamic_simulator/new_sim_file_util.cpp openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_file_util.cpp | ||
2 | --- openhpi-3.0.0/plugins/dynamic_simulator/new_sim_file_util.cpp 2011-10-17 13:57:23.000000000 -0200 | ||
3 | +++ openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_file_util.cpp 2012-01-10 14:16:29.000000000 -0200 | ||
4 | @@ -118,7 +118,7 @@ | ||
5 | } else if (cur_token == G_TOKEN_STRING) { | ||
6 | datafield = g_strdup(m_scanner->value.v_string); | ||
7 | } else { | ||
8 | - err("Processing parse textbuffer: unknow value type %u", cur_token); | ||
9 | + err("Processing parse textbuffer: unknown value type %u", cur_token); | ||
10 | success = false; | ||
11 | break; | ||
12 | } | ||
13 | @@ -129,7 +129,7 @@ | ||
14 | tmp.Language = ( SaHpiLanguageT ) val; | ||
15 | } else if (!strcmp( "DataLength", field )) { | ||
16 | tmp.DataLength = val; | ||
17 | - } else if (!strcmp( "Data", field )) { | ||
18 | + } else if ((!strcmp( "Data", field ))&&datafield) { | ||
19 | strncpy ((char *) tmp.Data, datafield, SAHPI_MAX_TEXT_BUFFER_LENGTH); | ||
20 | } else { | ||
21 | err("Processing parse textbuffer: unknown field %s", field); | ||
22 | diff -Naur openhpi-3.0.0/plugins/dynamic_simulator/new_sim_sensor_threshold.cpp openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_sensor_threshold.cpp | ||
23 | --- openhpi-3.0.0/plugins/dynamic_simulator/new_sim_sensor_threshold.cpp 2011-10-17 13:57:23.000000000 -0200 | ||
24 | +++ openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_sensor_threshold.cpp 2012-01-10 14:16:25.000000000 -0200 | ||
25 | @@ -478,7 +478,10 @@ | ||
26 | rv = checkOrdering( tmp ); | ||
27 | if ( rv != SA_OK ) | ||
28 | return rv; | ||
29 | - | ||
30 | + | ||
31 | + // Now check if the threshold changes caused an event | ||
32 | + CheckThresholdsAndPublishEvents(&tmp); | ||
33 | + | ||
34 | // Ok, it seems everything is fine - take the new values | ||
35 | memcpy( &m_thres, &tmp, sizeof(SaHpiSensorThresholdsT)); | ||
36 | |||
37 | @@ -486,6 +489,183 @@ | ||
38 | } | ||
39 | |||
40 | |||
41 | +void NewSimulatorSensorThreshold::CreateThresholdEvent(SaHpiEventStateT theActualEvent, SaHpiBoolT asserted) | ||
42 | +{ | ||
43 | + NewSimulatorResource *res = Resource(); | ||
44 | + if( !res ) | ||
45 | + { | ||
46 | + stdlog << "CreateEnableChangeEvent: No resource !\n"; | ||
47 | + return; | ||
48 | + } | ||
49 | + | ||
50 | + oh_event *e = (oh_event *)g_malloc0( sizeof( struct oh_event ) ); | ||
51 | + | ||
52 | + e->event.EventType = SAHPI_ET_SENSOR_ENABLE_CHANGE; | ||
53 | + | ||
54 | + SaHpiRptEntryT *rptentry = oh_get_resource_by_id( res->Domain()->GetHandler()->rptcache, res->ResourceId() ); | ||
55 | + SaHpiRdrT *rdrentry = oh_get_rdr_by_id( res->Domain()->GetHandler()->rptcache, res->ResourceId(), m_record_id ); | ||
56 | + | ||
57 | + if ( rptentry ) | ||
58 | + e->resource = *rptentry; | ||
59 | + else | ||
60 | + e->resource.ResourceCapabilities = 0; | ||
61 | + | ||
62 | + if ( rdrentry ) | ||
63 | + e->rdrs = g_slist_append(e->rdrs, g_memdup(rdrentry, sizeof(SaHpiRdrT))); | ||
64 | + else | ||
65 | + e->rdrs = NULL; | ||
66 | + | ||
67 | + // Fill the event data | ||
68 | + e->event.Source = res->ResourceId(); | ||
69 | + e->event.EventType = SAHPI_ET_SENSOR; | ||
70 | + | ||
71 | + if ((theActualEvent & SAHPI_ES_LOWER_MINOR) || (theActualEvent & SAHPI_ES_UPPER_MINOR)) | ||
72 | + e->event.Severity = SAHPI_MINOR; | ||
73 | + if ((theActualEvent & SAHPI_ES_LOWER_MAJOR) || (theActualEvent & SAHPI_ES_UPPER_MAJOR)) | ||
74 | + e->event.Severity = SAHPI_MAJOR; | ||
75 | + if ((theActualEvent & SAHPI_ES_LOWER_CRIT) || (theActualEvent & SAHPI_ES_UPPER_CRIT)) | ||
76 | + e->event.Severity = SAHPI_CRITICAL; | ||
77 | + | ||
78 | + oh_gettimeofday(&e->event.Timestamp); | ||
79 | + | ||
80 | + // sensor enable event | ||
81 | + SaHpiSensorEventT *se = &e->event.EventDataUnion.SensorEvent; | ||
82 | + se->SensorNum = m_sensor_record.Num; | ||
83 | + se->SensorType = Type(); | ||
84 | + se->EventCategory = SAHPI_EC_THRESHOLD; | ||
85 | + se->Assertion = asserted; // True if the condition is being raised, False if cleared | ||
86 | + | ||
87 | + se->EventState = theActualEvent; | ||
88 | + se->OptionalDataPresent = 0; | ||
89 | + | ||
90 | + // Issue the event | ||
91 | + stdlog << "NewSimulatorSensorThreshold::CreateThresholdEvent OH_ET_HPI Event threshold resource " << res-> ResourceId() << "\n"; | ||
92 | + res->Domain()->AddHpiEvent( e ); | ||
93 | + | ||
94 | +} | ||
95 | + | ||
96 | + | ||
97 | +SaErrorT NewSimulatorSensorThreshold::CheckThresholdsAndPublishEvents(const SaHpiSensorThresholdsT* thres) | ||
98 | +{ | ||
99 | + // Only generate if the threshold is supported. | ||
100 | + if (thres->UpMinor.IsSupported) { | ||
101 | + // Crossing the threshold in both directions (from deasserted to asserted, | ||
102 | + // and from asserted to deasserted) needs to be handled. | ||
103 | + | ||
104 | + if (m_event_data & SAHPI_ES_UPPER_MINOR) { | ||
105 | + // See if the threshold is no longer exceeded | ||
106 | + if (lt(m_read_data,thres->UpMinor)) { | ||
107 | + CreateThresholdEvent(SAHPI_ES_UPPER_MINOR,SAHPI_FALSE); | ||
108 | + m_event_data &= ~SAHPI_ES_UPPER_MINOR; | ||
109 | + } | ||
110 | + | ||
111 | + } | ||
112 | + else { | ||
113 | + // See if the threshold is exceeded | ||
114 | + if (gt(m_read_data,thres->UpMinor)) { | ||
115 | + CreateThresholdEvent(SAHPI_ES_UPPER_MINOR,SAHPI_TRUE); | ||
116 | + m_event_data |= SAHPI_ES_UPPER_MINOR; | ||
117 | + } | ||
118 | + } | ||
119 | + } | ||
120 | + | ||
121 | + if (thres->UpMajor.IsSupported) { | ||
122 | + if (m_event_data & SAHPI_ES_UPPER_MAJOR) { | ||
123 | + // See if the threshold is no longer exceeded | ||
124 | + if (lt(m_read_data,thres->UpMajor)) { | ||
125 | + CreateThresholdEvent(SAHPI_ES_UPPER_MAJOR,SAHPI_FALSE); | ||
126 | + m_event_data &= ~SAHPI_ES_UPPER_MAJOR; | ||
127 | + } | ||
128 | + | ||
129 | + } | ||
130 | + else { | ||
131 | + // See if the threshold is exceeded | ||
132 | + if (gt(m_read_data,thres->UpMajor)) { | ||
133 | + CreateThresholdEvent(SAHPI_ES_UPPER_MAJOR,SAHPI_TRUE); | ||
134 | + m_event_data |= SAHPI_ES_UPPER_MAJOR; | ||
135 | + } | ||
136 | + } | ||
137 | + } | ||
138 | + | ||
139 | + if (thres->UpCritical.IsSupported) { | ||
140 | + if (m_event_data & SAHPI_ES_UPPER_CRIT) { | ||
141 | + // See if the threshold is no longer exceeded | ||
142 | + if (lt(m_read_data,thres->UpCritical)) { | ||
143 | + CreateThresholdEvent(SAHPI_ES_UPPER_CRIT,SAHPI_FALSE); | ||
144 | + m_event_data &= ~SAHPI_ES_UPPER_CRIT; | ||
145 | + } | ||
146 | + } | ||
147 | + else { | ||
148 | + // See if the threshold is exceeded | ||
149 | + if (gt(m_read_data,thres->UpCritical)) { | ||
150 | + CreateThresholdEvent(SAHPI_ES_UPPER_CRIT,SAHPI_TRUE); | ||
151 | + m_event_data |= SAHPI_ES_UPPER_CRIT; | ||
152 | + } | ||
153 | + } | ||
154 | + } | ||
155 | + | ||
156 | + | ||
157 | + | ||
158 | + if (thres->LowMinor.IsSupported) { | ||
159 | + // Crossing the threshold in both directions (from deasserted to asserted, | ||
160 | + // and from asserted to deasserted) needs to be handled. | ||
161 | + | ||
162 | + if (m_event_data & SAHPI_ES_LOWER_MINOR) { | ||
163 | + // See if the threshold is no longer exceeded | ||
164 | + if (lt(m_read_data,thres->LowMinor)) { | ||
165 | + CreateThresholdEvent(SAHPI_ES_LOWER_MINOR,SAHPI_FALSE); | ||
166 | + m_event_data &= ~SAHPI_ES_LOWER_MINOR; | ||
167 | + } | ||
168 | + | ||
169 | + } | ||
170 | + else { | ||
171 | + // See if the threshold is exceeded | ||
172 | + if (gt(m_read_data,thres->LowMinor)) { | ||
173 | + CreateThresholdEvent(SAHPI_ES_LOWER_MINOR,SAHPI_TRUE); | ||
174 | + m_event_data |= SAHPI_ES_LOWER_MINOR; | ||
175 | + } | ||
176 | + } | ||
177 | + } | ||
178 | + | ||
179 | + if (thres->LowMajor.IsSupported) { | ||
180 | + if (m_event_data & SAHPI_ES_LOWER_MAJOR) { | ||
181 | + // See if the threshold is no longer exceeded | ||
182 | + if (lt(m_read_data,thres->LowMajor)) { | ||
183 | + CreateThresholdEvent(SAHPI_ES_LOWER_MAJOR,SAHPI_FALSE); | ||
184 | + m_event_data &= ~SAHPI_ES_LOWER_MAJOR; | ||
185 | + } | ||
186 | + | ||
187 | + } | ||
188 | + else { | ||
189 | + // See if the threshold is exceeded | ||
190 | + if (gt(m_read_data,thres->LowMajor)) { | ||
191 | + CreateThresholdEvent(SAHPI_ES_LOWER_MAJOR,SAHPI_TRUE); | ||
192 | + m_event_data |= SAHPI_ES_LOWER_MAJOR; | ||
193 | + } | ||
194 | + } | ||
195 | + } | ||
196 | + | ||
197 | + if (thres->LowCritical.IsSupported) { | ||
198 | + if (m_event_data & SAHPI_ES_LOWER_CRIT) { | ||
199 | + // See if the threshold is no longer exceeded | ||
200 | + if (lt(m_read_data,thres->LowCritical)) { | ||
201 | + CreateThresholdEvent(SAHPI_ES_LOWER_CRIT,SAHPI_FALSE); | ||
202 | + m_event_data &= ~SAHPI_ES_LOWER_CRIT; | ||
203 | + } | ||
204 | + } | ||
205 | + else { | ||
206 | + // See if the threshold is exceeded | ||
207 | + if (gt(m_read_data,thres->LowCritical)) { | ||
208 | + CreateThresholdEvent(SAHPI_ES_LOWER_CRIT,SAHPI_TRUE); | ||
209 | + m_event_data |= SAHPI_ES_LOWER_CRIT; | ||
210 | + } | ||
211 | + } | ||
212 | + } | ||
213 | + | ||
214 | + | ||
215 | + return SA_OK; | ||
216 | +} | ||
217 | + | ||
218 | /** | ||
219 | * Check whether the setting of one threshold value is allowed | ||
220 | * | ||
221 | diff -Naur openhpi-3.0.0/plugins/dynamic_simulator/new_sim_sensor_threshold.h openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_sensor_threshold.h | ||
222 | --- openhpi-3.0.0/plugins/dynamic_simulator/new_sim_sensor_threshold.h 2011-10-17 13:57:23.000000000 -0200 | ||
223 | +++ openhpi-3.0.0.oc/plugins/dynamic_simulator/new_sim_sensor_threshold.h 2012-01-10 14:17:33.000000000 -0200 | ||
224 | @@ -73,6 +73,13 @@ | ||
225 | // create an RDR sensor record | ||
226 | virtual bool CreateRdr( SaHpiRptEntryT &resource, SaHpiRdrT &rdr ); | ||
227 | |||
228 | + // Check to see if changing the thresholds to the passed values | ||
229 | + // would result in an error. If so, raise the appropriate event. | ||
230 | + SaErrorT CheckThresholdsAndPublishEvents(const SaHpiSensorThresholdsT* newThres); | ||
231 | + | ||
232 | + // Create a threshold event | ||
233 | + void CreateThresholdEvent(SaHpiEventStateT theActualEvent, SaHpiBoolT asserted); | ||
234 | + | ||
235 | // official hpi functions | ||
236 | |||
237 | // get sensor data | ||
diff --git a/recipes-extended/openhpi/files/xml.patch b/recipes-extended/openhpi/files/xml.patch new file mode 100644 index 0000000..ddcea26 --- /dev/null +++ b/recipes-extended/openhpi/files/xml.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: openhpi-3.2.1/configure.ac | ||
2 | =================================================================== | ||
3 | --- openhpi-3.2.1.orig/configure.ac | ||
4 | +++ openhpi-3.2.1/configure.ac | ||
5 | @@ -173,7 +173,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/ | ||
6 | |||
7 | dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap | ||
8 | AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=]) | ||
9 | -AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE]) | ||
10 | +AC_CHECK_HEADERS([libxml/xmlexports.h]) | ||
11 | AC_SUBST(XML2_LIB) | ||
12 | AC_SUBST(XML2_INCLUDE) | ||
13 | |||