From f076a8f52cdbaad174f10989619849b0a116099bab1612dbea42e929ba9b9cdd Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 18 Jul 2007 21:00:11 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kexec-tools?expand=0&rev=29 --- kexec-longer-cmdline.diff | 138 ++++++++++++---------------- kexec-tools.changes | 5 + kexec-tools.gcc-bug.patch | 27 ++++++ kexec-tools.ppc64-32bit-build.patch | 13 ++- kexec-tools.spec | 6 +- 5 files changed, 108 insertions(+), 81 deletions(-) create mode 100644 kexec-tools.gcc-bug.patch diff --git a/kexec-longer-cmdline.diff b/kexec-longer-cmdline.diff index 1d77d87..f6ac9ed 100644 --- a/kexec-longer-cmdline.diff +++ b/kexec-longer-cmdline.diff @@ -28,8 +28,6 @@ Signed-off-by: Bernhard Walle kexec/arch/x86_64/kexec-elf-x86_64.c | 11 ++++++---- 9 files changed, 95 insertions(+), 25 deletions(-) -Index: b/include/x86/x86-linux.h -=================================================================== --- a/include/x86/x86-linux.h +++ b/include/x86/x86-linux.h @@ -148,14 +148,12 @@ struct x86_linux_param_header { @@ -50,8 +48,6 @@ Index: b/include/x86/x86-linux.h }; struct x86_linux_header { -Index: b/kexec/arch/i386/crashdump-x86.c -=================================================================== --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -46,6 +46,36 @@ static struct memory_range crash_memory_ @@ -118,8 +114,6 @@ Index: b/kexec/arch/i386/crashdump-x86.c die("Command line overflow\n"); strcat(cmdline, str); #if 0 -Index: b/kexec/arch/i386/crashdump-x86.h -=================================================================== --- a/kexec/arch/i386/crashdump-x86.h +++ b/kexec/arch/i386/crashdump-x86.h @@ -2,8 +2,11 @@ @@ -141,8 +135,66 @@ Index: b/kexec/arch/i386/crashdump-x86.h +extern int real_command_line_size; + #endif /* CRASHDUMP_X86_H */ -Index: b/kexec/arch/x86_64/crashdump-x86_64.c -=================================================================== +--- a/kexec/arch/i386/kexec-bzImage.c ++++ b/kexec/arch/i386/kexec-bzImage.c +@@ -156,12 +156,12 @@ int do_bzImage_load(struct kexec_info *i + * taking crash dumps. + */ + if (info->kexec_flags & KEXEC_ON_CRASH) { +- modified_cmdline = xmalloc(COMMAND_LINE_SIZE); +- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE); ++ modified_cmdline = xmalloc(real_command_line_size); ++ memset((void *)modified_cmdline, 0, real_command_line_size); + if (command_line) { + strncpy(modified_cmdline, command_line, +- COMMAND_LINE_SIZE); +- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0'; ++ real_command_line_size); ++ modified_cmdline[real_command_line_size - 1] = '\0'; + } + + /* If panic kernel is being loaded, additional segments need +--- a/kexec/arch/i386/kexec-elf-x86.c ++++ b/kexec/arch/i386/kexec-elf-x86.c +@@ -166,12 +166,12 @@ int elf_x86_load(int argc, char **argv, + * taking crash dumps. + */ + if (info->kexec_flags & KEXEC_ON_CRASH) { +- modified_cmdline = xmalloc(COMMAND_LINE_SIZE); +- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE); ++ modified_cmdline = xmalloc(real_command_line_size); ++ memset((void *)modified_cmdline, 0, real_command_line_size); + if (command_line) { + strncpy(modified_cmdline, command_line, +- COMMAND_LINE_SIZE); +- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0'; ++ real_command_line_size); ++ modified_cmdline[real_command_line_size - 1] = '\0'; + } + modified_cmdline_len = strlen(modified_cmdline); + } +--- a/kexec/arch/i386/x86-linux-setup.c ++++ b/kexec/arch/i386/x86-linux-setup.c +@@ -32,6 +32,8 @@ + #include "kexec-x86.h" + #include "x86-linux-setup.h" + ++extern int real_command_line_size; ++ + void init_linux_parameters(struct x86_linux_param_header *real_mode) + { + /* Fill in the values that are usually provided by the kernel. */ +@@ -91,8 +93,8 @@ void setup_linux_bootloader_parameters( + } + + /* Fill in the command line */ +- if (cmdline_len > COMMAND_LINE_SIZE) { +- cmdline_len = COMMAND_LINE_SIZE; ++ if (cmdline_len > real_command_line_size) { ++ cmdline_len = real_command_line_size; + } + cmdline_ptr = ((char *)real_mode) + cmdline_offset; + memcpy(cmdline_ptr, cmdline, cmdline_len); --- a/kexec/arch/x86_64/crashdump-x86_64.c +++ b/kexec/arch/x86_64/crashdump-x86_64.c @@ -50,6 +50,35 @@ static struct crash_elf_info elf_info = @@ -208,8 +260,6 @@ Index: b/kexec/arch/x86_64/crashdump-x86_64.c die("Command line overflow\n"); strcat(cmdline, str_mmap); -Index: b/kexec/arch/x86_64/crashdump-x86_64.h -=================================================================== --- a/kexec/arch/x86_64/crashdump-x86_64.h +++ b/kexec/arch/x86_64/crashdump-x86_64.h @@ -3,6 +3,7 @@ @@ -227,8 +277,6 @@ Index: b/kexec/arch/x86_64/crashdump-x86_64.h +extern int real_command_line_size; + #endif /* CRASHDUMP_X86_64_H */ -Index: b/kexec/arch/x86_64/kexec-elf-x86_64.c -=================================================================== --- a/kexec/arch/x86_64/kexec-elf-x86_64.c +++ b/kexec/arch/x86_64/kexec-elf-x86_64.c @@ -166,12 +166,12 @@ int elf_x86_64_load(int argc, char **arg @@ -258,69 +306,3 @@ Index: b/kexec/arch/x86_64/kexec-elf-x86_64.c /* Do we want arguments? */ if (arg_style != ARG_STYLE_NONE) { /* Load the setup code */ -Index: b/kexec/arch/i386/kexec-bzImage.c -=================================================================== ---- a/kexec/arch/i386/kexec-bzImage.c -+++ b/kexec/arch/i386/kexec-bzImage.c -@@ -156,12 +156,12 @@ int do_bzImage_load(struct kexec_info *i - * taking crash dumps. - */ - if (info->kexec_flags & KEXEC_ON_CRASH) { -- modified_cmdline = xmalloc(COMMAND_LINE_SIZE); -- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE); -+ modified_cmdline = xmalloc(real_command_line_size); -+ memset((void *)modified_cmdline, 0, real_command_line_size); - if (command_line) { - strncpy(modified_cmdline, command_line, -- COMMAND_LINE_SIZE); -- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0'; -+ real_command_line_size); -+ modified_cmdline[real_command_line_size - 1] = '\0'; - } - - /* If panic kernel is being loaded, additional segments need -Index: b/kexec/arch/i386/kexec-elf-x86.c -=================================================================== ---- a/kexec/arch/i386/kexec-elf-x86.c -+++ b/kexec/arch/i386/kexec-elf-x86.c -@@ -166,12 +166,12 @@ int elf_x86_load(int argc, char **argv, - * taking crash dumps. - */ - if (info->kexec_flags & KEXEC_ON_CRASH) { -- modified_cmdline = xmalloc(COMMAND_LINE_SIZE); -- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE); -+ modified_cmdline = xmalloc(real_command_line_size); -+ memset((void *)modified_cmdline, 0, real_command_line_size); - if (command_line) { - strncpy(modified_cmdline, command_line, -- COMMAND_LINE_SIZE); -- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0'; -+ real_command_line_size); -+ modified_cmdline[real_command_line_size - 1] = '\0'; - } - modified_cmdline_len = strlen(modified_cmdline); - } -Index: b/kexec/arch/i386/x86-linux-setup.c -=================================================================== ---- a/kexec/arch/i386/x86-linux-setup.c -+++ b/kexec/arch/i386/x86-linux-setup.c -@@ -32,6 +32,8 @@ - #include "kexec-x86.h" - #include "x86-linux-setup.h" - -+extern int real_command_line_size; -+ - void init_linux_parameters(struct x86_linux_param_header *real_mode) - { - /* Fill in the values that are usually provided by the kernel. */ -@@ -91,8 +93,8 @@ void setup_linux_bootloader_parameters( - } - - /* Fill in the command line */ -- if (cmdline_len > COMMAND_LINE_SIZE) { -- cmdline_len = COMMAND_LINE_SIZE; -+ if (cmdline_len > real_command_line_size) { -+ cmdline_len = real_command_line_size; - } - cmdline_ptr = ((char *)real_mode) + cmdline_offset; - memcpy(cmdline_ptr, cmdline, cmdline_len); diff --git a/kexec-tools.changes b/kexec-tools.changes index 252dbd4..1f679a2 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 17 07:25:19 CEST 2007 - olh@suse.de + +- workaround gcc code analyzing bug + ------------------------------------------------------------------- Mon Jul 16 15:33:22 CEST 2007 - olh@suse.de diff --git a/kexec-tools.gcc-bug.patch b/kexec-tools.gcc-bug.patch new file mode 100644 index 0000000..00a0a59 --- /dev/null +++ b/kexec-tools.gcc-bug.patch @@ -0,0 +1,27 @@ +--- + kexec/arch/i386/crashdump-x86.c | 2 ++ + kexec/arch/x86_64/crashdump-x86_64.c | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/kexec/arch/i386/crashdump-x86.c ++++ b/kexec/arch/i386/crashdump-x86.c +@@ -286,6 +286,8 @@ static int delete_memmap(struct memory_r + unsigned long long mstart, mend; + struct memory_range temp_region; + ++ /* kexec/arch/i386/crashdump-x86.c:343: warning: 'temp_region.type' is used uninitialized in this function */ ++ memset(&temp_region, 0, sizeof(temp_region)); + /* Do alignment check. */ + if ((addr%align) || (size%align)) + return -1; +--- a/kexec/arch/x86_64/crashdump-x86_64.c ++++ b/kexec/arch/x86_64/crashdump-x86_64.c +@@ -391,6 +391,8 @@ static int delete_memmap(struct memory_r + unsigned long long mstart, mend; + struct memory_range temp_region; + ++ /* kexec/arch/x86_64/crashdump-x86_64.c:448: warning: 'temp_region.type' is used uninitialized in this function */ ++ memset(&temp_region, 0, sizeof(temp_region)); + /* Do alignment check. */ + if ((addr%align) || (size%align)) + return -1; diff --git a/kexec-tools.ppc64-32bit-build.patch b/kexec-tools.ppc64-32bit-build.patch index 1c2cc3e..efaaa32 100644 --- a/kexec-tools.ppc64-32bit-build.patch +++ b/kexec-tools.ppc64-32bit-build.patch @@ -6,8 +6,8 @@ kexec/arch/ppc64/kexec-ppc64.h | 2 +- kexec/kexec-sha256.h | 4 ++-- purgatory/arch/ppc64/Makefile | 2 ++ - purgatory/purgatory.c | 2 ++ - 8 files changed, 34 insertions(+), 30 deletions(-) + purgatory/purgatory.c | 4 +++- + 8 files changed, 35 insertions(+), 31 deletions(-) --- a/kexec/arch/ppc64/crashdump-ppc64.h +++ b/kexec/arch/ppc64/crashdump-ppc64.h @@ -238,6 +238,15 @@ +PCFLAGS += -m64 -mcall-aixdesc --- a/purgatory/purgatory.c +++ b/purgatory/purgatory.c +@@ -18,7 +18,7 @@ void verify_sha256_digest(void) + sha256_starts(&ctx); + end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])]; + for(ptr = sha256_regions; ptr < end; ptr++) { +- sha256_update(&ctx, ptr->start, ptr->len); ++ sha256_update(&ctx, (char *)ptr->start, ptr->len); + } + sha256_finish(&ctx, digest); + if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) { @@ -46,3 +46,5 @@ void purgatory(void) verify_sha256_digest(); post_verification_setup_arch(); diff --git a/kexec-tools.spec b/kexec-tools.spec index 50778f0..a207c1d 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -22,7 +22,7 @@ Requires: %insserv_prereq %fillup_prereq Autoreqprov: on Summary: Tools for fast kernel loading Version: 1.101 -Release: 118 +Release: 119 Source: %{name}-%{package_version}.tar.bz2 Source1: kdump Source2: sysconfig.kdump @@ -37,6 +37,7 @@ Patch1: kexec-longer-cmdline.diff Patch2: kexec-tools.check_reuse_initrd-close.patch Patch20: kexec-tools.ppc64-32bit-build.patch Patch21: kexec-tools.ppc32-64bit-purgatory.patch +Patch22: kexec-tools.gcc-bug.patch %description Kexec is a user space utility for loading another kernel and asking the @@ -62,6 +63,7 @@ Authors: # %patch20 -p1 %patch21 -p1 +%patch22 -p1 %build %{?suse_update_config -f} @@ -140,6 +142,8 @@ true # ignore errors /var/adm/fillup-templates/sysconfig.kdump %changelog +* Tue Jul 17 2007 - olh@suse.de +- workaround gcc code analyzing bug * Mon Jul 16 2007 - olh@suse.de - update to kexec-tools-testing b84b87747a16f0afbef6f6802bb794a94f4961d9 build 32bit powerpc kexec binary for 64bit kernels