Mailinglist Archive: opensuse-commit (1003 mails)

< Previous Next >
commit kdump-helpers
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Wed, 20 Jun 2007 01:34:59 +0200
  • Message-id: <20070619233459.C4777678182@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package kdump-helpers
checked in at Wed Jun 20 01:34:59 CEST 2007.

--------
--- kdump-helpers/kdump-helpers.changes 2007-06-11 23:06:31.000000000 +0200
+++ /mounts/work_src_done/STABLE/kdump-helpers/kdump-helpers.changes    2007-06-18 14:03:34.326816000 +0200
@@ -1,0 +2,10 @@
+Mon Jun 18 13:57:15 CEST 2007 - bwalle@xxxxxxx
+
+- update to 0.2.3
+  o fixed read-debuglink
+  o changed NFS URL, no separation between share and directory
+  o added kdump-led_blink to blink LEDs (for broken VGA console)
+  o added mkinitrd script (for blink) and /sbin/mkinitrd to
+    %postin and %postun
+
+-------------------------------------------------------------------
@@ -4 +14 @@
-- update to 0.2.1
+- update to 0.2.2

Old:
----
  kdump-helpers-0.2.2.tar.bz2

New:
----
  02-keyboard-blink.sh
  kdump-helpers-0.2.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdump-helpers.spec ++++++
--- /var/tmp/diff_new_pack.e32708/_old  2007-06-20 01:34:19.000000000 +0200
+++ /var/tmp/diff_new_pack.e32708/_new  2007-06-20 01:34:19.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package kdump-helpers (Version 0.2.2)
+# spec file for package kdump-helpers (Version 0.2.3)
 #
 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
@@ -13,13 +13,16 @@
 Name:           kdump-helpers
 License:        GNU General Public License (GPL)
 BuildRequires:  libelf zlib-devel
-Version:        0.2.2
+Version:        0.2.3
 Release:        1
 Requires:       curl openssh
 Summary:        Helper script for kexec-tools
 Group:          System/Kernel
+Requires(post): mkinitrd
+BuildRequires:  mkinitrd
 Url:            http://www.suse.de/~bwalle/kdump-helpers/
 Source:         %{name}-%{version}.tar.bz2
+Source1:        02-keyboard-blink.sh
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -39,9 +42,20 @@
 make CFLAGS="$RPM_OPT_FLAGS"
 make
 
+%post
+if [ ! -e /.buildenv ] ; then
+  /sbin/mkinitrd
+fi
+
+%postun
+if [ ! -e /.buildenv ] ; then
+  /sbin/mkinitrd
+fi
+
 %install
-mkdir -p $RPM_BUILD_ROOT/
 make DESTDIR=$RPM_BUILD_ROOT install
+mkdir -p $RPM_BUILD_ROOT/lib/mkinitrd/boot
+cp %{SOURCE1} $RPM_BUILD_ROOT/lib/mkinitrd/boot
 
 %clean
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@ -58,14 +72,23 @@
 %{_sbindir}/kdump-save_dump
 %{_sbindir}/kdump-cleanup_dumps
 %{_sbindir}/kdump-cat_progress
