Hello,
BTW (because of https://bugzilla.novell.com/show_bug.cgi?id=257968),
is the patch techically ok? Should we try it on LKML? Or do you have a
better idea?
Maybe simply using the symbol table for vmlinux and the boot header
for vmlinuz (as it's not upstream) would be an immediate solution?
I'm open for any ideas in that area. :)
Thanks,
Bernhard
> For kdump userspace tools it's necessary to know the command line length
> of the kernel because the length was changed in 2.6.21 to be able to
> warn the user about a too long command line (which frequently happens
> when using kdump).
>
> This patch adds an ELF PT_NOTE header that can read out by userspace.
> It also adds the version information which could be used by various
> scripts (for example the script to create the initial ramdisk) of Linux
> distributions.
>
>
> Signed-off-by: Bernhard Walle <[EMAIL PROTECTED]>
>
> ---
> arch/i386/kernel/Makefile | 2 +-
> arch/i386/kernel/elfinfo.S | 10 ++++++++++
> arch/i386/kernel/vsyscall-note.S | 20 ++++----------------
> arch/x86_64/kernel/Makefile | 2 +-
> arch/x86_64/kernel/elfinfo.S | 11 +++++++++++
> include/asm-i386/elf_note.h | 18 ++++++++++++++++++
> include/asm-x86_64/elf_note.h | 1 +
> 7 files changed, 46 insertions(+), 18 deletions(-)
>
> Index: linux-2.6.21-rc3-x86_64/arch/i386/kernel/Makefile
> ===================================================================
> --- linux-2.6.21-rc3-x86_64.orig/arch/i386/kernel/Makefile
> +++ linux-2.6.21-rc3-x86_64/arch/i386/kernel/Makefile
> @@ -4,7 +4,7 @@
>
> extra-y := head.o init_task.o vmlinux.lds
>
> -obj-y := process.o signal.o entry.o traps.o irq.o \
> +obj-y := process.o signal.o entry.o elfinfo.o traps.o irq.o \
> ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
> pci-dma.o i386_ksyms.o i387.o bootflag.o e820.o\
> quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
> Index: linux-2.6.21-rc3-x86_64/arch/i386/kernel/elfinfo.S
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3-x86_64/arch/i386/kernel/elfinfo.S
> @@ -0,0 +1,10 @@
> +#include <linux/version.h>
> +#include <linux/uts.h>
> +#include <asm/setup.h>
> +#include <asm/elf_note.h>
> +
> +ASM_ELF_NOTE_BEGIN(".noteinfo.kernelinfo", "a", UTS_SYSNAME, 0)
> +.long LINUX_VERSION_CODE /* Linux kernel version */
> +.long COMMAND_LINE_SIZE-1 /* size of the command line (excluding zero-
> + termination */
> +ASM_ELF_NOTE_END
> Index: linux-2.6.21-rc3-x86_64/arch/i386/kernel/vsyscall-note.S
> ===================================================================
> --- linux-2.6.21-rc3-x86_64.orig/arch/i386/kernel/vsyscall-note.S
> +++ linux-2.6.21-rc3-x86_64/arch/i386/kernel/vsyscall-note.S
> @@ -5,21 +5,9 @@
>
> #include <linux/uts.h>
> #include <linux/version.h>
> +#include <asm/elf_note.h>
>
> -#define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type)
> \
> - .section name, flags; \
> - .balign 4; \
> - .long 1f - 0f; /* name length */ \
> - .long 3f - 2f; /* data length */ \
> - .long type; /* note type */ \
> -0: .asciz vendor; /* vendor name */ \
> -1: .balign 4; \
> -2:
>
> -#define ASM_ELF_NOTE_END \
> -3: .balign 4; /* pad out section */ \
> - .previous
> -
> - ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0)
> - .long LINUX_VERSION_CODE
> - ASM_ELF_NOTE_END
> +ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0)
> +.long LINUX_VERSION_CODE
> +ASM_ELF_NOTE_END
> Index: linux-2.6.21-rc3-x86_64/arch/x86_64/kernel/elfinfo.S
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3-x86_64/arch/x86_64/kernel/elfinfo.S
> @@ -0,0 +1,11 @@
> +#include <linux/version.h>
> +#include <linux/uts.h>
> +#include <asm/setup.h>
> +#include <asm/elf_note.h>
> +
> +ASM_ELF_NOTE_BEGIN(".noteinfo.kernelinfo", "a", UTS_SYSNAME, 0)
> +.long LINUX_VERSION_CODE /* Linux kernel version */
> +.long COMMAND_LINE_SIZE-1 /* size of the command line (excluding zero-
> + termination */
> +ASM_ELF_NOTE_END
> +
> Index: linux-2.6.21-rc3-x86_64/include/asm-i386/elf_note.h
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3-x86_64/include/asm-i386/elf_note.h
> @@ -0,0 +1,18 @@
> +/*
> + * Macros to generate ELF notes
> + */
> +
> +
> +#define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type)
> \
> + .section name, flags; \
> + .balign 4; \
> + .long 1f - 0f; /* name length */ \
> + .long 3f - 2f; /* data length */ \
> + .long type; /* note type */ \
> +0: .asciz vendor; /* vendor name */ \
> +1: .balign 4; \
> +2:
> +
> +#define ASM_ELF_NOTE_END \
> +3: .balign 4; /* pad out section */ \
> + .previous
> Index: linux-2.6.21-rc3-x86_64/include/asm-x86_64/elf_note.h
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc3-x86_64/include/asm-x86_64/elf_note.h
> @@ -0,0 +1 @@
> +#include "../asm-i386/elf_note.h"
> Index: linux-2.6.21-rc3-x86_64/arch/x86_64/kernel/Makefile
> ===================================================================
> --- linux-2.6.21-rc3-x86_64.orig/arch/x86_64/kernel/Makefile
> +++ linux-2.6.21-rc3-x86_64/arch/x86_64/kernel/Makefile
> @@ -4,7 +4,7 @@
>
> extra-y := head.o head64.o init_task.o vmlinux.lds
> EXTRA_AFLAGS := -traditional
> -obj-y := process.o signal.o entry.o traps.o irq.o \
> +obj-y := process.o signal.o entry.o elfinfo.o traps.o irq.o \
> ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
> x8664_ksyms.o i387.o syscall.o vsyscall.o \
> setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
>
> _______________________________________________
> fastboot mailing list
> [email protected]
> https://lists.osdl.org/mailman/listinfo/fastboot
_______________________________________________
fastboot mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/fastboot