summaryrefslogtreecommitdiffstats
path: root/meta/packages
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2010-07-02 10:09:04 +0800
committerSaul Wold <Saul.Wold@intel.com>2010-07-02 15:32:47 -0700
commit128a2f7f51900dbc31879497632513a8dff5b6e3 (patch)
tree506c259bdc7435b28a13798c4609d6f04093da57 /meta/packages
parent15c9e54368104848d481509da4007752bbafb101 (diff)
downloadpoky-128a2f7f51900dbc31879497632513a8dff5b6e3.tar.gz
kexec-tools: Upgraded to version 2.0.1
Removed kexec-arm-atags.patch kexec-tools-arm.patch and recentheader.patch since they are already contained in the latest package Also fix the metadata Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Diffstat (limited to 'meta/packages')
-rw-r--r--meta/packages/kexec/kexec-tools-1.101/kexec-arm-atags.patch294
-rw-r--r--meta/packages/kexec/kexec-tools-1.101/kexec-tools-arm.patch417
-rw-r--r--meta/packages/kexec/kexec-tools-1.101/recentheader.patch34
-rw-r--r--meta/packages/kexec/kexec-tools-2.0.1/configurefix.patch (renamed from meta/packages/kexec/kexec-tools-1.101/configurefix.patch)6
-rw-r--r--meta/packages/kexec/kexec-tools.inc15
-rw-r--r--meta/packages/kexec/kexec-tools_2.0.1.bb (renamed from meta/packages/kexec/kexec-tools_1.101.bb)2
6 files changed, 14 insertions, 754 deletions
diff --git a/meta/packages/kexec/kexec-tools-1.101/kexec-arm-atags.patch b/meta/packages/kexec/kexec-tools-1.101/kexec-arm-atags.patch
deleted file mode 100644
index bf6f640035..0000000000
--- a/meta/packages/kexec/kexec-tools-1.101/kexec-arm-atags.patch
+++ /dev/null
@@ -1,294 +0,0 @@
1---
2 kexec/arch/arm/kexec-zImage-arm.c | 259 ++++++++++++++++++++++++++++++++++++--
3 1 file changed, 252 insertions(+), 7 deletions(-)
4
5Index: kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c
6===================================================================
7--- kexec-tools-1.101.orig/kexec/arch/arm/kexec-zImage-arm.c 2007-12-26 21:17:07.000000000 +0000
8+++ kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c 2007-12-27 01:24:25.000000000 +0000
9@@ -1,11 +1,83 @@
10+/*
11+ * - 08/21/2007 ATAG support added by Uli Luckas <u.luckas@road.de>
12+ *
13+ */
14 #define _GNU_SOURCE
15 #include <stdio.h>
16 #include <string.h>
17 #include <stdlib.h>
18 #include <errno.h>
19 #include <limits.h>
20+#include <stdint.h>
21+#include <getopt.h>
22+#include <arch/options.h>
23+#include <asm/page.h>
24 #include "../../kexec.h"
25
26+#define COMMAND_LINE_SIZE 1024
27+#define BOOT_PARAMS_SIZE 1536
28+
29+struct tag_header {
30+ uint32_t size;
31+ uint32_t tag;
32+};
33+
34+/* The list must start with an ATAG_CORE node */
35+#define ATAG_CORE 0x54410001
36+
37+struct tag_core {
38+ uint32_t flags; /* bit 0 = read-only */
39+ uint32_t pagesize;
40+ uint32_t rootdev;
41+};
42+
43+/* it is allowed to have multiple ATAG_MEM nodes */
44+#define ATAG_MEM 0x54410002
45+
46+struct tag_mem32 {
47+ uint32_t size;
48+ uint32_t start; /* physical start address */
49+};
50+
51+/* describes where the compressed ramdisk image lives (virtual address) */
52+/*
53+ * this one accidentally used virtual addresses - as such,
54+ * it's deprecated.
55+ */
56+#define ATAG_INITRD 0x54410005
57+
58+/* describes where the compressed ramdisk image lives (physical address) */
59+#define ATAG_INITRD2 0x54420005
60+
61+struct tag_initrd {
62+ uint32_t start; /* physical start address */
63+ uint32_t size; /* size of compressed ramdisk image in bytes */
64+};
65+
66+/* command line: \0 terminated string */
67+#define ATAG_CMDLINE 0x54410009
68+
69+struct tag_cmdline {
70+ char cmdline[1]; /* this is the minimum size */
71+};
72+
73+/* The list ends with an ATAG_NONE node. */
74+#define ATAG_NONE 0x00000000
75+
76+struct tag {
77+ struct tag_header hdr;
78+ union {
79+ struct tag_core core;
80+ struct tag_mem32 mem;
81+ struct tag_initrd initrd;
82+ struct tag_cmdline cmdline;
83+ } u;
84+};
85+
86+#define tag_next(t) ((struct tag *)((uint32_t *)(t) + (t)->hdr.size))
87+#define byte_size(t) ((t)->hdr.size << 2)
88+#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type) + 3) >> 2)
89+
90 int zImage_arm_probe(const char *buf, off_t len)
91 {
92 /*
93@@ -14,21 +86,194 @@ int zImage_arm_probe(const char *buf, of
94 */
95 return 0;
96 }
97+
98 void zImage_arm_usage(void)
99 {
100+ printf( " --command-line=STRING Set the kernel command line to STRING.\n"
101+ " --append=STRING Set the kernel command line to STRING.\n"
102+ " --initrd=FILE Use FILE as the kernel's initial ramdisk.\n"
103+ " --ramdisk=FILE Use FILE as the kernel's initial ramdisk.\n"
104+ );
105 }
106-int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
107+
108+static
109+struct tag * atag_read_tags(void)
110+{
111+ static unsigned long buf[BOOT_PARAMS_SIZE];
112+ const char fn[]= "/proc/atags";
113+ FILE *fp;
114+ fp = fopen(fn, "r");
115+ if (!fp) {
116+ fprintf(stderr, "Cannot open %s: %s\n",
117+ fn, strerror(errno));
118+ return NULL;
119+ }
120+
121+ fread(buf, sizeof(buf[1]), BOOT_PARAMS_SIZE, fp);
122+ if (ferror(fp)) {
123+ fprintf(stderr, "Cannot read %s: %s\n",
124+ fn, strerror(errno));
125+ fclose(fp);
126+ return NULL;
127+ }
128+
129+ fclose(fp);
130+ return (struct tag *) buf;
131+}
132+
133+
134+static
135+int atag_arm_load(struct kexec_info *info, unsigned long base,
136+ const char *command_line, off_t command_line_len,
137+ const char *initrd, off_t initrd_len)
138+{
139+ struct tag *saved_tags = atag_read_tags();
140+ char *buf;
141+ off_t len;
142+ struct tag *params;
143+ uint32_t *initrd_start;
144+
145+ buf = xmalloc(getpagesize());
146+ if (!buf) {
147+ fprintf(stderr, "Compiling ATAGs: out of memory\n");
148+ return -1;
149+ }
150+
151+ memset(buf, 0xff, getpagesize());
152+ params = (struct tag *)buf;
153+
154+ if (saved_tags) {
155+ // Copy tags
156+ saved_tags = (struct tag *) saved_tags;
157+ while(byte_size(saved_tags)) {
158+ switch (saved_tags->hdr.tag) {
159+ case ATAG_INITRD:
160+ case ATAG_INITRD2:
161+ case ATAG_CMDLINE:
162+ case ATAG_NONE:
163+ // skip these tags
164+ break;
165+ default:
166+ // copy all other tags
167+ memcpy(params, saved_tags, byte_size(saved_tags));
168+ params = tag_next(params);
169+ }
170+ saved_tags = tag_next(saved_tags);
171+ }
172+ } else {
173+ params->hdr.size = 2;
174+ params->hdr.tag = ATAG_CORE;
175+ params = tag_next(params);
176+ }
177+
178+ if (initrd) {
179+ params->hdr.size = tag_size(tag_initrd);
180+ params->hdr.tag = ATAG_INITRD2;
181+ initrd_start = &params->u.initrd.start;
182+ params->u.initrd.size = initrd_len;
183+ params = tag_next(params);
184+ }
185+
186+ if (command_line) {
187+ params->hdr.size = (sizeof(struct tag_header) + command_line_len + 3) >> 2;
188+ params->hdr.tag = ATAG_CMDLINE;
189+ memcpy(params->u.cmdline.cmdline, command_line,
190+ command_line_len);
191+ params->u.cmdline.cmdline[command_line_len - 1] = '\0';
192+ params = tag_next(params);
193+ }
194+
195+ params->hdr.size = 0;
196+ params->hdr.tag = ATAG_NONE;
197+
198+ len = ((char *)params - buf) + sizeof(struct tag_header);
199+
200+ add_segment(info, buf, len, base, len);
201+
202+ if (initrd) {
203+ struct memory_range *range;
204+ int ranges;
205+ get_memory_ranges(&range, &ranges);
206+ *initrd_start = locate_hole(info, initrd_len, getpagesize(), range[0].start + 0x800000, ULONG_MAX, INT_MAX);
207+ if (*initrd_start == ULONG_MAX)
208+ return -1;
209+ add_segment(info, initrd, initrd_len, *initrd_start, initrd_len);
210+ }
211+
212+ return 0;
213+}
214+
215+int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
216 struct kexec_info *info)
217 {
218 unsigned long base;
219- unsigned int offset = 0x8000; /* 32k offset from memory start */
220+ unsigned int atag_offset = 0x1000; /* 4k offset from memory start */
221+ unsigned int offset = 0x8000; /* 32k offset from memory start */
222+ const char *command_line;
223+ off_t command_line_len;
224+ const char *ramdisk;
225+ char *ramdisk_buf;
226+ off_t ramdisk_length;
227+ int opt;
228+#define OPT_APPEND 'a'
229+#define OPT_RAMDISK 'r'
230+ static const struct option options[] = {
231+ KEXEC_ARCH_OPTIONS
232+ { "command-line", 1, 0, OPT_APPEND },
233+ { "append", 1, 0, OPT_APPEND },
234+ { "initrd", 1, 0, OPT_RAMDISK },
235+ { "ramdisk", 1, 0, OPT_RAMDISK },
236+ { 0, 0, 0, 0 },
237+ };
238+ static const char short_options[] = KEXEC_ARCH_OPT_STR "a:r:";
239+
240+ /*
241+ * Parse the command line arguments
242+ */
243+ command_line = 0;
244+ command_line_len = 0;
245+ ramdisk = 0;
246+ ramdisk_buf = 0;
247+ ramdisk_length = 0;
248+ while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
249+ switch(opt) {
250+ default:
251+ /* Ignore core options */
252+ if (opt < OPT_ARCH_MAX) {
253+ break;
254+ }
255+ case '?':
256+ usage();
257+ return -1;
258+ case OPT_APPEND:
259+ command_line = optarg;
260+ break;
261+ case OPT_RAMDISK:
262+ ramdisk = optarg;
263+ break;
264+ }
265+ }
266+ if (command_line) {
267+ command_line_len = strlen(command_line) + 1;
268+ if (command_line_len > COMMAND_LINE_SIZE)
269+ command_line_len = COMMAND_LINE_SIZE;
270+ }
271+ if (ramdisk) {
272+ ramdisk_buf = slurp_file(ramdisk, &ramdisk_length);
273+ }
274+
275 base = locate_hole(info,len+offset,0,0,ULONG_MAX,INT_MAX);
276 if (base == ULONG_MAX)
277- {
278 return -1;
279- }
280- base += offset;
281- add_segment(info,buf,len,base,len);
282- info->entry = (void*)base;
283+
284+ if (atag_arm_load(info, base + atag_offset,
285+ command_line, command_line_len,
286+ ramdisk_buf, ramdisk_length) == -1)
287+ return -1;
288+
289+ add_segment(info, buf, len, base + offset, len);
290+
291+ info->entry = (void*)base + offset;
292+
293 return 0;
294 }
diff --git a/meta/packages/kexec/kexec-tools-1.101/kexec-tools-arm.patch b/meta/packages/kexec/kexec-tools-1.101/kexec-tools-arm.patch
deleted file mode 100644
index 6e43b76096..0000000000
--- a/meta/packages/kexec/kexec-tools-1.101/kexec-tools-arm.patch
+++ /dev/null
@@ -1,417 +0,0 @@
1Index: kexec-tools-1.101/kexec/arch/arm/include/arch/options.h
2===================================================================
3--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4+++ kexec-tools-1.101/kexec/arch/arm/include/arch/options.h 2006-02-06 18:28:37.027097280 +0100
5@@ -0,0 +1,11 @@
6+#ifndef KEXEC_ARCH_ARM_OPTIONS_H
7+#define KEXEC_ARCH_ARM_OPTIONS_H
8+
9+#define OPT_ARCH_MAX (OPT_MAX+0)
10+
11+#define KEXEC_ARCH_OPTIONS \
12+ KEXEC_OPTIONS \
13+
14+#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
15+
16+#endif /* KEXEC_ARCH_ARM_OPTIONS_H */
17Index: kexec-tools-1.101/kexec/arch/arm/kexec-arm.c
18===================================================================
19--- /dev/null 1970-01-01 00:00:00.000000000 +0000
20+++ kexec-tools-1.101/kexec/arch/arm/kexec-arm.c 2006-02-06 18:28:37.027097280 +0100
21@@ -0,0 +1,138 @@
22+/*
23+ * kexec: Linux boots Linux
24+ *
25+ * modified from kexec-ppc.c
26+ *
27+ */
28+
29+#define _GNU_SOURCE
30+#include <stddef.h>
31+#include <stdio.h>
32+#include <errno.h>
33+#include <stdint.h>
34+#include <string.h>
35+#include <getopt.h>
36+#include <sys/utsname.h>
37+#include "../../kexec.h"
38+#include "../../kexec-syscall.h"
39+#include "kexec-arm.h"
40+#include <arch/options.h>
41+
42+#define MAX_MEMORY_RANGES 64
43+#define MAX_LINE 160
44+static struct memory_range memory_range[MAX_MEMORY_RANGES];
45+
46+/* Return a sorted list of available memory ranges. */
47+int get_memory_ranges(struct memory_range **range, int *ranges)
48+{
49+ const char iomem[]= "/proc/iomem";
50+ int memory_ranges = 0;
51+ char line[MAX_LINE];
52+ FILE *fp;
53+ fp = fopen(iomem, "r");
54+ if (!fp) {
55+ fprintf(stderr, "Cannot open %s: %s\n",
56+ iomem, strerror(errno));
57+ return -1;
58+ }
59+
60+ while(fgets(line, sizeof(line), fp) != 0) {
61+ unsigned long long start, end;
62+ char *str;
63+ int type;
64+ int consumed;
65+ int count;
66+ if (memory_ranges >= MAX_MEMORY_RANGES)
67+ break;
68+ count = sscanf(line, "%Lx-%Lx : %n",
69+ &start, &end, &consumed);
70+ if (count != 2)
71+ continue;
72+ str = line + consumed;
73+ end = end + 1;
74+
75+ if (memcmp(str, "System RAM\n", 11) == 0) {
76+ type = RANGE_RAM;
77+ }
78+ else if (memcmp(str, "reserved\n", 9) == 0) {
79+ type = RANGE_RESERVED;
80+ }
81+ else {
82+ continue;
83+ }
84+
85+ memory_range[memory_ranges].start = start;
86+ memory_range[memory_ranges].end = end;
87+ memory_range[memory_ranges].type = type;
88+ memory_ranges++;
89+ }
90+ fclose(fp);
91+ *range = memory_range;
92+ *ranges = memory_ranges;
93+ return 0;
94+}
95+
96+/* Supported file types and callbacks */
97+struct file_type file_type[] = {
98+ {"zImage", zImage_arm_probe, zImage_arm_load, zImage_arm_usage},
99+};
100+int file_types = sizeof(file_type) / sizeof(file_type[0]);
101+
102+
103+void arch_usage(void)
104+{
105+}
106+
107+static struct {
108+} arch_options = {
109+};
110+int arch_process_options(int argc, char **argv)
111+{
112+ static const struct option options[] = {
113+ KEXEC_ARCH_OPTIONS
114+ { 0, 0, NULL, 0 },
115+ };
116+ static const char short_options[] = KEXEC_ARCH_OPT_STR;
117+ int opt;
118+ unsigned long value;
119+ char *end;
120+
121+ opterr = 0; /* Don't complain about unrecognized options here */
122+ while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
123+ switch(opt) {
124+ default:
125+ break;
126+ }
127+ }
128+ /* Reset getopt for the next pass; called in other source modules */
129+ opterr = 1;
130+ optind = 1;
131+ return 0;
132+}
133+
134+int arch_compat_trampoline(struct kexec_info *info, unsigned long *flags)
135+{
136+ int result;
137+ struct utsname utsname;
138+ result = uname(&utsname);
139+ if (result < 0) {
140+ fprintf(stderr, "uname failed: %s\n",
141+ strerror(errno));
142+ return -1;
143+ }
144+ if (strncmp(utsname.machine, "arm",3) == 0)
145+ {
146+ *flags |= KEXEC_ARCH_ARM;
147+ }
148+ else {
149+ fprintf(stderr, "Unsupported machine type: %s\n",
150+ utsname.machine);
151+ return -1;
152+ }
153+ return 0;
154+}
155+
156+void arch_update_purgatory(struct kexec_info *info)
157+{
158+}
159+
160Index: kexec-tools-1.101/kexec/arch/arm/kexec-arm.h
161===================================================================
162--- /dev/null 1970-01-01 00:00:00.000000000 +0000
163+++ kexec-tools-1.101/kexec/arch/arm/kexec-arm.h 2006-02-06 18:28:37.028097128 +0100
164@@ -0,0 +1,9 @@
165+#ifndef KEXEC_ARM_H
166+#define KEXEC_ARM_H
167+
168+int zImage_arm_probe(const char *buf, off_t len);
169+int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
170+ struct kexec_info *info);
171+void zImage_arm_usage(void);
172+
173+#endif /* KEXEC_ARM_H */
174Index: kexec-tools-1.101/kexec/arch/arm/kexec-elf-rel-arm.c
175===================================================================
176--- /dev/null 1970-01-01 00:00:00.000000000 +0000
177+++ kexec-tools-1.101/kexec/arch/arm/kexec-elf-rel-arm.c 2006-02-06 18:28:37.028097128 +0100
178@@ -0,0 +1,35 @@
179+#include <stdio.h>
180+#include <elf.h>
181+#include "../../kexec.h"
182+#include "../../kexec-elf.h"
183+
184+int machine_verify_elf_rel(struct mem_ehdr *ehdr)
185+{
186+ if (ehdr->ei_data != ELFDATA2MSB) {
187+ return 0;
188+ }
189+ if (ehdr->ei_class != ELFCLASS32) {
190+ return 0;
191+ }
192+ if (ehdr->e_machine != EM_ARM)
193+ {
194+ return 0;
195+ }
196+ return 1;
197+}
198+
199+void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
200+ void *location, unsigned long address, unsigned long value)
201+{
202+ switch(r_type) {
203+ case R_ARM_ABS32:
204+ *((uint32_t *)location) += value;
205+ break;
206+ case R_ARM_REL32:
207+ *((uint32_t *)location) += value - address;
208+ break;
209+ default:
210+ die("Unknown rel relocation: %lu\n", r_type);
211+ break;
212+ }
213+}
214Index: kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c
215===================================================================
216--- /dev/null 1970-01-01 00:00:00.000000000 +0000
217+++ kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c 2006-02-06 18:28:37.028097128 +0100
218@@ -0,0 +1,34 @@
219+#define _GNU_SOURCE
220+#include <stdio.h>
221+#include <string.h>
222+#include <stdlib.h>
223+#include <errno.h>
224+#include <limits.h>
225+#include "../../kexec.h"
226+
227+int zImage_arm_probe(const char *buf, off_t len)
228+{
229+ /*
230+ * Only zImage loading is supported. Do not check if
231+ * the buffer is valid kernel image
232+ */
233+ return 0;
234+}
235+void zImage_arm_usage(void)
236+{
237+}
238+int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
239+ struct kexec_info *info)
240+{
241+ unsigned long base;
242+ unsigned int offset = 0x8000; /* 32k offset from memory start */
243+ base = locate_hole(info,len+offset,0,0,ULONG_MAX,INT_MAX);
244+ if (base == ULONG_MAX)
245+ {
246+ return -1;
247+ }
248+ base += offset;
249+ add_segment(info,buf,len,base,len);
250+ info->entry = (void*)base;
251+ return 0;
252+}
253Index: kexec-tools-1.101/kexec/arch/arm/Makefile
254===================================================================
255--- /dev/null 1970-01-01 00:00:00.000000000 +0000
256+++ kexec-tools-1.101/kexec/arch/arm/Makefile 2006-02-06 18:28:37.028097128 +0100
257@@ -0,0 +1,8 @@
258+#
259+# kexec arm (linux booting linux)
260+#
261+KEXEC_C_SRCS+= kexec/arch/arm/kexec-elf-rel-arm.c
262+KEXEC_C_SRCS+= kexec/arch/arm/kexec-zImage-arm.c
263+KEXEC_C_SRCS+= kexec/arch/arm/kexec-arm.c
264+
265+KEXEC_S_SRCS+=
266Index: kexec-tools-1.101/kexec/kexec.c
267===================================================================
268--- kexec-tools-1.101.orig/kexec/kexec.c 2005-01-13 14:24:29.000000000 +0100
269+++ kexec-tools-1.101/kexec/kexec.c 2006-02-06 18:28:37.029096976 +0100
270@@ -187,7 +187,7 @@
271 }
272
273 /* Compute the free memory ranges */
274- max_mem_ranges = memory_ranges + (info->nr_segments -1);
275+ max_mem_ranges = memory_ranges + (info->nr_segments);
276 mem_range = malloc(max_mem_ranges *sizeof(struct memory_range));
277 mem_ranges = 0;
278
279Index: kexec-tools-1.101/kexec/kexec-syscall.h
280===================================================================
281--- kexec-tools-1.101.orig/kexec/kexec-syscall.h 2005-01-06 07:59:50.000000000 +0100
282+++ kexec-tools-1.101/kexec/kexec-syscall.h 2006-02-06 18:28:37.029096976 +0100
283@@ -37,6 +37,9 @@
284 #ifdef __x86_64__
285 #define __NR_kexec_load 246
286 #endif
287+#ifdef __arm__
288+#define __NR_kexec_load __NR_SYSCALL_BASE + 347
289+#endif
290 #ifndef __NR_kexec_load
291 #error Unknown processor architecture. Needs a kexec_load syscall number.
292 #endif
293@@ -67,6 +70,7 @@
294 #define KEXEC_ARCH_PPC (20 << 16)
295 #define KEXEC_ARCH_PPC64 (21 << 16)
296 #define KEXEC_ARCH_IA_64 (50 << 16)
297+#define KEXEC_ARCH_ARM (40 << 16)
298
299 #define KEXEC_MAX_SEGMENTS 8
300
301Index: kexec-tools-1.101/purgatory/arch/arm/include/limits.h
302===================================================================
303--- /dev/null 1970-01-01 00:00:00.000000000 +0000
304+++ kexec-tools-1.101/purgatory/arch/arm/include/limits.h 2006-02-06 18:28:37.031096672 +0100
305@@ -0,0 +1,58 @@
306+#ifndef LIMITS_H
307+#define LIMITS_H 1
308+
309+
310+/* Number of bits in a `char' */
311+#define CHAR_BIT 8
312+
313+/* Minimum and maximum values a `signed char' can hold */
314+#define SCHAR_MIN (-128)
315+#define SCHAR_MAX 127
316+
317+/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
318+#define UCHAR_MAX 255
319+
320+/* Minimum and maximum values a `char' can hold */
321+#define CHAR_MIN SCHAR_MIN
322+#define CHAR_MAX SCHAR_MAX
323+
324+/* Minimum and maximum values a `signed short int' can hold */
325+#define SHRT_MIN (-32768)
326+#define SHRT_MAX 32767
327+
328+/* Maximum value an `unsigned short' can hold. (Minimum is 0.) */
329+#define USHRT_MAX 65535
330+
331+
332+/* Minimum and maximum values a `signed int' can hold */
333+#define INT_MIN (-INT_MAX - 1)
334+#define INT_MAX 2147483647
335+
336+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
337+#define UINT_MAX 4294967295U
338+
339+
340+/* Minimum and maximum values a `signed int' can hold */
341+#define INT_MIN (-INT_MAX - 1)
342+#define INT_MAX 2147483647
343+
344+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
345+#define UINT_MAX 4294967295U
346+
347+/* Minimum and maximum values a `signed long' can hold */
348+#define LONG_MAX 2147483647L
349+#define LONG_MIN (-LONG_MAX - 1L)
350+
351+/* Maximum value an `unsigned long' can hold. (Minimum is 0.) */
352+#define ULONG_MAX 4294967295UL
353+
354+/* Minimum and maximum values a `signed long long' can hold */
355+#define LLONG_MAX 9223372036854775807LL
356+#define LLONG_MIN (-LONG_MAX - 1LL)
357+
358+
359+/* Maximum value an `unsigned long long' can hold. (Minimum is 0.) */
360+#define ULLONG_MAX 18446744073709551615ULL
361+
362+
363+#endif /* LIMITS_H */
364Index: kexec-tools-1.101/purgatory/arch/arm/include/stdint.h
365===================================================================
366--- /dev/null 1970-01-01 00:00:00.000000000 +0000
367+++ kexec-tools-1.101/purgatory/arch/arm/include/stdint.h 2006-02-06 18:28:37.031096672 +0100
368@@ -0,0 +1,16 @@
369+#ifndef STDINT_H
370+#define STDINT_H
371+
372+typedef unsigned long size_t;
373+
374+typedef unsigned char uint8_t;
375+typedef unsigned short uint16_t;
376+typedef unsigned int uint32_t;
377+typedef unsigned long long uint64_t;
378+
379+typedef signed char int8_t;
380+typedef signed short int16_t;
381+typedef signed int int32_t;
382+typedef signed long long int64_t;
383+
384+#endif /* STDINT_H */
385Index: kexec-tools-1.101/purgatory/arch/arm/Makefile
386===================================================================
387--- /dev/null 1970-01-01 00:00:00.000000000 +0000
388+++ kexec-tools-1.101/purgatory/arch/arm/Makefile 2006-02-06 18:28:37.031096672 +0100
389@@ -0,0 +1,7 @@
390+#
391+# Purgatory arm
392+#
393+
394+PURGATORY_S_SRCS +=
395+PURGATORY_C_SRCS +=
396+
397Index: kexec-tools-1.101/configure.ac
398===================================================================
399--- kexec-tools-1.101.orig/configure.ac 2005-01-09 02:36:57.000000000 +0100
400+++ kexec-tools-1.101/configure.ac 2006-02-06 18:30:19.274553304 +0100
401@@ -25,12 +25,15 @@
402 powerpc )
403 host_cpu="ppc"
404 ;;
405+ arm* )
406+ host_cpu="arm"
407+ ;;
408 * )
409 host_cpu="$host_cpu"
410 ;;
411 esac
412 case $host_cpu in
413- i386|ppc|x86_64|alpha|ppc64|ia64)
414+ i386|ppc|x86_64|alpha|ppc64|ia64|arm)
415 ;;
416 * )
417 AC_MSG_ERROR([ unsupported architecture $host_cpu])
diff --git a/meta/packages/kexec/kexec-tools-1.101/recentheader.patch b/meta/packages/kexec/kexec-tools-1.101/recentheader.patch
deleted file mode 100644
index b0a1a049eb..0000000000
--- a/meta/packages/kexec/kexec-tools-1.101/recentheader.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1Index: kexec-tools-1.101/kexec/arch/i386/kexec-multiboot-x86.c
2===================================================================
3--- kexec-tools-1.101.orig/kexec/arch/i386/kexec-multiboot-x86.c 2009-06-12 12:09:04.000000000 +0100
4+++ kexec-tools-1.101/kexec/arch/i386/kexec-multiboot-x86.c 2009-06-12 12:09:44.000000000 +0100
5@@ -47,7 +47,6 @@
6 #include <getopt.h>
7 #include <elf.h>
8 #include <boot/elf_boot.h>
9-#include <asm/page.h>
10 #include <ip_checksum.h>
11 #include "../../kexec.h"
12 #include "../../kexec-elf.h"
13@@ -341,7 +340,7 @@
14 /* Pick the next aligned spot to load it in */
15 freespace = add_buffer(info,
16 buf, mod_size, mod_size,
17- PAGE_SIZE, 0, 0xffffffffUL, 1);
18+ getpagesize(), 0, 0xffffffffUL, 1);
19
20 /* Add the module command line */
21 sprintf(mod_clp, "%s", mod_command_line);
22Index: kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c
23===================================================================
24--- kexec-tools-1.101.orig/kexec/arch/arm/kexec-zImage-arm.c 2009-07-07 13:24:17.000000000 +0100
25+++ kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c 2009-07-07 13:24:56.000000000 +0100
26@@ -11,7 +11,7 @@
27 #include <stdint.h>
28 #include <getopt.h>
29 #include <arch/options.h>
30-#include <asm/page.h>
31+#include <unistd.h>
32 #include "../../kexec.h"
33
34 #define COMMAND_LINE_SIZE 1024
diff --git a/meta/packages/kexec/kexec-tools-1.101/configurefix.patch b/meta/packages/kexec/kexec-tools-2.0.1/configurefix.patch
index 60c55f08e9..1f0b507731 100644
--- a/meta/packages/kexec/kexec-tools-1.101/configurefix.patch
+++ b/meta/packages/kexec/kexec-tools-2.0.1/configurefix.patch
@@ -1,3 +1,9 @@
1kexec-tools: Fix synatx error with recent autoconf+automake
2
3Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
4
5Move it to kexec-tools-2.0.1 directory. Dongxiao Xu <dongxiao.xu@intel.com>
6
1Index: kexec-tools-1.101/configure.ac 7Index: kexec-tools-1.101/configure.ac
2=================================================================== 8===================================================================
3--- kexec-tools-1.101.orig/configure.ac 2010-02-02 15:14:43.173906722 +0000 9--- kexec-tools-1.101.orig/configure.ac 2010-02-02 15:14:43.173906722 +0000
diff --git a/meta/packages/kexec/kexec-tools.inc b/meta/packages/kexec/kexec-tools.inc
index 8b8c70af67..1b28618414 100644
--- a/meta/packages/kexec/kexec-tools.inc
+++ b/meta/packages/kexec/kexec-tools.inc
@@ -1,16 +1,15 @@
1DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" 1DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
2AUTHOR = "Eric Biederman" 2AUTHOR = "Eric Biederman"
3HOMEPAGE = "http://www.xmission.com/~ebiederm/files/kexec/" 3HOMEPAGE = "http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/"
4SECTION = "kernel/userland" 4SECTION = "kernel/userland"
5LICENSE = "GPL" 5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
7 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
6DEPENDS = "virtual/kernel zlib" 8DEPENDS = "virtual/kernel zlib"
7 9
10SRC_URI = "http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools//kexec-tools-${PV}.tar.gz \
11 file://configurefix.patch;patch=1"
12
8inherit autotools 13inherit autotools
9 14
10COMPATIBLE_HOST = '(x86_64|i.86.*|arm.*)-(linux|freebsd.*)' 15COMPATIBLE_HOST = '(x86_64|i.86.*|arm.*)-(linux|freebsd.*)'
11
12SRC_URI = "http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-${PV}.tar.gz \
13 file://kexec-tools-arm.patch;patch=1 \
14 file://kexec-arm-atags.patch;patch=1 \
15 file://recentheader.patch;patch=1 \
16 file://configurefix.patch;patch=1"
diff --git a/meta/packages/kexec/kexec-tools_1.101.bb b/meta/packages/kexec/kexec-tools_2.0.1.bb
index 949f22cf1f..758d3ec9fd 100644
--- a/meta/packages/kexec/kexec-tools_1.101.bb
+++ b/meta/packages/kexec/kexec-tools_2.0.1.bb
@@ -2,4 +2,4 @@ require kexec-tools.inc
2export LDFLAGS = "-L${STAGING_LIBDIR}" 2export LDFLAGS = "-L${STAGING_LIBDIR}"
3EXTRA_OECONF = " --with-zlib=yes" 3EXTRA_OECONF = " --with-zlib=yes"
4 4
5PR = "r8" 5PR = "r0"