Mailinglist Archive: opensuse-commit (159 mails)

< Previous Next >
commit lkcdutils
  • From: root@xxxxxxx (h_root)
  • Date: Wed, 29 Mar 2006 11:58:07 +0200 (CEST)
  • Message-id: <20060329095807.0A6598ACE5@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package lkcdutils
checked in at Wed Mar 29 11:58:07 CEST 2006.

--------
--- /work/SRC/all/lkcdutils/lkcdutils.changes 2006-03-23 16:06:21.000000000 +0100
+++ /work/src/done/STABLE/lkcdutils/lkcdutils.changes 2006-03-29 09:05:43.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Mar 29 09:04:47 CEST 2006 - hare@xxxxxxx
+
+- Handle version 9 dumps correctly (#149136)
+- Fix savedump to save kerntypes.
+
+-------------------------------------------------------------------

New:
----
lkcdutils-handle-version-9.patch
lkcdutils-save-kerntypes.patch

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

Other differences:
------------------
++++++ lkcdutils.spec ++++++
--- /var/tmp/diff_new_pack.PrxMal/_old 2006-03-29 11:57:42.000000000 +0200
+++ /var/tmp/diff_new_pack.PrxMal/_new 2006-03-29 11:57:42.000000000 +0200
@@ -14,7 +14,7 @@
BuildRequires: glib2-devel libelf popt-devel
Summary: Linux Kernel Crash Dump (LKCD) Utilities
Version: 7.0.1
-Release: 8
+Release: 10
License: GPL
Group: System/Kernel
# Original source is from Sourceforge CVS:
@@ -37,6 +37,8 @@
Patch11: lkcdutils-dumputils-sysconfig.patch
Patch12: lkcdutils-netdump-compile-fixes.patch
Patch13: lkcdutils-fix-compat-dumps
+Patch14: lkcdutils-save-kerntypes.patch
+Patch15: lkcdutils-handle-version-9.patch
Patch20: lkcdutils-ia64-fujitsu.patch
Patch71: lkcdutils-netdump-secure_mode.patch
Patch75: lkcdutils-netdump-doc.patch
@@ -82,6 +84,8 @@
%patch11
%patch12 -p1
%patch13
+%patch14 -p3
+%patch15 -p3
cp %{S:4} PATCHES

%build
@@ -163,6 +167,9 @@
#/usr/sbin/netdump-login-client

%changelog -n lkcdutils
+* Wed Mar 29 2006 - hare@xxxxxxx
+- Handle version 9 dumps correctly (#149136)
+- Fix savedump to save kerntypes.
* Thu Mar 23 2006 - hare@xxxxxxx
- Fix S/390 standalone dumps (#159117 - LTC22496)
* Thu Feb 23 2006 - hare@xxxxxxx


++++++ lkcdutils-handle-version-9.patch ++++++
Support for version 9 dumps seems to have not made it forward into
savedump. This adds it.

Index: lkcd/7.X.X/lkcdutils/dumputils/savedump.h
===================================================================
--- lkcd.orig/7.X.X/lkcdutils/dumputils/savedump.h 2006-03-27 06:06:10.842743983 -0800
+++ lkcd/7.X.X/lkcdutils/dumputils/savedump.h 2006-03-27 06:06:17.734824824 -0800
@@ -70,6 +70,9 @@

#define DUMP_LEVEL_HEADER 0x1

+#define KL_DUMP_PANIC_LEN 0x100 /* dump panic string length */
+#define KL_UTS_LEN 65
+
typedef struct _dump_page_s {

/* the address of this dump page */
@@ -116,7 +119,29 @@
/* the number of hardware/physical pages in this dump specifically */
uint32_t dh_num_dump_pages;

-} generic_dump_header_t;
+ char panic_string[KL_DUMP_PANIC_LEN]; /* panic string, if available*/
+
+ /* timeval depends on machine, two long values */
+ struct {uint64_t tv_sec;
+ uint64_t tv_usec;
+ } time; /* the time of the system crash */
+
+ /* the NEW utsname (uname) information -- in character form */
+ /* we do this so we don't have to include utsname.h */
+ /* plus it helps us be more architecture independent */
+ char utsname_sysname[KL_UTS_LEN];
+ char utsname_nodename[KL_UTS_LEN];
+ char utsname_release[KL_UTS_LEN];
+ char utsname_version[KL_UTS_LEN];
+ char utsname_machine[KL_UTS_LEN];
+ char utsname_domainname[KL_UTS_LEN];
+
+ uint64_t current_task; /* fixme: better use uint64_t here */
+ uint32_t dump_compress; /* compression type used in this dump */
+ uint32_t dump_flags; /* any additional flags */
+ uint32_t dump_device; /* any additional flags */
+ uint64_t dump_buffer_size; /* version >= 9 */
+} __attribute__((packed)) generic_dump_header_t;

typedef struct generic_dump_header_asm_s {

Index: lkcd/7.X.X/lkcdutils/dumputils/savedump.c
===================================================================
--- lkcd.orig/7.X.X/lkcdutils/dumputils/savedump.c 2006-03-27 06:06:10.842743983 -0800
+++ lkcd/7.X.X/lkcdutils/dumputils/savedump.c 2006-03-27 06:06:17.734824824 -0800
@@ -814,6 +814,7 @@

dump_header_size = DUMP_HEADER_SIZE;

+read_header:
// Move beyond swap header
//

@@ -865,6 +866,17 @@
return 85;
}

+ // Starting in version 9 dumps, the header size isn't a constant.
+ // We need to figure out what it is and make another pass to
+ // get the whole header.
+
+ if (dh->dh_version >= 9 && dh->dump_buffer_size != dump_header_size) {
+ dump_header_size = dh->dump_buffer_size;
+ free(headerbuf);
+
+ goto read_header;
+ }
+
// Find the asm_dump_header
//




++++++ lkcdutils-save-kerntypes.patch ++++++
This makes savedump save a copy of Kerntypes in /var/log/dump like the
old /sbin/lkcd script did.

It also makes us save /boot/System.map-`uname -r` (which is also what
/sbin/lkcd used to do) instead of /boot/System.map. Not all distros
provide the symlink for us.


Index: lkcd/7.X.X/lkcdutils/dumputils/savedump.c
===================================================================
--- lkcd.orig/7.X.X/lkcdutils/dumputils/savedump.c 2006-01-11 11:19:24.000000000 -0800
+++ lkcd/7.X.X/lkcdutils/dumputils/savedump.c 2006-03-27 06:06:10.842743983 -0800
@@ -169,12 +169,20 @@
copy_map(struct confInfo *conf, int bounds)
{
char *smname;
+ char srcname[NAME_MAX];
FILE *dfd=NULL, *fp=NULL;
+ struct utsname utsbuf;
char line[255], *fuser=NULL, *fpass=NULL;
int err=0;

disconnect();

+ if (uname(&utsbuf) < 0) {
+ perror("uname");
+ exit(EXIT_FAILURE);
+ }
+ sprintf(srcname, "/boot/System.map-%s", utsbuf.release);
+
if(conf->ftp){

if(conf->path == NULL){
@@ -221,14 +229,14 @@
return 39;
}

- if((fp = fopen("/boot/System.map", "r")) != NULL){
+ if((fp = fopen(srcname, "r")) != NULL){
while (fgets(line,sizeof(line),fp) != NULL)
{
fprintf(dfd, "%s", line);
}
fflush(dfd);
}else{
- fprintf(stderr, "Couldn't open /boot/System.map!\n");
+ fprintf(stderr, "Couldn't open %s!\n", srcname);
free(fuser);
free(fpass);
free(smname);
@@ -276,14 +284,14 @@
return 81;
}

- if((fp = fopen("/boot/System.map", "r")) != NULL){
+ if((fp = fopen(srcname, "r")) != NULL){
while (fgets(line,sizeof(line),fp) != NULL)
{
fprintf(dfd, "%s", line);
}
fflush(dfd);
}else{
- fprintf(stderr, "Couldn't open /boot/System.map\n");
+ fprintf(stderr, "Couldn't open %s\n", srcname);
free(smname);
disconnect();
return 82;
@@ -302,6 +310,122 @@

}

+
+int
+copy_kerntypes(struct confInfo *conf, int bounds)
+{
+ char srcname[NAME_MAX], dstname[NAME_MAX];
+ struct utsname utsbuf;
+ FILE *dfd=NULL, *fp=NULL;
+ char *fuser, *fpass;
+ char buf[512];
+ int n;
+ int err=0;
+
+ disconnect();
+
+ if (uname(&utsbuf) < 0) {
+ perror("uname");
+ exit(EXIT_FAILURE);
+ }
+ sprintf(srcname, "/boot/Kerntypes-%s", utsbuf.release);
+
+#ifdef DEBUG
+ printf("Kerntypes file name: %s\n", dstname);
+#endif
+
+ if(conf->ftp){
+ if (conf->path)
+ sprintf(dstname, "%s/%d/kerntypes.%d", conf->path, bounds, bounds);
+ else
+ sprintf(dstname, "%d/kerntypes.%d", bounds, bounds);
+
+ if ((fuser=(char *)malloc(strlen(conf->user)+7)) == NULL) {
+ perror("FATAL ERROR: Couldn't allocate enough memory");
+ exit(10);
+ }
+
+ if ((fpass=(char *)malloc(strlen(conf->pass)+7)) == NULL) {
+ perror("FATAL ERROR: Couldn't allocate enough memory");
+ exit(10);
+ }
+
+ sprintf(fuser, "USER %s", conf->user);
+ sprintf(fpass, "PASS %s", conf->pass);
+
+ if ( ((err = FTPConnect(conf->host, fuser, fpass)) < 0) ){
+ fprintf(stderr, "Could not connect to server!\n");
+ free(fuser);
+ free(fpass);
+ exit(err);
+ }
+
+ dfd = do_open(dstname);
+ if (!dfd) {
+ fprintf(stderr, "Could not create file!\n");
+ free(fuser);
+ free(fpass);
+ disconnect();
+ return 39;
+ }
+
+ fopen(srcname, "r");
+ if (!fp) {
+ fprintf(stderr, "Couldn't open %s!\n", srcname);
+ free(fuser);
+ free(fpass);
+ disconnect();
+ return 82;
+ }
+
+ while ((n = fread(buf, sizeof(buf), 1, fp)))
+ fwrite(buf, n, 1, fp);
+
+#ifdef DEBUG
+ printf("Wrote Kerntypes: %s\n", ktname);
+#endif
+
+ fflush(dfd);
+ fclose(fp);
+ free(fuser);
+ free(fpass);
+ disconnect();
+
+ return 0;
+
+ } else { /* not ftp */
+ if (conf->dir)
+ sprintf(dstname, "%s/%d/kerntypes.%d", conf->dir, bounds, bounds);
+ else
+ sprintf(dstname, "%d/kerntypes.%d", bounds, bounds);
+
+ if ((dfd = fopen(dstname, "w")) == NULL) {
+ perror("Error opening destination kerntypes file");
+ return 81;
+ }
+
+ fp = fopen(srcname, "r");
+ if (!fp) {
+ fprintf(stderr, "Couldn't open %s\n", srcname);
+ disconnect();
+ return 82;
+ }
+
+ while ((n = fread(buf, 1, sizeof(buf), fp)))
+ fwrite(buf, 1, n, dfd);
+
+#ifdef DEBUG
+ printf("Wrote kerntypes file: %s\n", dstname);
+#endif
+
+ fflush(dfd);
+ fclose(fp);
+ fclose(dfd);
+ return 0;
+ }
+}
+
+
// create a bounds file.
//
int
@@ -1486,5 +1610,12 @@

printf("Successfully wrote System.map\n");

+ if ( (i=copy_kerntypes(conf, bounds)) < 0) {
+ fprintf(stderr, "Error while copying Kerntypes\n");
+ exit (i);
+ }
+
+ printf("Successfully wrote Kerntypes\n");
+
return 0;
} //end main
Index: lkcd/7.X.X/lkcdutils/dumputils/savedump.h
===================================================================
--- lkcd.orig/7.X.X/lkcdutils/dumputils/savedump.h 2005-06-01 12:13:02.000000000 -0700
+++ lkcd/7.X.X/lkcdutils/dumputils/savedump.h 2006-03-27 06:06:10.842743983 -0800
@@ -37,6 +37,8 @@
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
+#include <limits.h>
+#include <sys/utsname.h>

#define DUMP_BUFFER_SIZE (64 * 1024)
#define DUMP_HEADER_SIZE DUMP_BUFFER_SIZE

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



Remember to have fun...


< Previous Next >
This Thread
  • No further messages