initial import after final review cleanups

This commit is contained in:
Karsten Hopp 2011-09-09 16:03:31 +02:00
parent e142533482
commit a2da6390c6
7 changed files with 313 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/ppc64-diag-2.4.2.tar.gz

View File

@ -0,0 +1,19 @@
diff -up ppc64-diag-2.4.2/scripts/rtas_errd.chkconfig ppc64-diag-2.4.2/scripts/rtas_errd
--- ppc64-diag-2.4.2/scripts/rtas_errd.chkconfig 2009-05-21 17:33:06.000000000 -0400
+++ ppc64-diag-2.4.2/scripts/rtas_errd 2011-09-05 06:38:28.393342923 -0400
@@ -17,11 +17,14 @@
# 8 - 199 reserved
#
+# chkconfig: - 95 5
+# description: Daemon to retrieve platform errors
+
### BEGIN INIT INFO
# Provides: rtas_errd
# Required-Start: $local_fs $syslog $time
# Required-Stop:
-# Default-Start: 2 3 5
+# Default-Start:
# Default-Stop: 0 1 4 6
# Short-Description: Daemon to retrieve platform errors
# Description: Starts rtas_errd daemon to retrieve platform errors

View File

@ -0,0 +1,60 @@
diff -up ppc64-diag-2.4.2/ela/Makefile.msg_loc ppc64-diag-2.4.2/ela/Makefile
--- ppc64-diag-2.4.2/ela/Makefile.msg_loc 2011-06-29 10:50:51.000000000 -0400
+++ ppc64-diag-2.4.2/ela/Makefile 2011-09-01 08:31:39.524245670 -0400
@@ -72,8 +72,8 @@ catalogs.o: catalogs.h
install: all
@$(call install_sbin,$(CMDS),$(DESTDIR))
- @$(call install_files,$(CATALOG),744,$(DESTDIR)/etc/ppc64-diag/message_catalog)
- @$(call install_files,$(CATALOG_REGEX),744,$(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex)
+ @$(call install_files,$(CATALOG),744,$(DESTDIR)/usr/share/ppc64-diag/message_catalog)
+ @$(call install_files,$(CATALOG_REGEX),744,$(DESTDIR)/usr/share/ppc64-diag/message_catalog/with_regex)
@$(call install_man,$(MANPAGES),$(DESTDIR))
$(INSTALL) -d -m 755 /var/log/ppc64-diag
@@ -82,7 +82,7 @@ clean:
uninstall:
@$(call uninstall_sbin,$(CMDS),$(DESTDIR))
- @$(call uninstall_files,$(CATALOG),$(DESTDIR)/etc/ppc64-diag/)
- @$(call uninstall_files,$(CATALOG_REGEX),$(DESTDIR)/etc/ppc64-diag/)
+ @$(call uninstall_files,$(CATALOG),$(DESTDIR)/usr/share/ppc64-diag/)
+ @$(call uninstall_files,$(CATALOG_REGEX),$(DESTDIR)/usr/share/ppc64-diag/)
@$(call uninstall_man,$(MANPAGES),$(DESTDIR)/usr/share/man/man8)
diff -up ppc64-diag-2.4.2/ela/catalogs.h.msg_loc ppc64-diag-2.4.2/ela/catalogs.h
--- ppc64-diag-2.4.2/ela/catalogs.h.msg_loc 2011-02-23 17:55:31.000000000 -0500
+++ ppc64-diag-2.4.2/ela/catalogs.h 2011-09-01 08:31:39.527245640 -0400
@@ -21,7 +21,7 @@ using namespace std;
#include <stdio.h>
#include <regex.h>
-#define ELA_CATALOG_DIR "/etc/ppc64-diag/message_catalog"
+#define ELA_CATALOG_DIR "/usr/share/ppc64-diag/message_catalog"
class Parser {
protected:
diff -up ppc64-diag-2.4.2/ela/explain_syslog.cpp.msg_loc ppc64-diag-2.4.2/ela/explain_syslog.cpp
--- ppc64-diag-2.4.2/ela/explain_syslog.cpp.msg_loc 2011-09-01 08:38:05.226391677 -0400
+++ ppc64-diag-2.4.2/ela/explain_syslog.cpp 2011-09-01 08:38:27.910165017 -0400
@@ -94,7 +94,7 @@ print_help(void)
printf(
"-b begin_time\tIgnore messages with timestamps prior to begin_time.\n"
"-C catalog_dir\tUse message catalog in catalog_dir. Defaults to\n"
-"\t\t\t/etc/ppc64-diag/message_catalog.\n"
+"\t\t\t/usr/share/ppc64-diag/message_catalog.\n"
"-d\t\tPrint debugging output on stderr.\n"
"-e end_time\tStop upon reading message with timestamp after end_time.\n"
"-h\t\tPrint this help text and exit.\n"
diff -up ppc64-diag-2.4.2/ela/syslog_to_svclog.cpp.msg_loc ppc64-diag-2.4.2/ela/syslog_to_svclog.cpp
--- ppc64-diag-2.4.2/ela/syslog_to_svclog.cpp.msg_loc 2011-07-11 05:43:41.000000000 -0400
+++ ppc64-diag-2.4.2/ela/syslog_to_svclog.cpp 2011-09-01 08:31:39.531245600 -0400
@@ -654,7 +654,7 @@ print_help(void)
printf(
"-b begin_time\tIgnore messages with timestamps prior to begin_time.\n"
"-C catalog_dir\tUse message catalog in catalog_dir. Defaults to\n"
-"\t\t\t/etc/ppc64-diag/message_catalog.\n"
+"\t\t\t/usr/share/ppc64-diag/message_catalog.\n"
"-d\t\tPrint debugging output on stderr.\n"
"-e end_time\tStop upon reading message with timestamp after end_time.\n"
"-F\t\tDon't stop at EOF; process newly logged messages as they occur.\n"

View File

@ -0,0 +1,111 @@
diff -up ppc64-diag-2.4.2/scripts/Makefile.scriptloc ppc64-diag-2.4.2/scripts/Makefile
--- ppc64-diag-2.4.2/scripts/Makefile.scriptloc 2011-09-05 05:58:06.720541401 -0400
+++ ppc64-diag-2.4.2/scripts/Makefile 2009-05-21 17:33:06.000000000 -0400
@@ -12,12 +12,12 @@ CFG_FILES = ppc64-diag.config
all: $(SCRIPTS) $(INIT_FILES) $(CFG_FILES)
install: all
- @$(call install_files,$(SCRIPTS),744,$(DESTDIR)/etc/ppc64-diag)
+ @$(call install_files,$(SCRIPTS),744,$(DESTDIR)/usr/libexec/ppc64-diag)
@$(call install_files,$(INIT_FILES),755,$(DESTDIR)/etc/init.d)
@$(call install_files,$(CFG_FILES),644,$(DESTDIR)/etc/ppc64-diag)
uninstall:
- @$(call uninstall_files,$(SCRIPTS),$(DESTDIR)/etc/ppc64-diag)
+ @$(call uninstall_files,$(SCRIPTS),$(DESTDIR)/usr/libexec/ppc64-diag)
@$(call uninstall_files,$(INIT_FILES),$(DESTDIR)/etc/init.d)
@$(call uninstall_files,$(CFG_FILES),$(DESTDIR)/etc/ppc64-diag)
diff -up ppc64-diag-2.4.2/scripts/ppc64_diag_mkrsrc.scriptloc ppc64-diag-2.4.2/scripts/ppc64_diag_mkrsrc
--- ppc64-diag-2.4.2/scripts/ppc64_diag_mkrsrc.scriptloc 2011-09-05 06:04:22.481785543 -0400
+++ ppc64-diag-2.4.2/scripts/ppc64_diag_mkrsrc 2011-09-05 06:02:45.519756640 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -I /etc/ppc64-diag
+#! /usr/bin/perl -I /usr/libexec/ppc64-diag
#
# This script is to be registered with servicelog as a notification tool. It
# is responsible for creating a new IBM.ServiceEvent RMC resource when a
@@ -14,7 +14,7 @@
# Copyright (C) 2005, 2007 IBM Corporation
#
-require "/etc/ppc64-diag/servevent_parse.pl";
+require "/usr/libexec/ppc64-diag/servevent_parse.pl";
# Check to make sure that devices.chrp.base.ServiceRM is installed
$check = `/bin/rpm -q devices.chrp.base.ServiceRM 2>/dev/null`;
diff -up ppc64-diag-2.4.2/scripts/ppc64_diag_notify.scriptloc ppc64-diag-2.4.2/scripts/ppc64_diag_notify
--- ppc64-diag-2.4.2/scripts/ppc64_diag_notify.scriptloc 2011-09-05 06:04:37.194638501 -0400
+++ ppc64-diag-2.4.2/scripts/ppc64_diag_notify 2011-09-05 06:01:43.164377573 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -I /etc/ppc64-diag
+#! /usr/bin/perl -I /usr/libexec/ppc64-diag
#
# This script is to be registered with servicelog as a notification tool. It
# is responsible for sending out e-mail notifications of new ppc64 platform
@@ -9,7 +9,7 @@
use Getopt::Long;
-require "/etc/ppc64-diag/servevent_parse.pl";
+require "/usr/libexec/ppc64-diag/servevent_parse.pl";
sub usage {
print "$0 [OPTIONS]\n";
diff -up ppc64-diag-2.4.2/scripts/ppc64_diag_servagent.scriptloc ppc64-diag-2.4.2/scripts/ppc64_diag_servagent
--- ppc64-diag-2.4.2/scripts/ppc64_diag_servagent.scriptloc 2011-09-05 06:04:45.922549428 -0400
+++ ppc64-diag-2.4.2/scripts/ppc64_diag_servagent 2011-09-05 06:02:34.317866330 -0400
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -I /etc/ppc64-diag
+#! /usr/bin/perl -I /usr/libexec/ppc64-diag
#
# This script is to be registered with servicelog as a notification tool. It
# is responsible for invoking Electronic Service Agent in response to a
@@ -12,7 +12,7 @@
# Copyright (C) 2007 IBM Corporation
#
-require "/etc/ppc64-diag/servevent_parse.pl";
+require "/usr/libexec/ppc64-diag/servevent_parse.pl";
if (!-e "/usr/svcagent/bin/callsa2") {
# eSA is not installed; exit quietly
diff -up ppc64-diag-2.4.2/scripts/ppc64_diag_setup.scriptloc ppc64-diag-2.4.2/scripts/ppc64_diag_setup
--- ppc64-diag-2.4.2/scripts/ppc64_diag_setup.scriptloc 2011-09-05 06:05:06.033350396 -0400
+++ ppc64-diag-2.4.2/scripts/ppc64_diag_setup 2011-09-05 06:00:35.584058181 -0400
@@ -76,19 +76,19 @@ sub unregister {
@notification_tools = (
- ["/etc/ppc64-diag/ppc64_diag_notify -q -e root -l /var/log/platform",
+ ["/usr/libexec/ppc64-diag/ppc64_diag_notify -q -e root -l /var/log/platform",
"--match='serviceable=1' ".
"--type=EVENT --method=pairs_stdin"],
- ["/etc/ppc64-diag/ppc64_diag_mkrsrc",
+ ["/usr/libexec/ppc64-diag/ppc64_diag_mkrsrc",
"--match='serviceable=1' ".
"--type=EVENT --method=pairs_stdin"],
- ["/etc/ppc64-diag/ppc64_diag_servagent",
+ ["/usr/libexec/ppc64-diag/ppc64_diag_servagent",
"--match='serviceable=1 and (type=2 or type=3)' ".
"--type=EVENT --method=pairs_stdin"],
- ["/etc/ppc64-diag/ppc64_diag_migrate",
+ ["/usr/libexec/ppc64-diag/ppc64_diag_migrate",
"--match=\'refcode=\"#MIGRATE\" and serviceable=0\' ".
"--type=EVENT --method=pairs_stdin"],
);
diff -up ppc64-diag-2.4.2/scripts/rtas_errd.scriptloc ppc64-diag-2.4.2/scripts/rtas_errd
--- ppc64-diag-2.4.2/scripts/rtas_errd.scriptloc 2011-09-05 05:59:14.982858075 -0400
+++ ppc64-diag-2.4.2/scripts/rtas_errd 2011-09-05 05:59:34.531662814 -0400
@@ -49,7 +49,7 @@ case "$1" in
echo "registering ppc64-diag with system"
rm -f /var/cache/ppc64-diag.registered
mkdir -v /var/cache/ppc64-diag.registered
- /etc/ppc64-diag/ppc64_diag_setup --register
+ /usr/libexec/ppc64-diag/ppc64_diag_setup --register
fi
echo -n "Starting rtas_errd (platform error handling) daemon: "
if [[ $INSSERV -eq 1 ]]; then

15
ppc64-diag.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=ppc64-diag rtas_errd (platform error handling) Service
After=syslog.target
[Service]
Type=forking
ExecStart=/usr/libexec/ppc64-diag/rtas_errd.init start
ExecStop=/usr/libexec/ppc64-diag/rtas_errd.init stop
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target

106
ppc64-diag.spec Normal file
View File

@ -0,0 +1,106 @@
Name: ppc64-diag
Version: 2.4.2
Release: 3%{?dist}
Summary: Linux for Power Platform Diagnostics
URL: http://sourceforge.net/projects/linux-diag/files/ppc64-diag/
Group: System Environment/Base
License: EPL
ExclusiveArch: ppc ppc64
BuildRequires: libservicelog-devel, flex, perl, byacc, librtas-devel
BuildRequires: libvpd-devel, systemd-units
Requires: servicelog, lsvpd
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://downloads.sourceforge.net/project/linux-diag/ppc64-diag/%{version}/%{name}-%{version}.tar.gz
Source1: ppc64-diag.service
Patch0: ppc64-diag-2.4.2-messagecatalog-location.patch
Patch1: ppc64-diag-2.4.2-chkconfig.patch
Patch2: ppc64-diag-2.4.2-scriptlocation.patch
%description
Platform diagnostics for Linux for Power writes events reported by the
System p or System i platform firmware to the service log, provides automated
responses to urgent events such as environmental conditions and predictive
failures, and provides notifications of the event to system administrators
or connected service frameworks. Some error log analysis parameters can be
configured in /etc/ppc64-diag/ppc64-diag.config.
%prep
%setup -q
%patch0 -p1 -b .msg_loc
%patch1 -p1 -b .chkconfig
%patch2 -p1 -b .script_loc
%build
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
chmod 644 COPYRIGHT
rm -f $RPM_BUILD_ROOT/usr/share/doc/packages/ppc64-diag/COPYRIGHT
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/%{name}
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/rtas_errd $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}
strip -s $RPM_BUILD_ROOT/%{_sbindir}/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root,-)
%doc COPYRIGHT
%dir %{_sysconfdir}/%{name}
%{_mandir}/man8/*
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/ppc64-diag.config
%attr(755,root,root) %{_sbindir}/*
%dir %{_datadir}/%{name}
%dir %attr(755,root,root) %{_datadir}/%{name}/message_catalog/
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_migrate
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_mkrsrc
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_notify
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_servagent
%attr(755,root,root) %{_libexecdir}/%{name}/ppc64_diag_setup
%attr(644,root,root) %{_libexecdir}/%{name}/servevent_parse.pl
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/cxgb3
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/e1000e
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/exceptions
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/gpfs
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/reporters
%attr(644,root,root) %{_datadir}/%{name}/message_catalog/with_regex/*
%attr(755,root,root) %{_sysconfdir}/rc.powerfail
%attr(755,root,root) %{_libexecdir}/%{name}/rtas_errd
%attr(644,root,root) %{_unitdir}/ppc64-diag.service
%post
# Post-install script --------------------------------------------------
%{_datadir}/%{name}/ppc64_diag_setup --register >/dev/null
if [ "$1" = "2" ]; then # upgrade
%{_libexecdir}/%{name}/rtas_errd restart
fi
%preun
# Pre-uninstall script -------------------------------------------------
if [ "$1" = "0" ]; then # last uninstall
%{_libexecdir}/%{name}/rtas_errd stop
%{_datadir}/%{name}/ppc64_diag_setup --unregister >/dev/null
fi
%triggerin -- librtas
# trigger on librtas upgrades ------------------------------------------
if [ "$2" = "2" ]; then
%{_libexecdir}/%{name}/rtas_errd restart
fi
%changelog
* Fri Sep 09 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-3
- add buildrequirement systemd-units for _unitdir rpm macro
- move helper scripts to libexecdir/ppc64-diag
* Wed Sep 07 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-2
- additional fixes for Fedora package review (bugzilla #736062)
* Wed Aug 17 2011 Karsten Hopp <karsten@redhat.com> 2.4.2-1
- initial Fedora version, based on IBM spec file with rpmlint cleanups
- move scripts to /usr/share/ppc-diag
- don't start service automatically after install

View File

@ -0,0 +1 @@
a6425e3d1fff74fdda4335136196eecf ppc64-diag-2.4.2.tar.gz