+%{_sbindir}/kdump-led_blink
 %{_mandir}/man1/*
 %{_mandir}/man8/*
 %dir %{_datadir}/kdump-helpers
 %{_datadir}/kdump-helpers/kdump-shared_functions
+/lib/mkinitrd/boot/02-keyboard-blink.sh
 
 %changelog
+* Mon Jun 18 2007 - bwalle@xxxxxxx
+- update to 0.2.3
+  o fixed read-debuglink
+  o changed NFS URL, no separation between share and directory
+  o added kdump-led_blink to blink LEDs (for broken VGA console)
+  o added mkinitrd script (for blink) and /sbin/mkinitrd to
+  %%postin and %%postun
 * Mon Jun 11 2007 - bwalle@xxxxxxx
-- update to 0.2.1
+- update to 0.2.2
   o add read-debuglink
 * Sun Jun 10 2007 - bwalle@xxxxxxx
 - update to 0.2.1

++++++ kdump-helpers-0.2.2.tar.bz2 -> kdump-helpers-0.2.3.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/ChangeLog new/kdump-helpers-0.2.3/ChangeLog
--- old/kdump-helpers-0.2.2/ChangeLog   2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/ChangeLog   2007-06-14 23:41:14.000000000 +0200
@@ -1,3 +1,14 @@
+2007-06-14  Bernhard Walle <bwalle@xxxxxxx>
+
+       * modify the NFS URL to not separate share and path since this is not
+         needed, it's possible to mount any subdirectory under the exported
+         path
+       * added kdump-led_blink to blink the keyboard LEDs
+
+2007-06-12  Bernhard Walle <bwalle@xxxxxxx>
+
+       * fixed read-debuglink for files in the current directory
+
 2007-06-11  Bernhard Walle <bwalle@xxxxxxx>
 
        * added read-debuglink
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/doc/kdump-led_blink.pod new/kdump-helpers-0.2.3/doc/kdump-led_blink.pod
--- old/kdump-helpers-0.2.2/doc/kdump-led_blink.pod     1970-01-01 01:00:00.000000000 +0100
+++ new/kdump-helpers-0.2.3/doc/kdump-led_blink.pod     2007-06-14 23:41:14.000000000 +0200
@@ -0,0 +1,61 @@
+=head1 NAME
+
+kdump-led_blink - blinks keyboard LEDs
+
+
+=head1 SYNOPSIS
+
+B<kdump-led_blink> [I<-i interval>] [I<-f>]
+
+
+=head1 DESCRIPTION
+
+Makes keyboard LEDs blinking without changing the actual state. The program is
+intended to be used from initrd as daemon. It was developed for kdump because
+often the VGA console is not restored and the user gets some feedback that the
+system is doing something.
+
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-i> I<interval> | B<--interval> I<interval>
+
+Use I<interval> (in ms) instead of 500 ms.
+
+=item B<-f>  | B<--foreground>
+
+Don't run as daemon.
+
+=item B<-h> | B<--help>
+
+Prints out a short help string.
+
+=item B<-v> | B<--version>
+
+Prints version information.
+
+
+=head1 BUGS
+
+That program doesn't contain bugs. Maybe it contains hidden features. If you
+discover such a hidden feature and you want it to be removed, please report
+at L<http://bugzilla.novell.com>.
+
+
+=head1 AUTHOR
+
+Bernhard Walle E<lt>bwalle@xxxxxxxx<gt>
+
+
+=head1 NO WARRANTIES
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+more details.
+
+
+=cut
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/doc/kdump-url_parser.pod new/kdump-helpers-0.2.3/doc/kdump-url_parser.pod
--- old/kdump-helpers-0.2.2/doc/kdump-url_parser.pod    2007-06-10 23:10:02.000000000 +0200
+++ new/kdump-helpers-0.2.3/doc/kdump-url_parser.pod    2007-06-14 11:44:30.000000000 +0200
@@ -157,19 +157,13 @@
 to specify options. That shound't be necessary since this is an implementation
 detail and not suited for URLs.
 
-I<Format:> nfs://I<host>:I<share>:I<path>
+I<Format:> nfs://I<host>I<path>
 
-I<host> is the hostname, as DNS name or dotted decimal address. I<share>
-specifies the path that is exported via NFS in the I</etc/exports> of the
-I<host>. The I<path> is then the remote path below the I<share>.
-
-Please note that the separtation between I<share> and I<path> is necessary
-because a I<share> can contain several slashes. The implementation should not
-be forced to try out several mounts until the "right" export is found. For
-example, if you specify C</var/log/dump>, it could be possible that just
-C</> is exported (with C</var/log/dump> as path), or C</var> (with
-C</log/dump> as path) or C</var/log> (with C</dump> as path) or even
-C</var/log/dump> (with C</> as path).
+I<host> is the hostname, as DNS name or dotted decimal address. I<path>
+specifies the path that is exported via NFS in the I</etc/exports> (or a
+dubdirectory of a path that is exported).
+
+Note: I<--share> is not used with NFS.
 
 
 I<Examples:>
@@ -178,11 +172,11 @@
 
 =item *
 
-nfs://neptunium:/var/log/dump:/
+nfs://neptunium/var/log/dump
 
 =item *
 
-nfs://neptunium.suse.de:/var/log:/dump
+nfs://neptunium.suse.de:/var/log/dump
 
 =back
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/doc/Makefile new/kdump-helpers-0.2.3/doc/Makefile
--- old/kdump-helpers-0.2.2/doc/Makefile        2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/doc/Makefile        2007-06-14 23:41:14.000000000 +0200
@@ -9,12 +9,20 @@
 
 MANPAGES_8 = kdump-save_dump.8.gz kdump-url_parser.8.gz kdump-cat_progress.8.gz \
        kdump-copy_progress.8.gz kdump-copy_kernel.8.gz kdump-helper.8.gz \
-       kdump-identify_kernel.8.gz
+       kdump-identify_kernel.8.gz kdump-led_blink.8.gz
 MANPAGES_1 = read-debuglink.1.gz
 
 all: $(MANPAGES_8) $(MANPAGES_1)
 
 #
+# kdump-led_blink
+kdump-led_blink.8: kdump-led_blink.pod
+       $(POD2MAN) --section=1 --release=$(VERSION) --center="read-debuglink" $< $@
+
+kdump-led_blink.8.gz: kdump-led_blink.8
+       $(GZIP) -c $< > $@
+
+#
 # kdump-identify_kernel
 read-debuglink.1: read-debuglink.pod
        $(POD2MAN) --section=1 --release=$(VERSION) --center="read-debuglink" $< $@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/scripts/kdump-cat_progress new/kdump-helpers-0.2.3/scripts/kdump-cat_progress
--- old/kdump-helpers-0.2.2/scripts/kdump-cat_progress  2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/scripts/kdump-cat_progress  2007-06-14 11:58:14.000000000 +0200
@@ -19,7 +19,7 @@
 
 use Getopt::Long;
 
-my $VERSION = "0.2.2";
+my $VERSION = "0.2.3";
 my $BLOCKSIZE = 1024;
 my $PROGRESS_INTERVAL = 1; # seconds
 my $PROGRESS_LOOPS = 50;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/scripts/kdump-copy_progress new/kdump-helpers-0.2.3/scripts/kdump-copy_progress
--- old/kdump-helpers-0.2.2/scripts/kdump-copy_progress 2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/scripts/kdump-copy_progress 2007-06-14 11:58:14.000000000 +0200
@@ -20,7 +20,7 @@
 use POSIX ":sys_wait_h";
 use Getopt::Long;
 
-my $VERSION = "0.2.2";
+my $VERSION = "0.2.3";
 
 ###############################################################################
 # Outputs usage information
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/scripts/kdump-save_dump new/kdump-helpers-0.2.3/scripts/kdump-save_dump
--- old/kdump-helpers-0.2.2/scripts/kdump-save_dump     2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/scripts/kdump-save_dump     2007-06-14 11:44:30.000000000 +0200
@@ -27,6 +27,7 @@
 CAT_PROGRESS=kdump-cat_progress
 MOUNTPOINT=/mnt
 VMCORE=/proc/vmcore
+SUFFIX=$(date +"%Y-%m-%d-%H:%M")
 
 ###############################################################################
 # Checks if makedumpfile must be used
@@ -224,6 +225,8 @@
         return 1
     fi
 
+    path=$path/$SUFFIX
+
     #
     # mount the stuff
     mountcmd="$mountcmd //$host/$share $MOUNTPOINT"
@@ -257,25 +260,25 @@
 # CIFS
 function copy_nfs()
 {
-    local share=$($KDUMP_URL_PARSER --share $KDUMP_SAVEDIR)
     local host=$($KDUMP_URL_PARSER --host $KDUMP_SAVEDIR)
     local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)
+    local mountpoint=$(dirname $path)
     local mountcmd="mount"
 
-    if [ -z "$share" -o -z "$host" -o -z "$path" ] ; then
+    if [ -z "$path" -o -z "$host" ] ; then
         echo "URL invalid for NFS"
         return 1
     fi
 
     #
     # mount the stuff
-    mountcmd="$mountcmd $host:$share $MOUNTPOINT"
+    mountcmd="$mountcmd $host:$path $MOUNTPOINT"
     print_debug "Executing $mountcmd"
     $mountcmd || return 1
 
     #
     # create the directory and copy the stuff
-    do_copy_file $MOUNTPOINT$path
+    do_copy_file $MOUNTPOINT/$SUFFIX
     if [ "$?" -ne 0 ] ; then
         umount $MOUNTPOINT
         return 1
@@ -297,7 +300,7 @@
     local password=$($KDUMP_URL_PARSER --password $KDUMP_SAVEDIR)
     local port=$($KDUMP_URL_PARSER --port $KDUMP_SAVEDIR)
     local host=$($KDUMP_URL_PARSER --host $KDUMP_SAVEDIR)
-    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)
+    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)/$SUFFIX
     local curl="curl --ftp-create-dirs"
     local url=
 
@@ -366,7 +369,7 @@
     local user=$($KDUMP_URL_PARSER --user $KDUMP_SAVEDIR)
     local port=$($KDUMP_URL_PARSER --port $KDUMP_SAVEDIR)
     local host=$($KDUMP_URL_PARSER --host $KDUMP_SAVEDIR)
-    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)
+    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)/$SUFFIX
     local scp=scp
     local ssh=ssh
     local scpurl=
@@ -431,7 +434,7 @@
 # File
 function copy_file()
 {
-    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)
+    local path=$($KDUMP_URL_PARSER --path $KDUMP_SAVEDIR)/$SUFFIX
 
     if [ -z "$path" ] ; then
         return 1
@@ -490,12 +493,6 @@
     fi
 fi
 
-
-#
-# add the date 
-KDUMP_SAVEDIR=$KDUMP_SAVEDIR/$(date +"%Y-%m-%d-%H:%M")
-
-
 #
 # and now handle the protocols
 case "$protocol" in
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/scripts/kdump-url_parser new/kdump-helpers-0.2.3/scripts/kdump-url_parser
--- old/kdump-helpers-0.2.2/scripts/kdump-url_parser    2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/scripts/kdump-url_parser    2007-06-14 11:58:14.000000000 +0200
@@ -19,7 +19,7 @@
 
 use Getopt::Long;
 
-my $VERSION = "0.2.2";
+my $VERSION = "0.2.3";
 my %ALIASES = (
     'smb'       => 'cifs',
     'scp'       => 'ssh'
@@ -181,21 +181,17 @@
 # port and hostname
 if (($protocol eq "http") or ($protocol eq "ftp") or ($protocol eq "ssh")) {
     ($hostname, $port) = get_host_port($URL);
-} elsif ($protocol eq "cifs") {
+} elsif ($protocol eq "cifs" or $protocol eq "nfs") {
     ($hostname, undef) = get_host_port($URL);
 }
 
 #
 # path
-if ($protocol eq "nfs") {
-    ($hostname, $share, $path) = get_nfs_params($URL);
-} elsif (!$path) {
-    if ($protocol ne "nfs") {
-        $path = get_path($URL);
-
-        if ($protocol eq "cifs") {
-            ($share, $path) = $path =~ m#^/?([^\s/]+)/(.*)$#;
-        }
+if (!$path) {
+    $path = get_path($URL);
+
+    if ($protocol eq "cifs") {
+        ($share, $path) = $path =~ m#^/?([^\s/]+)/(.*)$#;
     }
 }
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/src/kdump-led_blink.c new/kdump-helpers-0.2.3/src/kdump-led_blink.c
--- old/kdump-helpers-0.2.2/src/kdump-led_blink.c       1970-01-01 01:00:00.000000000 +0100
+++ new/kdump-helpers-0.2.3/src/kdump-led_blink.c       2007-06-14 23:41:14.000000000 +0200
@@ -0,0 +1,196 @@
+/*
+ * (c) 2006, Bernhard Walle <bwalle@xxxxxxx>, SUSE LINUX Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+ * 02110-1301, USA.
+ */
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <signal.h>
+#include <linux/kd.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <getopt.h>
+#include <fcntl.h>
+
+static bool s_foreground = false;
+static long s_interval = 500;
+static sig_atomic_t g_exit = 0;
+
+/* -------------------------------------------------------------------------- */
+void exit_handler(int signo)
+{
+    (void)signo; /* make gcc happy */
+
+    g_exit = 1;
+}
+
+/* -------------------------------------------------------------------------- */
+void print_usage(void)
+{
+    fprintf(stderr, "Usage: kdump-helper [options] dumpfile\n"
+                    "\n"
+                    "Options:\n"
+                    "   --interval # | -i #\n"
+                    "            Blink interval in ms\n"
+                    "\n"
+                    "   --foreground | -f\n"
+                    "            Don't run as daemon\n"
+                    "\n"
+                    "   --help | -h\n"
+                    "            Print this help\n"
+                    "\n"
+                    "   --version | -v\n"
+                    "            Print the version\n");
+}
+
+/* -------------------------------------------------------------------------- */
+void daemonize(void)
+{
+    int i;
+    int maxfd;
+
+    if (fork())
+        exit(0);
+
+    if(setsid() < 0) {
+        fprintf(stderr, "kann nicht Session-Führer werden!\n");
+        exit(0);
+    }
+
+    chdir("/");
+    umask(0);
+
+    /* close all open file descriptors */
+    maxfd = sysconf(_SC_OPEN_MAX);
+    for(i = maxfd; i > 0; i--)
+       close(i);
+}
+
+/* -------------------------------------------------------------------------- */
+void print_version(void)
+{
+    fprintf(stderr, "kdump-led_blink " VERSION "\n");
+}
+
+/* -------------------------------------------------------------------------- */
+void parse_options(int argc, char *argv[])
+{
+    static struct option long_options[] = {
+        {"interval",    0, 0, 'i'},
+        {"foreground",  0, 0, 'f'},
+        {"version",     0, 0, 'v'},
+        {"help",        0, 0, 'h'}
+    };
+
+    while (true) {
+        int option_index = 0;
+        int c;
+
+        c = getopt_long (argc, argv, "i:vhf", long_options, &option_index);
+        if (c == -1)
+            break;
+
+        switch (c) {
+            case 'i':
+                s_interval = atoi(optarg);
+                break;
+
+            case 'h':
+                print_usage();
+                exit(0);
+
+            case 'f':
+                s_foreground = true;
+                break;
+
+            case 'v':
+                print_version();
+                exit(0);
+
+            default:
+                print_usage();
+                exit(-1);
+        }
+    }
+}
+
+/* -------------------------------------------------------------------------- */
+int main(int argc, char *argv[])
+{
+    long counter;
+    int ret, console = -1;
+    struct timespec wait_period;
+
+    parse_options(argc, argv);
+
+    if (!s_foreground)
+        daemonize();
+
+    signal(SIGTERM, exit_handler);
+    signal(SIGINT, exit_handler);
+
+    /* set the interval */
+    wait_period.tv_sec = s_interval / 1000;
+    wait_period.tv_nsec = (s_interval % 1000) * 1000 * 1000;
+
+    console = open("/dev/console", O_NOCTTY);
+    if (console < 0) {
+        fprintf(stderr, "Could not open console\n");
+        goto out;
+    }
+
+    for (counter = 0; !g_exit; counter = (counter + 1) % 8) {
+
+        ret = ioctl(console, KDSETLED, counter);
+        if (ret < 0) {
+            fprintf(stderr, "Unable to ioctl(KDSETLED) "
+                    "-- are you not on the console?\n");
+            goto out;
+        }
+
+        nanosleep(&wait_period, NULL);
+    }
+
+    /* reset the LEDs to show the state of the keyboard */
+    counter = 0;
+    ret = ioctl(console, KDGKBLED, &counter);
+    if (ret < 0) {
+        fprintf(stderr, "Unabled to ioctl(KDGKBLED) "
+                "-- are you not on the console?\n");
+    }
+
+    ioctl(console, KDSETLED, counter);
+    if (ret < 0) {
+        fprintf(stderr, "Unabled to ioctl(KDSETLED) "
+                "-- are you not on the console?\n");
+    }
+
+    close(console);
+
+    return 0;
+
+out:
+    if (console != -1)
+        close(console);
+
+    return -1;
+}
+
+/* vim: set sw=4 ts=4 et: */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/src/Makefile new/kdump-helpers-0.2.3/src/Makefile
--- old/kdump-helpers-0.2.2/src/Makefile        2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/src/Makefile        2007-06-14 23:41:14.000000000 +0200
@@ -4,11 +4,17 @@
 
 CC             = gcc
 CFLAGS         = -W -Wall
