kexec-tools-static_2.0.0: more fixes towards klibc static linking
authorAndrea Adami <andrea.adami@gmail.com>
Sat, 16 May 2009 12:50:45 +0000 (14:50 +0200)
committerAndrea Adami <andrea.adami@gmail.com>
Sat, 16 May 2009 12:50:45 +0000 (14:50 +0200)
 - 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

index c52262b..5422445 100644 (file)
@@ -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 <stdarg.h>
+ #include <limits.h>
+ #include <stdint.h>
+ #include <purgatory.h>
+@@ -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 <errno.h>
  #include <limits.h>
  #include <sys/types.h>
+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 <string.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <elf.h>
++#include "../include/elf.h"
+ #include <boot/elf_boot.h>
+ #include <ip_checksum.h>
+ #include <x86/x86-linux.h>
+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 <sys/stat.h>
+ #include <fcntl.h>
+ #include <endian.h>
+-#include <elf.h>
++#include "../include/elf.h"
+
+ #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN)
+ #error Endian defines missing