import ppc64-diag-2.7.5-2.el8

This commit is contained in:
CentOS Sources 2019-11-05 15:22:20 -05:00 committed by Stepan Oksanichenko
parent 1eb87eedfc
commit ffb33d8d1f
9 changed files with 30 additions and 313 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/ppc64-diag-2.7.4.tar.gz
SOURCES/ppc64-diag-2.7.5.tar.gz

View File

@ -1 +1 @@
1fb28e9b78d358b057283b14492b705991288902 SOURCES/ppc64-diag-2.7.4.tar.gz
70dc79cfeb1eed3deeb65465781fa887a0b5333f SOURCES/ppc64-diag-2.7.5.tar.gz

View File

@ -1,55 +0,0 @@
commit 1837ee17e201c66ed13ae1665a08a92fc42cb347
Author: Ankit Kumar <ankit@linux.vnet.ibm.com>
Date: Tue Dec 5 14:56:12 2017 +0530
diags: Increase buffer length size to read complete system vpd information
System vpd information(system id, model) can have prefix substring
as IBM and hence our buffer must handle those extra string to get
correct serial number and model information.
This patch increased buffer length to 16 bytes(8-serial/model number + 8 - to
capture other substring).
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/diags/diag_disk.c b/diags/diag_disk.c
index 5a6c84b..fb24a72 100644
--- a/diags/diag_disk.c
+++ b/diags/diag_disk.c
@@ -44,6 +44,7 @@
#define DEVICE_TREE_SYSTEM_ID DEVICE_TREE"system-id"
#define DEVICE_TREE_MODEL DEVICE_TREE"model"
+#define BUFFER_LENGTH 16
#define SERIAL_NUM_LEN 8
#define MACHINE_MODEL_LEN 8
@@ -196,15 +197,15 @@ static int get_system_vpd(char *machine_serial,
int device_fd;
int rc;
int start_index = 0;
- char serial[SERIAL_NUM_LEN + 1] = {0};
- char model[MACHINE_MODEL_LEN + 1] = {0};
+ char serial[BUFFER_LENGTH] = {0};
+ char model[BUFFER_LENGTH] = {0};
char *temp;
device_fd = open(DEVICE_TREE_SYSTEM_ID, O_RDONLY);
if (device_fd < 0)
return -1;
- rc = read(device_fd, serial, SERIAL_NUM_LEN);
+ rc = read(device_fd, serial, BUFFER_LENGTH);
close(device_fd);
if (rc <= 0)
return -1;
@@ -218,7 +219,7 @@ static int get_system_vpd(char *machine_serial,
if (device_fd < 0)
return -1;
- rc = read(device_fd, model, MACHINE_MODEL_LEN);
+ rc = read(device_fd, model, BUFFER_LENGTH);
close(device_fd);
if (rc <= 0)
return -1;

View File

@ -1,66 +0,0 @@
commit 7be810122b48af0c095c1d1d5e8bd0b124026ed4
Author: Ankit Kumar <ankit@linux.vnet.ibm.com>
Date: Tue Dec 5 14:56:13 2017 +0530
diags: Remove timestamp from disk health log file
This patch removes timestamp from filename. Function call sequence is
changed as old and new file will have same name.
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
[Modified to continue with file creation even if remove_old_log_file
fails - Vasant]
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/diags/diag_disk.c b/diags/diag_disk.c
index 9c1acbe..f524774 100644
--- a/diags/diag_disk.c
+++ b/diags/diag_disk.c
@@ -344,7 +344,7 @@ static int sysfs_sg_disk_scan(const char *dir_name, char *disk_name)
return rc;
}
-static int remove_old_log_file(char *xml_filename)
+static int remove_old_log_file(void)
{
DIR *d;
struct dirent *namelist;
@@ -359,9 +359,6 @@ static int remove_old_log_file(char *xml_filename)
if (namelist->d_name[0] == '.')
continue;
- if (!strcmp(xml_filename, namelist->d_name))
- continue;
-
snprintf(filename, sizeof(filename) - 1, "%s/%s", OUTPUT_PATH,
namelist->d_name);
if (unlink(filename) < 0) {
@@ -416,10 +413,11 @@ int diag_disk(char *disk_name)
/* file format */
snprintf(xml_filename, sizeof(xml_filename) - 1,
- "%s~%s~%s~diskAnalytics~%d%02d%02d%02d%02d%02d.xml",
- mach_type_model, mach_model, serial_num,
- tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
- tm.tm_hour, tm.tm_min, tm.tm_sec);
+ "%s~%s~%s~diskAnalytics.xml",
+ mach_type_model, mach_model, serial_num);
+
+ /* Try to remove old log file. We will continue even if this fails */
+ remove_old_log_file();
/* open file */
ret = open_output_xml_file(xml_filename);
@@ -441,12 +439,5 @@ int diag_disk(char *disk_name)
/* close output xml file descriptor */
close_output_xml_file();
- /* remove old log file */
- ret = remove_old_log_file(xml_filename);
- if (ret) {
- fprintf(stderr, "Unable to remove old output log file.\n");
- return -1;
- }
-
return 0;
}

View File

@ -1,127 +0,0 @@
commit d2ec2733829b69f8b935f328f5cc2396e4c2af70
Author: Ankit Kumar <ankit@linux.vnet.ibm.com>
Date: Tue Dec 5 14:56:14 2017 +0530
diags: Create diag_disk log directory manually if not present
disk diagnostics code populates disk health information under
/var/log/ppc64-diag/diag_disk. If above path is not found then
disk diagnostics will fail.
This patch creates /var/log/ppc64-diag/diag_disk/ manually part of
diag_disk code if not already created.
It will help diag_disk code to remove dependency on ppc64-diag installation
process.
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
[Removed inline function, renamed function name and also killed some
of the redundant checks - Vasant]
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/diags/diag_disk.c b/diags/diag_disk.c
index f524774..1e2be61 100644
--- a/diags/diag_disk.c
+++ b/diags/diag_disk.c
@@ -38,7 +38,8 @@
#include "encl_util.h"
-#define OUTPUT_PATH "/var/log/ppc64-diag/diag_disk"
+#define DIAG_OUTPUT_PATH "/var/log/ppc64-diag/"
+#define DISK_OUTPUT_PATH DIAG_OUTPUT_PATH"diag_disk"
#define SYSFS_SG_PATH "/sys/class/scsi_generic"
#define DEVICE_TREE "/proc/device-tree/"
#define DEVICE_TREE_SYSTEM_ID DEVICE_TREE"system-id"
@@ -142,12 +143,53 @@ static int get_page_34_data(int device_fd)
return 0;
}
-static inline int open_output_xml_file(const char *xml_filename)
+static inline void dir_sync(char * path)
+{
+ int dir_fd;
+
+ dir_fd = open(path, O_RDONLY|O_DIRECTORY);
+ if (dir_fd >= 0) {
+ fsync(dir_fd);
+ close(dir_fd);
+ }
+}
+
+static int open_output_xml_file(const char *xml_filename)
{
char filename[PATH_MAX];
+ int rc;
+
+ rc = access(DISK_OUTPUT_PATH, W_OK);
+ if (rc) {
+ /* Return if it fails with error code other than ENOENT */
+ if (errno != ENOENT)
+ return -1;
+
+ /* Check for the existence of parent directory */
+ rc = access(DIAG_OUTPUT_PATH, W_OK);
+ if (rc) {
+ if (errno != ENOENT)
+ return -1;
+
+ rc = mkdir(DIAG_OUTPUT_PATH,
+ S_IRGRP | S_IRUSR | S_IWGRP | S_IWUSR | S_IXUSR);
+ if (rc)
+ return -1;
+
+ dir_sync(DIAG_OUTPUT_PATH);
+ }
+
+ rc = mkdir(DISK_OUTPUT_PATH,
+ S_IRGRP | S_IRUSR | S_IWGRP | S_IWUSR | S_IXUSR);
+ if (rc)
+ return -1;
+
+ dir_sync(DISK_OUTPUT_PATH);
+ }
+
snprintf(filename, sizeof(filename) - 1, "%s/%s",
- OUTPUT_PATH, xml_filename);
+ DISK_OUTPUT_PATH, xml_filename);
result_file = fopen(filename, "w");
if (!result_file)
@@ -349,9 +391,8 @@ static int remove_old_log_file(void)
DIR *d;
struct dirent *namelist;
char filename[PATH_MAX];
- int dir_fd;
- d = opendir(OUTPUT_PATH);
+ d = opendir(DISK_OUTPUT_PATH);
if (!d)
return -errno;
@@ -359,22 +400,17 @@ static int remove_old_log_file(void)
if (namelist->d_name[0] == '.')
continue;
- snprintf(filename, sizeof(filename) - 1, "%s/%s", OUTPUT_PATH,
- namelist->d_name);
+ snprintf(filename, sizeof(filename) - 1, "%s/%s",
+ DISK_OUTPUT_PATH, namelist->d_name);
if (unlink(filename) < 0) {
fprintf(stderr,
"\nUnable to remove old log file[%s]. continuing.\n\n",
filename);
}
}
- closedir(d);
-
- dir_fd = open(OUTPUT_PATH, O_RDONLY|O_DIRECTORY);
- if (dir_fd >= 0) {
- fsync(dir_fd);
- close(dir_fd);
- }
+ closedir(d);
+ dir_sync(DISK_OUTPUT_PATH);
return 0;
}

