debian/0000775000000000000000000000000012321276174007175 5ustar debian/copyright0000664000000000000000000002735512317161506011141 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ppc64-diag Upstream-Contact: Vasant Hegde Source: http://sourceforge.net/projects/linux-diag/files/ppc64-diag/ Copyright: 2000-2014 International Business Machines Corporation and others. License: EPL-1.0 Files: * Copyright: 2000-2014 International Business Machines Corporation and others. License: EPL-1.0 Files: debian/* Copyright: 2014 Frederic Bonnard License: EPL-1.0 License: EPL-1.0 Eclipse Public License - v 1.0 . THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. . 1. DEFINITIONS . "Contribution" means: . a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: . i) changes to the Program, and . ii) additions to the Program; . where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. . "Contributor" means any person or entity that distributes the Program. . "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. . "Program" means the Contributions distributed in accordance with this Agreement. . "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. . 2. GRANT OF RIGHTS . a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. . b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. . c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. . d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. . 3. REQUIREMENTS . A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: . a) it complies with the terms and conditions of this Agreement; and . b) its license agreement: . i) effectively disclaims on behalf of all Contributors all warranties andi conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; . ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; . iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and . iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. . When the Program is made available in source code form: . a) it must be made available under this Agreement; and . b) a copy of this Agreement must be included with each copy of the Program. . Contributors may not remove or alter any copyright notices contained within the Program. . Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. . 4. COMMERCIAL DISTRIBUTION . Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. . For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. . 5. NO WARRANTY . EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. . 6. DISCLAIMER OF LIABILITY . EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,i SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. . 7. GENERAL . If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. . If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. . All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. . Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. . This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. debian/prerm0000664000000000000000000000054612317160436010250 0ustar #!/bin/sh # prerm script for ppc64-diag # # see: dh_installdeb(1) set -e case "$1" in remove) /etc/ppc64-diag/ppc64_diag_setup --unregister >/dev/null /etc/ppc64-diag/lp_diag_setup --unregister >/dev/null ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/ppc64-diag.links0000664000000000000000000000004612317715010012065 0ustar usr/sbin/usysattn usr/sbin/usysfault debian/changelog0000664000000000000000000000155512321276173011054 0ustar ppc64-diag (2.6.4-0ubuntu4) trusty; urgency=medium * Add missing build-dependency on libvpd-dev. -- Steve Langasek Wed, 09 Apr 2014 09:59:38 -0700 ppc64-diag (2.6.4-0ubuntu3) trusty; urgency=medium [ Frédéric Bonnard ] * Changing rights message catalog * Fixing lintian error init.d-script-missing-dependency-on-remote_fs * Fixing lintian check : init.d-script-missing-start [ Steve Langasek ] * Fix upstart pre-start scripts to actually stop the job when it's meant to not run. * Clean up cat|grep|awk pipeline in init scripts -- Steve Langasek Wed, 02 Apr 2014 15:09:16 -0700 ppc64-diag (2.6.4-0ubuntu2) trusty; urgency=medium * Adding support for opal_errd and a fix for rtas * Initial release. -- Frédéric Bonnard Mon, 24 Mar 2014 09:58:14 +0000 debian/compat0000664000000000000000000000000212314325475010374 0ustar 9 debian/ppc64-diag.rtas_errd.init0000775000000000000000000001112612317160436013706 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: rtas_errd # Required-Start: $local_fs $remote_fs $syslog $time # Required-Stop: $local_fs $remote_fs $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Daemon to retrieve platform errors # Description: Starts rtas_errd daemon to retrieve platform errors # and perform error log analysis. ### END INIT INFO # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="rtas_errd" NAME=rtas_errd DAEMON=/usr/sbin/rtas_errd DAEMON_ARGS="" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present # and status_of_proc is working. . /lib/lsb/init-functions VERBOSE=yes # # Function that starts the daemon/service # do_start() { if test ! -d /var/cache/ppc64-diag.registered ; then 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 fi # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # The above code will not work for interpreted scripts, use the next # six lines below instead (Ref: #643337, start-stop-daemon(8) ) #start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \ # --name $NAME --test > /dev/null \ # || return 1 #start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \ # --name $NAME -- $DAEMON_ARGS \ # || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac debian/watch0000664000000000000000000000014112314325475010223 0ustar version=3 http://sf.net/linux-diag/ppc64-diag-(\d\S*).(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) debian/ppc64-diag.rtas_errd.upstart0000664000000000000000000000073712317160436014450 0ustar # rtas_errd - Daemon to retrieve platform errors description "Daemon to retrieve platform errors" start on runlevel [2345] stop on runlevel [!2345] expect fork respawn respawn limit 10 5 pre-start script if test ! -d /var/cache/ppc64-diag.registered ; then 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 fi end script exec /usr/sbin/rtas_errd debian/postinst0000664000000000000000000000041612317161775011011 0ustar #!/bin/sh # postinst script for ppc64-diag # # see: dh_installdeb(1) set -e case "$1" in configure) /etc/ppc64-diag/ppc64_diag_setup --register >/dev/null /etc/ppc64-diag/lp_diag_setup --register >/dev/null #/etc/init.d/rtas_errd start ;; esac #DEBHELPER# debian/source/0000775000000000000000000000000012314325475010476 5ustar debian/source/format0000664000000000000000000000001412314325475011704 0ustar 3.0 (quilt) debian/rules0000775000000000000000000000212612317723730010256 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS %: dh $@ override_dh_auto_install: install -d debian/ppc64-diag make -j1 install DESTDIR=$(CURDIR)/debian/ppc64-diag AM_UPDATE_INFO_DIR=no chmod 644 debian/ppc64-diag/etc/ppc64-diag/servevent_parse.pl find $(CURDIR)/debian/ppc64-diag/etc/ppc64-diag/message_catalog -type f -print0 | \ xargs -0 chmod a-x install -d debian/ppc64-diag/etc/ppc64-diag/ses_pages override_dh_installinit: dh_installinit --name=rtas_errd dh_installinit --name=opal_errd debian/control0000664000000000000000000000216412321276156010603 0ustar Source: ppc64-diag Section: misc Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Frederic Bonnard Build-Depends: debhelper (>= 9.0.0), flex, bison, librtas-dev, librtasevent-dev, libservicelog-dev, libncurses5-dev, libsqlite3-dev, libvpd-dev Standards-Version: 3.9.5 Homepage: http://sourceforge.net/projects/linux-diag/files/ppc64-diag/ Package: ppc64-diag Architecture: powerpc ppc64 ppc64el Depends: ${shlibs:Depends}, ${misc:Depends}, lsvpd, servicelog, powerpc-ibm-utils (>= 1.2.15), lsb-base Description: Platform error log analysis tool and rtas_errd daemon This package contains various diagnostic tools for PowerLinux. These tools captures the diagnostic events from Power Systems platform firmware, SES enclosures and device drivers, and write events to servicelog database. It also provides automated responses to urgent events such as environmental conditions and predictive failures, if appropriate modifies the FRUs fault indicator(s) and provides event notification to system administrators or connected service frameworks. debian/patches/0000775000000000000000000000000012314325475010625 5ustar debian/patches/fix_ncurses_menu_header_on_debian0000664000000000000000000000065012314325475017433 0ustar Subject: Fix menu.h include On Debian and Fedora /usr/include/menu.h exists. On Fedora /usr/include/ncurses/menu.h is a link on /usr/include/menu.h Signed-off-by: Frédéric Bonnard --- a/lpd/lp_diag.c +++ b/lpd/lp_diag.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include "platform.c" debian/patches/hardening0000664000000000000000000000620312314325475012510 0ustar --- a/rtas_errd/epow.c +++ b/rtas_errd/epow.c @@ -109,7 +109,7 @@ va_end(ap); log_msg(event, buf); - snprintf(event->addl_text, ADDL_TEXT_MAX, buf); + snprintf(event->addl_text, ADDL_TEXT_MAX, "%s", buf); } /** --- a/rtas_errd/dump.c +++ b/rtas_errd/dump.c @@ -161,7 +161,7 @@ goto scanlog_error; } - out = open(scanlog_filename, O_WRONLY | O_CREAT | O_TRUNC); + out = open(scanlog_filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU); if (out <= 0) { log_msg(NULL, "Could not open %s for writing, %s", scanlog_filename, strerror(errno)); --- a/rtas_errd/files.c +++ b/rtas_errd/files.c @@ -671,7 +671,7 @@ va_end(ap); len = reformat_msg(buf); - fprintf(stdout, buf); + fprintf(stdout, "%s", buf); fflush(stdout); } --- a/rtas_errd/config.c +++ b/rtas_errd/config.c @@ -79,7 +79,7 @@ * started then skip ahead to the next line and * return that point as the end of the search. */ - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); while ((str < str_end) && (*str++ != '\n')); (*line_no)++; @@ -97,7 +97,7 @@ break; } - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); return str + 1; break; @@ -112,7 +112,7 @@ (*line_no)++; str++; } else { - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); } return str; @@ -126,10 +126,10 @@ * a token on their own. */ if (start == NULL) { - snprintf(tok, 2, str); + snprintf(tok, 2, "%s", str); str++; } else { - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); } return str; @@ -150,10 +150,10 @@ else str++; } - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); str++; } else { - snprintf(tok, str - start + 1, start); + snprintf(tok, str - start + 1, "%s", start); } return str; @@ -210,7 +210,7 @@ if (start == NULL) return NULL; - offset += sprintf(buf, tok); + offset += sprintf(buf, "%s", tok); start = get_token(start, end, tok, line_no); while ((start != NULL) && (tok[0] != '\n')) { --- a/rtas_errd/v6ela.c +++ b/rtas_errd/v6ela.c @@ -359,7 +359,7 @@ offset += sprintf(buffer + offset, msg, asctime(date)); else - offset += sprintf(buffer + offset, msg); + offset += sprintf(buffer + offset, "%s", msg); } if (menu_num == 0) { --- a/rtas_errd/servicelog.c +++ b/rtas_errd/servicelog.c @@ -230,7 +230,7 @@ } else { event->sl_entry->description = (char *)malloc(txtlen+1); snprintf(event->sl_entry->description, txtlen, - event->addl_text); + "%s", event->addl_text); } } --- a/diags/diag_encl.c +++ b/diags/diag_encl.c @@ -244,7 +244,7 @@ rc = servicelog_open(&slog, 0); if (rc != 0) { - fprintf(stderr, servicelog_error(slog)); + fprintf(stderr, "%s", servicelog_error(slog)); return 0; } @@ -253,7 +253,7 @@ servicelog_close(slog); if (rc != 0) { - fprintf(stderr, servicelog_error(slog)); + fprintf(stderr, "%s", servicelog_error(slog)); return 0; } debian/patches/shell_fix_on_debian0000664000000000000000000000127512314325475014530 0ustar --- a/rules.mk +++ b/rules.mk @@ -13,9 +13,9 @@ # resolves the root directory at which this build is occuring ROOT_DIR = \ $(shell \ - while [[ `pwd` != "/" ]]; \ + while [ `pwd` != "/" ]; \ do \ - if [[ -f `pwd`/$(SPECFILENAME) ]]; \ + if [ -f `pwd`/$(SPECFILENAME) ]; \ then \ echo `pwd`; \ break; \ debian/patches/series0000664000000000000000000000010012314325475012031 0ustar shell_fix_on_debian hardening fix_ncurses_menu_header_on_debian debian/ppc64-diag.opal_errd.upstart0000664000000000000000000000074012317160624014423 0ustar # opal_errd - Daemon to retrieve platform errors description "Daemon to retrieve platform errors" start on runlevel [2345] stop on runlevel [!2345] expect fork respawn respawn limit 10 5 pre-start script # This daemon runs only on PowerNV platform if [ ! -e "/sys/firmware/opal/elog" ]; then PLATFORM=$(awk '/PLATFORM/ {print $3}' /proc/cpuinfo) echo "opal_errd daemon is not supported on the $PLATFORM platform" stop exit 0 fi end script exec /usr/sbin/opal_errd debian/ppc64-diag.opal_errd.init0000775000000000000000000001112712317160475013674 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: opal_errd # Required-Start: $local_fs $remote_fs $syslog $time # Required-Stop: $local_fs $remote_fs $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Daemon to retrieve platform errors/events # Description: Starts opal_errd daemon to retrieve platform errors, # parse the error and log to syslog. ### END INIT INFO # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="opal_errd" NAME=opal_errd DAEMON=/usr/sbin/opal_errd DAEMON_ARGS="" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present # and status_of_proc is working. . /lib/lsb/init-functions # This daemon runs only on PowerNV platform if [ ! -e "/sys/firmware/opal/elog" ]; then PLATFORM=$(awk '/PLATFORM/ {print $3}' /proc/cpuinfo) echo "opal_errd daemon is not supported on the $PLATFORM platform" exit 0 fi VERBOSE=yes # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # The above code will not work for interpreted scripts, use the next # six lines below instead (Ref: #643337, start-stop-daemon(8) ) #start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \ # --name $NAME --test > /dev/null \ # || return 1 #start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \ # --name $NAME -- $DAEMON_ARGS \ # || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac