From ba2ce3ddff7692289d74a4017806b57a1681d3c8 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Fri, 15 May 2009 18:57:11 +0200 Subject: kexec-tools_2.0.0: initial commit - kexec-tools_2.0.0 compiles just fine - kexec-tools-static_2.0.0 breaks during do_compile (against klibc) - setting DEFAULT_PREFERENCE = "-1" --- recipes/kexec/files/kexec2-klibc.patch | 167 +++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 recipes/kexec/files/kexec2-klibc.patch (limited to 'recipes/kexec/files/kexec2-klibc.patch') diff --git a/recipes/kexec/files/kexec2-klibc.patch b/recipes/kexec/files/kexec2-klibc.patch new file mode 100644 index 0000000000..c52262bb5f --- /dev/null +++ b/recipes/kexec/files/kexec2-klibc.patch @@ -0,0 +1,167 @@ +Index: kexec-tools-2.0.0/kexec/arch/arm/kexec-elf-rel-arm.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/arch/arm/kexec-elf-rel-arm.c 2009-04-24 14:15:46.934825202 +0100 ++++ kexec-tools-2.0.0/kexec/arch/arm/kexec-elf-rel-arm.c 2009-04-24 14:15:47.014827381 +0100 +@@ -1,5 +1,5 @@ + #include +-#include ++#include "../../../include/elf.h" + #include "../../kexec.h" + #include "../../kexec-elf.h" + +Index: kexec-tools-2.0.0/kexec/arch/arm/kexec-zImage-arm.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/arch/arm/kexec-zImage-arm.c 2009-04-24 14:15:46.982825391 +0100 ++++ kexec-tools-2.0.0/kexec/arch/arm/kexec-zImage-arm.c 2009-04-26 01:58:20.838624318 +0200 +@@ -2,6 +2,10 @@ + * - 08/21/2007 ATAG support added by Uli Luckas + * + */ ++ ++/* work around for linux header files */ ++#define __deprecated ++ + #define _GNU_SOURCE + #include + #include +@@ -110,13 +114,13 @@ + } + + fread(buf, sizeof(buf[1]), BOOT_PARAMS_SIZE, fp); +- if (ferror(fp)) { ++/* if (ferror(fp)) { + fprintf(stderr, "Cannot read %s: %s\n", + fn, strerror(errno)); + fclose(fp); + return NULL; + } +- ++*/ + fclose(fp); + return (struct tag *) buf; + } +Index: kexec-tools-2.0.0/kexec/ifdown.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/ifdown.c 2009-04-24 14:15:34.025828340 +0100 ++++ kexec-tools-2.0.0/kexec/ifdown.c 2009-04-24 14:15:47.014827381 +0100 +@@ -14,7 +14,7 @@ + #include + #include + #include +-#include ++#include + + #include + #include +Index: kexec-tools-2.0.0/purgatory/Makefile +=================================================================== +--- kexec-tools-2.0.0.orig/purgatory/Makefile 2009-04-24 14:15:34.037827479 +0100 ++++ kexec-tools-2.0.0/purgatory/Makefile 2009-04-24 14:15:47.022825503 +0100 +@@ -47,6 +47,7 @@ + $(PURGATORY): CC=$(TARGET_CC) + $(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + -Os -fno-builtin -ffreestanding \ ++ -nostdinc \ + -fno-zero-initialized-in-bss + + $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ +Index: kexec-tools-2.0.0/kexec/kexec-elf-rel.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/kexec-elf-rel.c 2009-04-24 14:15:34.025828340 +0100 ++++ kexec-tools-2.0.0/kexec/kexec-elf-rel.c 2009-04-24 14:15:47.030825302 +0100 +@@ -4,7 +4,7 @@ + #include + #include + #include +-#include "elf.h" ++#include "../include/elf.h" + #include + #include "kexec.h" + #include "kexec-elf.h" +Index: kexec-tools-2.0.0/kexec/kexec-syscall.h +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/kexec-syscall.h 2009-04-24 14:15:46.950825917 +0100 ++++ kexec-tools-2.0.0/kexec/kexec-syscall.h 2009-04-24 14:15:47.030825302 +0100 +@@ -2,7 +2,7 @@ + #define KEXEC_SYSCALL_H + + #define __LIBRARY__ +-#include ++/*#include */ + #include + #include + +@@ -21,7 +21,7 @@ + #define LINUX_REBOOT_CMD_KEXEC_OLD 0x81726354 + #define LINUX_REBOOT_CMD_KEXEC_OLD2 0x18263645 + #define LINUX_REBOOT_CMD_KEXEC 0x45584543 +- ++/* + #ifdef __i386__ + #define __NR_kexec_load 283 + #endif +@@ -55,18 +55,19 @@ + #ifndef __NR_kexec_load + #error Unknown processor architecture. Needs a kexec_load syscall number. + #endif +- ++*/ + struct kexec_segment; +- ++/* + static inline long kexec_load(void *entry, unsigned long nr_segments, + struct kexec_segment *segments, unsigned long flags) + { + return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags); + } +- ++*/ + static inline long kexec_reboot(void) + { +- return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); ++ //return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); ++ return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0); + } + + +Index: kexec-tools-2.0.0/kexec/kexec.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/kexec.c 2009-04-24 14:15:46.950825917 +0100 ++++ kexec-tools-2.0.0/kexec/kexec.c 2009-04-26 01:58:53.545624148 +0200 +@@ -38,9 +38,7 @@ + + #include "config.h" + +-#ifdef HAVE_LIBZ +-#include +-#endif ++#include "zlib.h" + #include + #include "kexec.h" + #include "kexec-syscall.h" +Index: kexec-tools-2.0.0/kexec/crashdump.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/crashdump.old 2009-05-15 17:47:56.000000000 +0200 ++++ kexec-tools-2.0.0/kexec/crashdump.c 2009-05-15 13:28:19.000000000 +0200 +@@ -26,7 +26,7 @@ + #include + #include + #include +-#include ++#include "../../../include/elf.h" + #include "kexec.h" + #include "crashdump.h" + +Index: kexec-tools-2.0.0/kexec/crashdump-xen.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/crashdump-xen.c.old 2009-05-15 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/kexec/crashdump-xen.c 2009-05-15 17:49:04.000000000 +0200 +@@ -3,7 +3,7 @@ + #include + #include + #include +-#include ++#include "../../../include/elf.h" + #include + #include + #include -- cgit v1.2.3 From 6d20fd1c39bd27e73fc61fa109e8cea7d4645326 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Sat, 16 May 2009 14:50:45 +0200 Subject: kexec-tools-static_2.0.0: more fixes towards klibc static linking - still failing do_compile - FIXME: sha256_update was taken from old 1.110 version - FIXME: forced nr_cpus = 1 vs. nr_cpus = sysconf(_SC_NPROCESSORS_CONF) - don't bump PR - no runtime yet :/ --- recipes/kexec/files/kexec2-klibc.patch | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'recipes/kexec/files/kexec2-klibc.patch') diff --git a/recipes/kexec/files/kexec2-klibc.patch b/recipes/kexec/files/kexec2-klibc.patch index c52262bb5f..5422445d73 100644 --- a/recipes/kexec/files/kexec2-klibc.patch +++ b/recipes/kexec/files/kexec2-klibc.patch @@ -65,6 +65,28 @@ Index: kexec-tools-2.0.0/purgatory/Makefile -fno-zero-initialized-in-bss $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ +Index: kexec-tools-2.0.0/purgatory/purgatory.c +=================================================================== +--- kexec-tools-2.0.0.orig/purgatory/purgatory.old 2009-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/purgatory/purgatory.c 2009-05-16 14:15:21.000000000 +0200 +@@ -1,4 +1,4 @@ +- ++//#include + #include + #include + #include +@@ -18,8 +18,10 @@ + sha256_starts(&ctx); + end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])]; + for(ptr = sha256_regions; ptr < end; ptr++) { +- sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start), ++/* sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start), + ptr->len); ++*/ ++ sha256_update(&ctx, ptr->start, ptr->len); + } + sha256_finish(&ctx, digest); + if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) { Index: kexec-tools-2.0.0/kexec/kexec-elf-rel.c =================================================================== --- kexec-tools-2.0.0.orig/kexec/kexec-elf-rel.c 2009-04-24 14:15:34.025828340 +0100 @@ -165,3 +187,44 @@ Index: kexec-tools-2.0.0/kexec/crashdump-xen.c #include #include #include +Index: kexec-tools-2.0.0/kexec/crashdump-elf.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/crashdump-elf.c.old 2009-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/kexec/crashdump-elf.c 2009-05-16 11:12:15.000000000 +0200 +@@ -43,8 +43,8 @@ + if (xen_present()) + nr_cpus = xen_get_nr_phys_cpus(); + else +- nr_cpus = sysconf(_SC_NPROCESSORS_CONF); +- ++/* nr_cpus = sysconf(_SC_NPROCESSORS_CONF); */ ++ nr_cpus = 1; + if (nr_cpus < 0) { + return -1; + } +Index: kexec-tools-2.0.0/kexec/kexec-elf-boot.c +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/kexec-elf-boot.c.old 2009-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/kexec/kexec-elf-boot.c 2009-05-16 11:13:28.000000000 +0200 +@@ -22,7 +22,7 @@ + #include + #include + #include +-#include ++#include "../include/elf.h" + #include + #include + #include +Index: kexec-tools-2.0.0/kdump/kdump.c +=================================================================== +--- kexec-tools-2.0.0.orig/kdump/kdump.c.old 2009-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/kdump/kdump.c 2009-05-16 11:13:08.000000000 +0200 +@@ -8,7 +8,7 @@ + #include + #include + #include +-#include ++#include "../include/elf.h" + + #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN) + #error Endian defines missing -- cgit v1.2.3 From 71c53615c26094991223f503372dfbfd63f144f5 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Sat, 16 May 2009 18:22:54 +0200 Subject: kexec-tools-static_2.0.0: another step towards klibc statical linking - retry with purgatory.c - FIXME: kcc LDFLAGS - STILL FAILING BUILD --- recipes/kexec/files/kexec2-klibc.patch | 59 +++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 16 deletions(-) (limited to 'recipes/kexec/files/kexec2-klibc.patch') diff --git a/recipes/kexec/files/kexec2-klibc.patch b/recipes/kexec/files/kexec2-klibc.patch index 5422445d73..b80848d291 100644 --- a/recipes/kexec/files/kexec2-klibc.patch +++ b/recipes/kexec/files/kexec2-klibc.patch @@ -57,14 +57,17 @@ Index: kexec-tools-2.0.0/purgatory/Makefile =================================================================== --- kexec-tools-2.0.0.orig/purgatory/Makefile 2009-04-24 14:15:34.037827479 +0100 +++ kexec-tools-2.0.0/purgatory/Makefile 2009-04-24 14:15:47.022825503 +0100 -@@ -47,6 +47,7 @@ - $(PURGATORY): CC=$(TARGET_CC) - $(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ - -Os -fno-builtin -ffreestanding \ -+ -nostdinc \ - -fno-zero-initialized-in-bss +@@ -55,9 +54,7 @@ + -I$(srcdir)/purgatory/arch/$(ARCH)/include \ + -I$(srcdir)/util_lib/include \ + -I$(shell $(CC) -print-file-name=include) +-$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ +- --no-undefined -nostartfiles -nostdlib -nodefaultlibs \ +- -e purgatory_start -r ++$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) - $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + $(PURGATORY): $(PURGATORY_OBJS) + $(MKDIR) -p $(@D) Index: kexec-tools-2.0.0/purgatory/purgatory.c =================================================================== --- kexec-tools-2.0.0.orig/purgatory/purgatory.old 2009-05-16 13:28:19.000000000 +0200 @@ -75,15 +78,15 @@ Index: kexec-tools-2.0.0/purgatory/purgatory.c #include #include #include -@@ -18,8 +18,10 @@ - sha256_starts(&ctx); - end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])]; - for(ptr = sha256_regions; ptr < end; ptr++) { -- sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start), -+/* sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start), - ptr->len); -+*/ -+ sha256_update(&ctx, ptr->start, ptr->len); +@@ -3,7 +3,7 @@ + #include + #include + #include +-#include ++/* #include */ + #include "../kexec/kexec-sha256.h" + + struct sha256_region sha256_regions[SHA256_REGIONS] = {}; } sha256_finish(&ctx, digest); if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) { @@ -228,3 +231,27 @@ Index: kexec-tools-2.0.0/kdump/kdump.c #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN) #error Endian defines missing +Index: kexec-tools-2.0.0/kexec/kexec.h +=================================================================== +--- kexec-tools-2.0.0.orig/kexec/kexec.h.old 2008-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/kexec/kexec.h 2009-05-16 17:32:15.000000000 +0200 +@@ -197,7 +197,7 @@ + extern char *slurp_file(const char *filename, off_t *r_size); + extern char *slurp_file_len(const char *filename, off_t size); + extern char *slurp_decompress_file(const char *filename, off_t *r_size); +-extern unsigned long virt_to_phys(unsigned long addr); ++/* extern unsigned long virt_to_phys(unsigned long addr); */ + extern void add_segment(struct kexec_info *info, + const void *buf, size_t bufsz, unsigned long base, size_t memsz); + extern void add_segment_phys_virt(struct kexec_info *info, +Index: kexec-tools-2.0.0/purgatory/string.c +=================================================================== +--- kexec-tools-2.0.0.orig/purgatory/string.c.old 2008-05-16 13:28:19.000000000 +0200 ++++ kexec-tools-2.0.0/purgatory/string.c 2009-05-16 17:49:04.000000000 +0200 +@@ -1,5 +1,5 @@ + #include +-#include ++/* #include */ + + size_t strnlen(const char *s, size_t max) + { -- cgit v1.2.3 From 5d7b852d1b7e2d34a803ce01c0ea96bc926f96bd Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Tue, 19 May 2009 23:37:47 +0200 Subject: kexec-tools-static_2.0.0: add --nostdinc to purgatory Makefile makefile --- recipes/kexec/files/kexec2-klibc.patch | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'recipes/kexec/files/kexec2-klibc.patch') diff --git a/recipes/kexec/files/kexec2-klibc.patch b/recipes/kexec/files/kexec2-klibc.patch index b80848d291..a7dbe61d13 100644 --- a/recipes/kexec/files/kexec2-klibc.patch +++ b/recipes/kexec/files/kexec2-klibc.patch @@ -55,19 +55,16 @@ Index: kexec-tools-2.0.0/kexec/ifdown.c #include Index: kexec-tools-2.0.0/purgatory/Makefile =================================================================== ---- kexec-tools-2.0.0.orig/purgatory/Makefile 2009-04-24 14:15:34.037827479 +0100 -+++ kexec-tools-2.0.0/purgatory/Makefile 2009-04-24 14:15:47.022825503 +0100 -@@ -55,9 +54,7 @@ - -I$(srcdir)/purgatory/arch/$(ARCH)/include \ - -I$(srcdir)/util_lib/include \ - -I$(shell $(CC) -print-file-name=include) --$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ -- --no-undefined -nostartfiles -nostdlib -nodefaultlibs \ -- -e purgatory_start -r -+$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) +--- kexec-tools-2.0.0.orig/purgatory/Makefile 2009-05-19 14:15:34.037827479 +0100 ++++ kexec-tools-2.0.0/purgatory/Makefile 2009-05-19 14:15:47.022825503 +0100 +@@ -47,6 +47,7 @@ + $(PURGATORY): CC=$(TARGET_CC) + $(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + -Os -fno-builtin -ffreestanding \ ++ -nostdinc \ + -fno-zero-initialized-in-bss - $(PURGATORY): $(PURGATORY_OBJS) - $(MKDIR) -p $(@D) + $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ Index: kexec-tools-2.0.0/purgatory/purgatory.c =================================================================== --- kexec-tools-2.0.0.orig/purgatory/purgatory.old 2009-05-16 13:28:19.000000000 +0200 -- cgit v1.2.3