View File

@ -1,26 +0,0 @@
commit d42252e93ea4a80fbad5646399f29ebe2a54013f
Author: Ankit Kumar <ankit@linux.vnet.ibm.com>
Date: Mon Sep 25 12:36:24 2017 +0530
Create diag_disk path part of installation
`make install` creates `/var/log/ppc64-diag/diag_disk` directory.
But rpmbuild will not pick up this directory unless we specify
explicitly under files section.
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
[Updated description - Vasant]
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/ppc64-diag.spec.in b/ppc64-diag.spec.in
index cb77609..280aa07 100644
--- a/ppc64-diag.spec.in
+++ b/ppc64-diag.spec.in
@@ -61,6 +61,7 @@ mkdir -p $RPM_BUILD_ROOT/var/log/opal-elog
/usr/sbin/*
%dir /etc/%{name}
%dir /etc/%{name}/ses_pages
+%dir /var/log/ppc64-diag/diag_disk
%dir /var/log/dump
%dir /var/log/opal-elog
%config /etc/%{name}/*

View File

@ -0,0 +1,12 @@
diff -up ppc64-diag-2.7.5/opal-dump-parse/opal-dump-parse.c.me ppc64-diag-2.7.5/opal-dump-parse/opal-dump-parse.c
--- ppc64-diag-2.7.5/opal-dump-parse/opal-dump-parse.c.me 2019-04-30 05:45:13.441888580 -0400
+++ ppc64-diag-2.7.5/opal-dump-parse/opal-dump-parse.c 2019-04-30 06:02:49.102876167 -0400
@@ -461,7 +461,7 @@ int main(int argc, char *argv[])
{
int opt = 0;
- while ((opt = getopt(argc, argv, "lh:s:o:")) != -1) {
+ while ((opt = getopt(argc, argv, ":s:o:lh")) != -1) {
switch (opt) {
case 'l':
opt_mdst = 1;

View File

@ -1,27 +0,0 @@
commit 608507ea8ed81209204feacbbde40e234d261141
Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date: Wed Sep 13 21:54:45 2017 +0530
scripts: Fix service scripts
By mistake I added wrong condition check which resulted in unnecessary
log messages in PowerNV system. This patch fixes service script properly.
Fixes: 1f49a51c (scripts: Improve service scripts)
Reported-by: Frédéric Bonnard <frediz@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
diff --git a/scripts/rtas_errd.service b/scripts/rtas_errd.service
index 5507b8a..8475c3e 100644
--- a/scripts/rtas_errd.service
+++ b/scripts/rtas_errd.service
@@ -1,7 +1,7 @@
[Unit]
Description=ppc64-diag rtas_errd (platform error handling) Service
-ConditionPathExists=|!/proc/ppc64/rtas/error_log
-ConditionPathExists=|!/proc/ppc64/error_log
+ConditionPathExists=|/proc/ppc64/rtas/error_log
+ConditionPathExists=|/proc/ppc64/error_log
After=syslog.target
[Service]

View File

@ -1,6 +1,6 @@
Name: ppc64-diag
Version: 2.7.4
Release: 4%{?dist}
Version: 2.7.5
Release: 2%{?dist}
Summary: PowerLinux Platform Diagnostics
URL: http://sourceforge.net/projects/linux-diag/files/ppc64-diag/
Group: System Environment/Base
@ -18,7 +18,7 @@ Requires: servicelog, lsvpd
# powerpc-utils version.
Requires: powerpc-utils >= 1.3.0
Source0: http://downloads.sourceforge.net/project/linux-diag/ppc64-diag/%{version}/%{name}-%{version}.tar.gz
Source0: http://downloads.sourceforge.net/project/linux-diag/ppc64-diag/v%{version}/%{name}-%{version}.tar.gz
Source1: add_regex.8
Source2: convert_dt_node_props.8
Source3: extract_opal_dump.8
@ -30,13 +30,7 @@ Patch0: ppc64-diag-messagecatalog-location.patch
Patch2: ppc64-diag-scriptlocation.patch
Patch3: ppc64-diag-lpdscriptloc.patch
Patch4: ppc64-diag-permission.patch
# https://sourceforge.net/p/linux-diag/ppc64-diag/ci/608507ea8ed81209204feacbbde40e234d261141/
Patch5: ppc64-diag-service.patch
# 1657757 - diag_encl -d fails with error "Unable to read system"
Patch6: ppc64-diag-2.7.4-d42252e93ea4a80fbad5646399f29ebe2a54013f.patch
Patch7: ppc64-diag-2.7.4-1837ee17e201c66ed13ae1665a08a92fc42cb347.patch
Patch8: ppc64-diag-2.7.4-7be810122b48af0c095c1d1d5e8bd0b124026ed4.patch
Patch9: ppc64-diag-2.7.4-d2ec2733829b69f8b935f328f5cc2396e4c2af70.patch
Patch5: ppc64-diag-2.7.5-getopt-help.patch
%description
This package contains various diagnostic tools for PowerLinux.
@ -70,6 +64,9 @@ mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/ses_pages
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/dump
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/opal-elog
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/%{name}
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/%{name}/diag_disk
ln -sfv %{_sbindir}/usysattn $RPM_BUILD_ROOT/%{_sbindir}/usysfault
install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT/%{_mandir}/man8/
@ -78,6 +75,7 @@ install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} $RPM_BUILD
%doc README
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/ses_pages
%dir %{_localstatedir}/log/%{name}
%dir %{_localstatedir}/log/%{name}/diag_disk
%dir %{_localstatedir}/log/dump
%dir %{_localstatedir}/log/opal-elog
@ -113,6 +111,7 @@ if [ "$1" = "1" ]; then # first install
elif [ "$1" = "2" ]; then # upgrade
systemctl restart opal_errd.service >/dev/null
systemctl restart rtas_errd.service >/dev/null
systemctl daemon-reload > /dev/null 2>&1
fi
%preun
@ -124,6 +123,7 @@ if [ "$1" = "0" ]; then # last uninstall
systemctl -q disable rtas_errd.service
%{_libexecdir}/%{name}/ppc64_diag_setup --unregister >/dev/null
%{_libexecdir}/%{name}/lp_diag_setup --unregister >/dev/null
systemctl daemon-reload > /dev/null 2>&1
fi
%triggerin -- librtas
@ -135,6 +135,12 @@ fi
%changelog
* Wed Jun 19 2019 Than Ngo <than@redhat.com> - 2.7.5-2
- Resolves: #1721497, added /var/log/ppc64-diag and systemctl daemon-reload
* Tue Apr 30 2019 Than Ngo <than@redhat.com> - 2.7.5-1
- Resolves: #1664093, update to latest upstream 2.7.5
* Mon Dec 10 2018 Than Ngo <than@redhat.com> - 2.7.4-4
- install missing man pages