diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2013-05-13 01:22:23 +0200 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-05-13 09:50:24 +0100 |
commit | 97957e5cee9a797d3e05c1a8848338a033f40770 (patch) | |
tree | 59351568b51e711b80ca3fff348e61d9079eaf01 /meta-initramfs | |
parent | 06318f320803814ac7f2827473a8e46a8eb0d8cb (diff) | |
download | meta-openembedded-97957e5cee9a797d3e05c1a8848338a033f40770.tar.gz |
kexec-tools-klibc_2.0.2: refactor and extend patches for building
* some old patches apparently unneeded have been removed
* patches are now better split
* fix build for x86 and x86-64
* tested with qemuarm, qemuppc, qemumips, qemux86, qemux86-64
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'meta-initramfs')
19 files changed, 265 insertions, 228 deletions
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch new file mode 100644 index 000000000..0ff61e543 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/arm_crashdump.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- a/kexec/arch/arm/crashdump-arm.c | ||
2 | +++ b/kexec/arch/arm/crashdump-arm.c | ||
3 | @@ -20,7 +20,7 @@ | ||
4 | * along with this program; if not, write to the Free Software | ||
5 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
6 | */ | ||
7 | -#include <elf.h> | ||
8 | +#include "../../../include/elf.h" | ||
9 | #include <errno.h> | ||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch new file mode 100644 index 000000000..35100a3b4 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/cflags_static.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/Makefile.in | ||
2 | +++ b/Makefile.in | ||
3 | @@ -46,7 +46,7 @@ | ||
4 | # where necessary. | ||
5 | CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \ | ||
6 | -Iinclude/ | ||
7 | -CFLAGS = @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
8 | +CFLAGS = @CFLAGS@ -static -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
9 | PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@ | ||
10 | ASFLAGS = @ASFLAGS@ | ||
11 | LDFLAGS = @LDFLAGS@ | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/elf.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/elf.patch deleted file mode 100644 index 0eef4b4f5..000000000 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/elf.patch +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | Index: kexec-tools-2.0.2/kexec/kexec-elf-rel.c | ||
2 | =================================================================== | ||
3 | --- kexec-tools-2.0.2.orig/kexec/kexec-elf-rel.c 2009-09-24 14:15:34.025828340 +0100 | ||
4 | +++ kexec-tools-2.0.2/kexec/kexec-elf-rel.c 2009-09-24 14:15:47.030825302 +0100 | ||
5 | @@ -4,7 +4,7 @@ | ||
6 | #include <stdio.h> | ||
7 | #include <errno.h> | ||
8 | #include <stdlib.h> | ||
9 | -#include "elf.h" | ||
10 | +#include "../include/elf.h" | ||
11 | #include <boot/elf_boot.h> | ||
12 | #include "kexec.h" | ||
13 | #include "kexec-elf.h" | ||
14 | Index: kexec-tools-2.0.2/kexec/crashdump.c | ||
15 | =================================================================== | ||
16 | --- kexec-tools-2.0.2.orig/kexec/crashdump.c 2008-10-31 03:00:38.000000000 +0100 | ||
17 | +++ kexec-tools-2.0.2/kexec/crashdump.c 2009-09-26 11:16:27.000000000 +0200 | ||
18 | @@ -26,7 +26,7 @@ | ||
19 | #include <sys/types.h> | ||
20 | #include <sys/stat.h> | ||
21 | #include <unistd.h> | ||
22 | -#include <elf.h> | ||
23 | +#include "../../../include/elf.h" | ||
24 | #include "kexec.h" | ||
25 | #include "crashdump.h" | ||
26 | #include "kexec-syscall.h" | ||
27 | |||
28 | Index: kexec-tools-2.0.2/kexec/crashdump-xen.c | ||
29 | =================================================================== | ||
30 | --- kexec-tools-2.0.2.orig/kexec/crashdump-xen.c 2008-07-15 02:46:43.000000000 +0200 | ||
31 | +++ kexec-tools-2.0.2/kexec/crashdump-xen.c 2009-09-26 11:16:41.000000000 +0200 | ||
32 | @@ -3,7 +3,7 @@ | ||
33 | #include <stdarg.h> | ||
34 | #include <string.h> | ||
35 | #include <stdlib.h> | ||
36 | -#include <elf.h> | ||
37 | +#include "../../../include/elf.h" | ||
38 | #include <errno.h> | ||
39 | #include <limits.h> | ||
40 | #include <sys/types.h> | ||
41 | |||
42 | Index: kexec-tools-2.0.2/kexec/arch/arm/kexec-elf-rel-arm.c | ||
43 | =================================================================== | ||
44 | --- kexec-tools-2.0.2.orig/kexec/arch/arm/kexec-elf-rel-arm.c 2009-04-24 14:15:46.934825202 +0100 | ||
45 | +++ kexec-tools-2.0.2/kexec/arch/arm/kexec-elf-rel-arm.c 2009-09-24 14:15:47.014827381 +0100 | ||
46 | @@ -1,5 +1,5 @@ | ||
47 | #include <stdio.h> | ||
48 | -#include <elf.h> | ||
49 | +#include "../../../include/elf.h" | ||
50 | #include "../../kexec.h" | ||
51 | #include "../../kexec-elf.h" | ||
52 | |||
53 | Index: kexec-tools-2.0.2/kexec/kexec-elf-boot.c | ||
54 | =================================================================== | ||
55 | --- kexec-tools-2.0.2.orig/kexec/kexec-elf-boot.c 2009-05-16 13:28:19.000000000 +0200 | ||
56 | +++ kexec-tools-2.0.2/kexec/kexec-elf-boot.c 2009-09-16 11:13:28.000000000 +0200 | ||
57 | @@ -22,7 +22,7 @@ | ||
58 | #include <string.h> | ||
59 | #include <stdlib.h> | ||
60 | #include <errno.h> | ||
61 | -#include <elf.h> | ||
62 | +#include "../include/elf.h" | ||
63 | #include <boot/elf_boot.h> | ||
64 | #include <ip_checksum.h> | ||
65 | #include <x86/x86-linux.h> | ||
66 | |||
67 | Index: kexec-tools-2.0.2/kdump/kdump.c | ||
68 | =================================================================== | ||
69 | --- kexec-tools-2.0.2.orig/kdump/kdump.c 2009-05-16 13:28:19.000000000 +0200 | ||
70 | +++ kexec-tools-2.0.2/kdump/kdump.c 2009-09-16 11:13:08.000000000 +0200 | ||
71 | @@ -8,7 +8,7 @@ | ||
72 | #include <sys/stat.h> | ||
73 | #include <fcntl.h> | ||
74 | #include <endian.h> | ||
75 | -#include <elf.h> | ||
76 | +#include "../include/elf.h" | ||
77 | |||
78 | #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN) | ||
79 | #error Endian defines missing | ||
80 | |||
81 | Index: kexec-tools-2.0.2/kexec/arch/arm/crashdump-arm.c | ||
82 | =================================================================== | ||
83 | --- kexec-tools-2.0.2.old/kexec/arch/arm/crashdump-arm.c 2010-08-01 15:07:47.000000000 +0200 | ||
84 | +++ kexec-tools-2.0.2/kexec/arch/arm/crashdump-arm.c 2010-07-29 06:19:59.000000000 +0200 | ||
85 | @@ -20,7 +20,7 @@ | ||
86 | * along with this program; if not, write to the Free Software | ||
87 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
88 | */ | ||
89 | -#include <elf.h> | ||
90 | +#include "../../../include/elf.h" | ||
91 | #include <errno.h> | ||
92 | #include <stdio.h> | ||
93 | #include <stdlib.h> | ||
94 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/errno.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/errno.patch deleted file mode 100644 index c56b5a980..000000000 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/errno.patch +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | Index: kexec-tools-2.0.2/kexec/ifdown.c | ||
2 | =================================================================== | ||
3 | --- kexec-tools-2.0.2.orig/kexec/ifdown.c 2009-09-24 14:15:34.025828340 +0100 | ||
4 | +++ kexec-tools-2.0.2/kexec/ifdown.c 2009-09-24 14:15:47.014827381 +0100 | ||
5 | @@ -14,7 +14,7 @@ | ||
6 | #include <sys/ioctl.h> | ||
7 | #include <sys/socket.h> | ||
8 | #include <sys/time.h> | ||
9 | -#include <sys/errno.h> | ||
10 | +#include <errno.h> | ||
11 | |||
12 | #include <net/if.h> | ||
13 | #include <netinet/in.h> \ No newline at end of file | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch new file mode 100644 index 000000000..7f8cddd35 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ifdown_errno.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/kexec/ifdown.c | ||
2 | +++ b/kexec/ifdown.c | ||
3 | @@ -14,7 +14,7 @@ | ||
4 | #include <sys/ioctl.h> | ||
5 | #include <sys/socket.h> | ||
6 | #include <sys/time.h> | ||
7 | -#include <sys/errno.h> | ||
8 | +#include <errno.h> | ||
9 | |||
10 | #include <net/if.h> | ||
11 | #include <netinet/in.h> | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch new file mode 100644 index 000000000..c666afcac --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-elf-rel.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | --- a/kexec/kexec-elf-rel.c | ||
2 | +++ b/kexec/kexec-elf-rel.c | ||
3 | @@ -4,7 +4,7 @@ | ||
4 | #include <stdio.h> | ||
5 | #include <errno.h> | ||
6 | #include <stdlib.h> | ||
7 | -#include "elf.h" | ||
8 | +#include "../include/elf.h" | ||
9 | #include <boot/elf_boot.h> | ||
10 | #include "kexec.h" | ||
11 | #include "kexec-elf.h" | ||
12 | |||
13 | --- a/kexec/arch/arm/kexec-elf-rel-arm.c | ||
14 | +++ b/kexec/arch/arm/kexec-elf-rel-arm.c | ||
15 | @@ -1,5 +1,5 @@ | ||
16 | #include <stdio.h> | ||
17 | -#include <elf.h> | ||
18 | +#include "../../../include/elf.h" | ||
19 | #include "../../kexec.h" | ||
20 | #include "../../kexec-elf.h" | ||
21 | |||
22 | |||
23 | --- a/kexec/arch/i386/kexec-elf-rel-x86.c | ||
24 | +++ b/kexec/arch/i386/kexec-elf-rel-x86.c | ||
25 | @@ -1,5 +1,5 @@ | ||
26 | #include <stdio.h> | ||
27 | -#include <elf.h> | ||
28 | +#include "../../../include/elf.h" | ||
29 | #include "../../kexec.h" | ||
30 | #include "../../kexec-elf.h" | ||
31 | |||
32 | |||
33 | --- a/kexec/arch/ppc/kexec-elf-rel-ppc.c | ||
34 | +++ b/kexec/arch/ppc/kexec-elf-rel-ppc.c | ||
35 | @@ -1,5 +1,5 @@ | ||
36 | #include <stdio.h> | ||
37 | -#include <elf.h> | ||
38 | +#include "../../../include/elf.h" | ||
39 | #include "../../kexec.h" | ||
40 | #include "../../kexec-elf.h" | ||
41 | |||
42 | |||
43 | --- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c | ||
44 | +++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c | ||
45 | @@ -1,5 +1,5 @@ | ||
46 | #include <stdio.h> | ||
47 | -#include <elf.h> | ||
48 | +#include "../../../include/elf.h" | ||
49 | #include <string.h> | ||
50 | #include "../../kexec.h" | ||
51 | #include "../../kexec-elf.h" | ||
52 | |||
53 | --- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c | ||
54 | +++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c | ||
55 | @@ -1,5 +1,5 @@ | ||
56 | #include <stdio.h> | ||
57 | -#include <elf.h> | ||
58 | +#include "../../../include/elf.h" | ||
59 | #include "../../kexec.h" | ||
60 | #include "../../kexec-elf.h" | ||
61 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/syscall.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-syscall.patch index ae2e3f6a6..081de1bb5 100644 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/syscall.patch +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/kexec-syscall.patch | |||
@@ -1,7 +1,5 @@ | |||
1 | Index: kexec-tools-2.0.2/kexec/kexec-syscall.h | 1 | --- a/kexec/kexec-syscall.h |
2 | =================================================================== | 2 | +++ b/kexec/kexec-syscall.h |
3 | --- kexec-tools-2.0.2.orig/kexec/kexec-syscall.h 2010-07-29 06:19:59.000000000 +0200 | ||
4 | +++ kexec-tools-2.0.2/kexec/kexec-syscall.h 2010-08-02 00:13:39.000000000 +0200 | ||
5 | @@ -2,7 +2,7 @@ | 3 | @@ -2,7 +2,7 @@ |
6 | #define KEXEC_SYSCALL_H | 4 | #define KEXEC_SYSCALL_H |
7 | 5 | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/other.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/other.patch deleted file mode 100644 index f6efaebc4..000000000 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/other.patch +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | Index: kexec-tools-2.0.2/kexec/crashdump-elf.c | ||
2 | =================================================================== | ||
3 | --- kexec-tools-2.0.2.orig/kexec/crashdump-elf.c 2008-10-31 03:00:38.000000000 +0100 | ||
4 | +++ kexec-tools-2.0.2/kexec/crashdump-elf.c 2009-09-26 11:17:57.000000000 +0200 | ||
5 | @@ -47,7 +47,8 @@ | ||
6 | if (xen_present()) | ||
7 | nr_cpus = xen_get_nr_phys_cpus(); | ||
8 | else | ||
9 | - nr_cpus = sysconf(_SC_NPROCESSORS_CONF); | ||
10 | + /*nr_cpus = sysconf(_SC_NPROCESSORS_CONF);*/ | ||
11 | + nr_cpus = 1; | ||
12 | |||
13 | if (nr_cpus < 0) { | ||
14 | return -1; | ||
15 | |||
16 | Index: kexec-tools-2.0.2/kexec/arch/arm/kexec-zImage-arm.c | ||
17 | =================================================================== | ||
18 | --- kexec-tools-2.0.2.orig/kexec/arch/arm/kexec-zImage-arm.c 2009-04-24 14:15:46.982825391 +0100 | ||
19 | +++ kexec-tools-2.0.2/kexec/arch/arm/kexec-zImage-arm.c 2009-09-26 01:58:20.838624318 +0200 | ||
20 | @@ -2,6 +2,10 @@ | ||
21 | * - 08/21/2007 ATAG support added by Uli Luckas <u.luckas@road.de> | ||
22 | * | ||
23 | */ | ||
24 | + | ||
25 | +/* work around for linux header files */ | ||
26 | +#define __deprecated | ||
27 | + | ||
28 | #define _GNU_SOURCE | ||
29 | #define _XOPEN_SOURCE | ||
30 | #include <stdio.h> | ||
31 | |||
32 | Index: kexec-tools-2.0.2/kexec/kexec.h | ||
33 | =================================================================== | ||
34 | --- kexec-tools-2.0.2.orig/kexec/kexec.h 2008-05-16 13:28:19.000000000 +0200 | ||
35 | +++ kexec-tools-2.0.2/kexec/kexec.h 2009-09-16 17:32:15.000000000 +0200 | ||
36 | @@ -204,7 +204,7 @@ | ||
37 | extern char *slurp_file(const char *filename, off_t *r_size); | ||
38 | extern char *slurp_file_len(const char *filename, off_t size); | ||
39 | extern char *slurp_decompress_file(const char *filename, off_t *r_size); | ||
40 | -extern unsigned long virt_to_phys(unsigned long addr); | ||
41 | +/* extern unsigned long virt_to_phys(unsigned long addr); */ | ||
42 | extern void add_segment(struct kexec_info *info, | ||
43 | const void *buf, size_t bufsz, unsigned long base, size_t memsz); | ||
44 | extern void add_segment_phys_virt(struct kexec_info *info, | ||
45 | |||
46 | Index: kexec-tools-2.0.2/Makefile.in | ||
47 | =================================================================== | ||
48 | --- kexec-tools-2.0.2.orig/Makefile.in 2009-09-29 23:49:47.000000000 +0200 | ||
49 | +++ kexec-tools-2.0.2/Makefile.in 2009-09-29 23:49:09.000000000 +0200 | ||
50 | @@ -46,7 +46,7 @@ | ||
51 | # where necessary. | ||
52 | CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \ | ||
53 | -Iinclude/ | ||
54 | -CFLAGS = @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
55 | +CFLAGS = @CFLAGS@ -static -fno-strict-aliasing -Wall -Wstrict-prototypes | ||
56 | PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@ | ||
57 | ASFLAGS = @ASFLAGS@ | ||
58 | LDFLAGS = @LDFLAGS@ | ||
59 | |||
60 | Index: kexec-tools-2.0.2/util_lib/include/sha256.h | ||
61 | =================================================================== | ||
62 | --- kexec-tools-2.0.2.orig/util_lib/include/sha256.h 2008-07-15 02:46:43.000000000 +0200 | ||
63 | +++ kexec-tools-2.0.2/util_lib/include/sha256.h 2009-10-02 18:28:45.000000000 +0200 | ||
64 | @@ -1,7 +1,8 @@ | ||
65 | #ifndef SHA256_H | ||
66 | #define SHA256_H | ||
67 | |||
68 | -#include <sys/types.h> | ||
69 | +//#include <sys/types.h> | ||
70 | +#include <stddef.h> | ||
71 | #include <stdint.h> | ||
72 | |||
73 | typedef struct | ||
74 | |||
75 | Index: kexec-tools-2.0.2/purgatory/Makefile | ||
76 | =================================================================== | ||
77 | --- kexec-tools-2.0.2.orig/purgatory/Makefile 2008-10-09 00:32:14.000000000 +0200 | ||
78 | +++ kexec-tools-2.0.2.orig/purgatory/Makefile 2009-10-03 00:28:45.000000000 +0200 | ||
79 | @@ -47,7 +47,7 @@ | ||
80 | $(PURGATORY): CC=$(TARGET_CC) | ||
81 | $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \ | ||
82 | $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
83 | - -Os -fno-builtin -ffreestanding | ||
84 | + -Os -fno-builtin -ffreestanding -nostdinc | ||
85 | |||
86 | $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
87 | -I$(srcdir)/purgatory/include \ | ||
88 | @@ -61,7 +61,8 @@ | ||
89 | |||
90 | $(PURGATORY): $(PURGATORY_OBJS) | ||
91 | $(MKDIR) -p $(@D) | ||
92 | - $(CC) $(LDFLAGS) -o $@ $^ | ||
93 | +# $(CC) $(LDFLAGS) -o $@ $^ | ||
94 | + $(LD) $(LDFLAGS) -o $@ $^ | ||
95 | |||
96 | # $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB) | ||
97 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch new file mode 100644 index 000000000..56cdfb08d --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/ppc__lshrdi3.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | --- a/purgatory/arch/ppc/crt.S | ||
2 | +++ b/purgatory/arch/ppc/crt.S | ||
3 | @@ -249,6 +249,7 @@ | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | +/* already defined in misc.S | ||
8 | _GLOBAL(__lshrdi3) | ||
9 | subfic 6,5,32 | ||
10 | srw 4,4,5 # LSW = count > 31 ? 0 : LSW >> count | ||
11 | @@ -259,5 +260,7 @@ | ||
12 | srw 3,3,5 # MSW = MSW >> count | ||
13 | or 4,4,7 # LSW |= t2 | ||
14 | blr | ||
15 | +*/ | ||
16 | + | ||
17 | #endif | ||
18 | #endif | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch new file mode 100644 index 000000000..41fc1168f --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_flags.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | --- a/purgatory/Makefile | ||
2 | +++ b/purgatory/Makefile | ||
3 | @@ -47,7 +47,7 @@ | ||
4 | $(PURGATORY): CC=$(TARGET_CC) | ||
5 | $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \ | ||
6 | $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
7 | - -Os -fno-builtin -ffreestanding | ||
8 | + -Os -fno-builtin -ffreestanding -nostdinc | ||
9 | |||
10 | $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ | ||
11 | -I$(srcdir)/purgatory/include \ | ||
12 | @@ -61,7 +61,8 @@ | ||
13 | |||
14 | $(PURGATORY): $(PURGATORY_OBJS) | ||
15 | $(MKDIR) -p $(@D) | ||
16 | - $(CC) $(LDFLAGS) -o $@ $^ | ||
17 | +# $(CC) $(LDFLAGS) -o $@ $^ | ||
18 | + $(LD) $(LDFLAGS) -o $@ $^ | ||
19 | |||
20 | # $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB) | ||
21 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch new file mode 100644 index 000000000..5710561b1 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/purgatory_string.patch | |||
@@ -0,0 +1,9 @@ | |||
1 | --- a/purgatory/string.c | ||
2 | +++ b/purgatory/string.c | ||
3 | @@ -1,5 +1,5 @@ | ||
4 | #include <stddef.h> | ||
5 | -#include <string.h> | ||
6 | +/* #include <string.h> */ | ||
7 | |||
8 | size_t strnlen(const char *s, size_t max) | ||
9 | { | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch new file mode 100644 index 000000000..85bf7aa4f --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sha256.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/util_lib/include/sha256.h | ||
2 | +++ b/util_lib/include/sha256.h | ||
3 | @@ -1,7 +1,8 @@ | ||
4 | #ifndef SHA256_H | ||
5 | #define SHA256_H | ||
6 | |||
7 | -#include <sys/types.h> | ||
8 | +//#include <sys/types.h> | ||
9 | +#include <stddef.h> | ||
10 | #include <stdint.h> | ||
11 | |||
12 | typedef struct | ||
13 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/string.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/string.patch deleted file mode 100644 index 7d27e3998..000000000 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/string.patch +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | Index: kexec-tools-2.0.2/purgatory/string.c | ||
2 | =================================================================== | ||
3 | --- kexec-tools-2.0.2.orig/purgatory/string.c 2008-05-16 13:28:19.000000000 +0200 | ||
4 | +++ kexec-tools-2.0.2/purgatory/string.c 2009-09-16 17:49:04.000000000 +0200 | ||
5 | @@ -1,5 +1,5 @@ | ||
6 | #include <stddef.h> | ||
7 | -#include <string.h> | ||
8 | +/* #include <string.h> */ | ||
9 | |||
10 | size_t strnlen(const char *s, size_t max) | ||
11 | { | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch new file mode 100644 index 000000000..04a97e6bc --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/sysconf_nrprocessors.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/kexec/crashdump-elf.c | ||
2 | +++ b/kexec/crashdump-elf.c | ||
3 | @@ -47,7 +47,8 @@ | ||
4 | if (xen_present()) | ||
5 | nr_cpus = xen_get_nr_phys_cpus(); | ||
6 | else | ||
7 | - nr_cpus = sysconf(_SC_NPROCESSORS_CONF); | ||
8 | + /*nr_cpus = sysconf(_SC_NPROCESSORS_CONF);*/ | ||
9 | + nr_cpus = 1; | ||
10 | |||
11 | if (nr_cpus < 0) { | ||
12 | return -1; | ||
13 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch new file mode 100644 index 000000000..200fb1dd9 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_basename.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | --- a/kexec/arch/i386/x86-linux-setup.c | ||
2 | +++ b/kexec/arch/i386/x86-linux-setup.c | ||
3 | @@ -280,9 +280,9 @@ static int add_edd_entry(struct x86_linu | ||
4 | memset(edd_info, 0, sizeof(struct edd_info)); | ||
5 | |||
6 | /* extract the device number */ | ||
7 | - if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) { | ||
8 | + if (sscanf(strrchr(sysfs_name,'/') + 1, "int13_dev%hhx", &devnum) != 1) { | ||
9 | fprintf(stderr, "Invalid format of int13_dev dir " | ||
10 | - "entry: %s\n", basename(sysfs_name)); | ||
11 | + "entry: %s\n", strrchr(sysfs_name,'/') + 1); | ||
12 | return -1; | ||
13 | } | ||
14 | \ No newline at end of file | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch new file mode 100644 index 000000000..9500bd604 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_kexec_test.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- a/Makefile.in | ||
2 | +++ b/Makefile.in | ||
3 | @@ -106,8 +106,8 @@ | ||
4 | |||
5 | MAN_PAGES:= kexec/kexec.8 | ||
6 | MAN_PAGES+= kdump/kdump.8 | ||
7 | -BINARIES_i386:= $(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test | ||
8 | -BINARIES_x86_64:=$(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test | ||
9 | +BINARIES_i386:= $(SBINDIR)/kexec | ||
10 | +BINARIES_x86_64:=$(SBINDIR)/kexec | ||
11 | BINARIES:=$(SBINDIR)/kexec $(SBINDIR)/kdump $(BINARIES_$(ARCH)) | ||
12 | |||
13 | TARGETS:=$(BINARIES) $(MAN_PAGES) | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch new file mode 100644 index 000000000..a497c9a63 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_sys_io.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | --- a/purgatory/arch/i386/pic.c | ||
2 | +++ b/purgatory/arch/i386/pic.c | ||
3 | @@ -16,7 +16,7 @@ | ||
4 | * along with this program; if not, write to the Free Software | ||
5 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
6 | */ | ||
7 | -#include <sys/io.h> | ||
8 | +#include "include/arch/io.h" | ||
9 | #include <purgatory.h> | ||
10 | #include "purgatory-x86.h" | ||
11 | |||
12 | |||
13 | --- a/purgatory/arch/i386/vga.c | ||
14 | +++ b/purgatory/arch/i386/vga.c | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#include <sys/io.h> | ||
17 | +#include "include/arch/io.h" | ||
18 | #include <purgatory.h> | ||
19 | #include "purgatory-x86.h" | ||
20 | |||
21 | |||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch new file mode 100644 index 000000000..14f4d2ada --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- a/kexec/arch/i386/x86-linux-setup.c | ||
2 | +++ b/kexec/arch/i386/x86-linux-setup.c | ||
3 | @@ -176,6 +176,8 @@ static int file_scanf(const char *dir, c | ||
4 | FILE *fp; | ||
5 | int retno; | ||
6 | char filename[PATH_MAX]; | ||
7 | + long line_size = MAX_LINE; | ||
8 | + char *line; | ||
9 | |||
10 | snprintf(filename, PATH_MAX, "%s/%s", dir, file); | ||
11 | filename[PATH_MAX-1] = 0; | ||
12 | @@ -186,7 +188,14 @@ static int file_scanf(const char *dir, c | ||
13 | } | ||
14 | |||
15 | va_start(argptr, scanf_line); | ||
16 | - retno = vfscanf(fp, scanf_line, argptr); | ||
17 | + | ||
18 | + line = xmalloc(sizeof(line) * line_size); | ||
19 | + while(fgets(line, sizeof(line), fp) != 0 ) { | ||
20 | + line_size += MAX_LINE; | ||
21 | + line = xrealloc(line,line_size); | ||
22 | + } | ||
23 | + retno = vsscanf(line, scanf_line, argptr); | ||
24 | + | ||
25 | va_end(argptr); | ||
26 | |||
27 | fclose(fp); | ||
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb index 90b876cdd..eedcaa557 100644 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb | |||
@@ -7,20 +7,30 @@ inherit klibc | |||
7 | 7 | ||
8 | FILESPATH =. "${FILE_DIRNAME}/kexec-tools-${PV}:" | 8 | FILESPATH =. "${FILE_DIRNAME}/kexec-tools-${PV}:" |
9 | 9 | ||
10 | SRC_URI += "file://elf.patch \ | 10 | SRC_URI += " \ |
11 | file://errno.patch \ | 11 | file://kexec-elf-rel.patch \ |
12 | file://string.patch \ | 12 | file://kexec-syscall.patch \ |
13 | file://syscall.patch \ | 13 | file://cflags_static.patch \ |
14 | file://other.patch \ | 14 | file://ifdown_errno.patch \ |
15 | " | 15 | file://purgatory_flags.patch \ |
16 | file://purgatory_string.patch \ | ||
17 | file://sha256.patch \ | ||
18 | file://sysconf_nrprocessors.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI_append_arm = " file://arm_crashdump.patch" | ||
22 | SRC_URI_append_powerpc = " file://ppc__lshrdi3.patch" | ||
23 | SRC_URI_append_x86 = " file://x86_sys_io.patch file://x86_basename.patch file://x86_vfscanf.patch file://x86_kexec_test.patch" | ||
24 | SRC_URI_append_x86-64 = " file://x86_sys_io.patch file://x86_basename.patch file://x86_vfscanf.patch file://x86_kexec_test.patch" | ||
16 | 25 | ||
17 | S = "${WORKDIR}/kexec-tools-${PV}" | 26 | S = "${WORKDIR}/kexec-tools-${PV}" |
18 | 27 | ||
19 | EXTRA_OECONF += "--without-zlib" | 28 | EXTRA_OECONF += "--without-zlib --without-lzma --without-xen" |
20 | |||
21 | PACKAGES =+ "kexec-klibc kdump-klibc" | ||
22 | 29 | ||
23 | CFLAGS += "-I${STAGING_DIR_HOST}${base_libdir}/klibc/include -I${STAGING_DIR_HOST}${base_libdir}/klibc/include/bits32" | 30 | CFLAGS += "-I${STAGING_DIR_HOST}${base_libdir}/klibc/include -I${STAGING_DIR_HOST}${base_libdir}/klibc/include/bits32" |
31 | CFLAGS_x86-64 += "-I${STAGING_DIR_HOST}${base_libdir}/klibc/include -I${STAGING_DIR_HOST}${base_libdir}/klibc/include/bits64" | ||
32 | |||
33 | PACKAGES =+ "kexec-klibc kdump-klibc" | ||
24 | 34 | ||
25 | FILES_kexec-klibc = "${sbindir}/kexec" | 35 | FILES_kexec-klibc = "${sbindir}/kexec" |
26 | FILES_kdump-klibc = "${sbindir}/kdump" | 36 | FILES_kdump-klibc = "${sbindir}/kdump" |