Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > b8204bfed5255fbbec2bb0fe190e1aec > files > 29

kexec-tools-1.102pre-77.el5.3.src.rpm

diff -up kexec-tools-testing-20070330/makedumpfile/makedumpfile.c.orig kexec-tools-testing-20070330/makedumpfile/makedumpfile.c
--- kexec-tools-testing-20070330/makedumpfile/makedumpfile.c.orig	2009-04-22 06:17:56.000000000 -0400
+++ kexec-tools-testing-20070330/makedumpfile/makedumpfile.c	2009-04-22 06:31:02.000000000 -0400
@@ -292,9 +292,8 @@ is_page_size(long page_size)
 }
 
 int
-check_release()
+get_utsname(struct utsname *system_utsname)
 {
-	struct utsname system_utsname;
 	unsigned long utsname;
 
 	/*
@@ -308,13 +307,18 @@ check_release()
 		ERRMSG("Can't get the symbol of system_utsname.\n");
 		return FALSE;
 	}
-	if (!readmem(VADDR, utsname, &system_utsname, sizeof(struct utsname))){
+	if (!readmem(VADDR, utsname, system_utsname, sizeof(struct utsname))){
 		ERRMSG("Can't get the address of system_utsname.\n");
 		return FALSE;
 	}
+	return TRUE;
+}
 
+int
+check_release(void)
+{
 	if (info->flag_read_vmcoreinfo) {
-		if (strcmp(system_utsname.release, info->release)) {
+		if (strcmp(info->system_utsname.release, info->release)) {
 			ERRMSG("%s and %s don't match.\n",
 			    info->name_vmcoreinfo, info->name_memory);
 			retcd = WRONG_RELEASE;
@@ -322,7 +326,7 @@ check_release()
 		}
 	}
 
-	info->kernel_version = get_kernel_version(system_utsname.release);
+	info->kernel_version = get_kernel_version(info->system_utsname.release);
 	if (info->kernel_version == FALSE) {
 		if (!info->flag_read_vmcoreinfo)
 			ERRMSG("Or %s and %s don't match.\n",
@@ -3215,6 +3219,7 @@ get_mem_map()
 int
 initial()
 {
+
 	if (!get_elf_info())
 		return FALSE;
 
@@ -3276,6 +3281,9 @@ initial()
 			return TRUE;
 	}
 
+	if (!get_utsname(&info->system_utsname))
+		return FALSE;
+
 	if (!get_machdep_info())
 		return FALSE;
 
@@ -4562,6 +4570,7 @@ write_kdump_header()
 	dh->nr_cpus      = 1;
 	dh->bitmap_blocks
 	    = divideup(info->len_bitmap, dh->block_size);
+	memcpy(&dh->utsname, &info->system_utsname, sizeof(dh->utsname));
 
 	size = sizeof(struct disk_dump_header);
 	if (!write_buffer(info->fd_dumpfile, 0, dh, size, info->name_dumpfile))
diff -up kexec-tools-testing-20070330/makedumpfile/makedumpfile.h.orig kexec-tools-testing-20070330/makedumpfile/makedumpfile.h
--- kexec-tools-testing-20070330/makedumpfile/makedumpfile.h.orig	2009-04-22 06:17:56.000000000 -0400
+++ kexec-tools-testing-20070330/makedumpfile/makedumpfile.h	2009-04-22 06:20:32.000000000 -0400
@@ -634,7 +634,7 @@ struct makedumpfile_data_header {
 
 struct DumpInfo {
 	int32_t		kernel_version;      /* version of first kernel*/
-
+	struct utsname  system_utsname;
 	/*
 	 * General info:
 	 */