-PROGRAMS_SBIN  = kdump-helper kdump-identify_kernel
+PROGRAMS_SBIN  = kdump-helper kdump-identify_kernel kdump-led_blink
 PROGRAMS_BIN   = read-debuglink
 
 all: $(PROGRAMS_SBIN) $(PROGRAMS_BIN)
 
+kdump-led_blink: kdump-led_blink.o
+       $(CC) $(CFLAGS) -o $@ $^
+
+kdump-led_blink.o: kdump-led_blink.c
+       $(CC) -c $(CFLAGS) -DVERSION=\"$(VERSION)\" $^
+
 read-debuglink: read-debuglink.o shared.o
        $(CC) $(CFLAGS) -o $@ $^ -lelf -lz
 
@@ -37,5 +43,5 @@
        install -m 0755 $(PROGRAMS_BIN) $(DESTDIR)$(BINDIR)
 
 clean:
-       rm -f kdump-helper *.o
+       rm -f $(PROGRAMS_BIN) $(PROGRAMS_SBIN) *.o
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/src/read-debuglink.c new/kdump-helpers-0.2.3/src/read-debuglink.c
--- old/kdump-helpers-0.2.2/src/read-debuglink.c        2007-06-11 15:34:44.000000000 +0200
+++ new/kdump-helpers-0.2.3/src/read-debuglink.c        2007-06-14 11:44:30.000000000 +0200
@@ -60,7 +60,7 @@
 /* -------------------------------------------------------------------------- */
 void print_version(void)
 {
-    fprintf(stderr, "kdump-helper " VERSION "\n");
+    fprintf(stderr, "read-debuglink " VERSION "\n");
 }
 
 /* -------------------------------------------------------------------------- */
@@ -347,10 +347,15 @@
        char *c;
        int  n;
 
+    if (!dirname || len <= 0)
+        return -1;
+
        /* find the last '/' */
        c = strrchr(filename, '/');
-       if (!c)
-               return -1;
+       if (!c) {
+        dirname[0] = 0;
+        return 0;
+    }
 
        /* preserve the trailing slash */
        n = c - filename + 1;
@@ -382,6 +387,8 @@
        }
 
        if (calc_crc != crc) {
+        printf("CRC of %s doesn't match (0x%x != 0x%x)\n",
+                binary, calc_crc, crc);
                close(fd);
                return -1;
        }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-helpers-0.2.2/.version new/kdump-helpers-0.2.3/.version
--- old/kdump-helpers-0.2.2/.version    2007-06-11 15:25:22.000000000 +0200
+++ new/kdump-helpers-0.2.3/.version    2007-06-14 11:58:14.000000000 +0200
@@ -1 +1 @@
-0.2.2
\ No newline at end of file
+0.2.3
\ No newline at end of file


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages