Skip to contentSkip to conversation

kexec/ppc: Check for a uImage initrd with ELF kernel

PATCH Applied Athira Rajeev 3 participants 4 messages Sep 25, 2013

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to Athira Rajeev
Quoted 7 lines · Athira Rajeev

From: Suzuki K. Poulose <[email protected]>

We should check if the initrd is in uImage format, when the kernel might be in ELF.

Simon,

Please pull this one as well. Lets a user choose any combination of Kernel/Initrd.

Suzuki

Quoted 25 lines

---

 kexec/arch/ppc/kexec-elf-ppc.c |    2 +-
 kexec/arch/ppc/kexec-ppc.h     |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
kexec/arch/ppc/kexec-elf-ppc.c +1 -1
index 98cae9c..df1b521 100644
@@ -371,7 +371,7 @@ int elf_ppc_load(int argc, char **argv,	const char *buf, off_t len,
 	blob_buf = fixup_dtb_init(info, blob_buf, &blob_size, kernel_addr, &dtb_addr);
 
 	if (ramdisk) {
-		seg_buf = slurp_file(ramdisk, &seg_size);
+		seg_buf = slurp_ramdisk_ppc(ramdisk, &seg_size);
 		/* load the ramdisk *above* the device tree */
 		hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
 				0, dtb_addr + blob_size + 1,  max_addr, -1);
kexec/arch/ppc/kexec-ppc.h +0 -0
index 68728c6..904cf48 100644

kexec/arch/ppc/kexec-ppc.h extern int read_memory_region_limits(int fd, unsigned long long *start, · line 84

Quoted 7 lines
kexec/arch/ppc/kexec-ppc.h +3 -0
@@ -78,4 +78,7 @@ extern int read_memory_region_limits(int fd, unsigned long long *start,
 #define COMMAND_LINE_SIZE	512 /* from kernel */
 /*fs2dt*/
 void reserve(unsigned long long where, unsigned long long length);
+
+/* Defined kexec-uImage-ppc.c */
+extern char* slurp_ramdisk_ppc(const char *filename, off_t *r_size);
 #endif /* KEXEC_PPC_H */

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 6 lines · Suzuki K. Poulose
Quoted 5 lines · Athira Rajeev

From: Suzuki K. Poulose <[email protected]>

We should check if the initrd is in uImage format, when the kernel might be in ELF.

Quoted 7 lines
Quoted 2 lines

Simon,

Please pull this one as well. Lets a user choose any combination of Kernel/Initrd.

Hi,

For some reason I don't seem to have the original post of the patch in my inbox. Could either you or Athira send it to me with [email protected] CCed (again?).

Quoted 27 lines

Suzuki

Quoted 24 lines

---

 kexec/arch/ppc/kexec-elf-ppc.c |    2 +-
 kexec/arch/ppc/kexec-ppc.h     |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
kexec/arch/ppc/kexec-elf-ppc.c +1 -1
index 98cae9c..df1b521 100644
@@ -371,7 +371,7 @@ int elf_ppc_load(int argc, char **argv,	const char *buf, off_t len,
 	blob_buf = fixup_dtb_init(info, blob_buf, &blob_size, kernel_addr, &dtb_addr);
 
 	if (ramdisk) {
-		seg_buf = slurp_file(ramdisk, &seg_size);
+		seg_buf = slurp_ramdisk_ppc(ramdisk, &seg_size);
 		/* load the ramdisk *above* the device tree */
 		hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
 				0, dtb_addr + blob_size + 1,  max_addr, -1);
kexec/arch/ppc/kexec-ppc.h +0 -0
index 68728c6..904cf48 100644
@@ -78,4 +78,7 @@ extern int read_memory_region_limits(int fd, unsigned long long *start,
Quoted 9 lines

kexec/arch/ppc/kexec-ppc.h extern int read_memory_region_limits(int fd, unsigned long long *start, · line 84

Quoted 8 lines
kexec/arch/ppc/kexec-ppc.h +3 -0
 #define COMMAND_LINE_SIZE	512 /* from kernel */
 /*fs2dt*/
 void reserve(unsigned long long where, unsigned long long length);
+
+/* Defined kexec-uImage-ppc.c */
+extern char* slurp_ramdisk_ppc(const char *filename, off_t *r_size);
 #endif /* KEXEC_PPC_H */

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#0 lore raw

PATCH 1/1 kexec/ppc: Check for a uImage initrd with ELF kernel

From: Suzuki K. Poulose <[email protected]>

We should check if the initrd is in uImage format, when the kernel might be in ELF.

---

 kexec/arch/ppc/kexec-elf-ppc.c |    2 +-
 kexec/arch/ppc/kexec-ppc.h     |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
kexec/arch/ppc/kexec-elf-ppc.c +1 -1
index 98cae9c..df1b521 100644
@@ -371,7 +371,7 @@ int elf_ppc_load(int argc, char **argv,	const char *buf, off_t len,
 	blob_buf = fixup_dtb_init(info, blob_buf, &blob_size, kernel_addr, &dtb_addr);
 
 	if (ramdisk) {
-		seg_buf = slurp_file(ramdisk, &seg_size);
+		seg_buf = slurp_ramdisk_ppc(ramdisk, &seg_size);
 		/* load the ramdisk *above* the device tree */
 		hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
 				0, dtb_addr + blob_size + 1,  max_addr, -1);
kexec/arch/ppc/kexec-ppc.h +3 -0
index 68728c6..904cf48 100644
@@ -78,4 +78,7 @@ extern int read_memory_region_limits(int fd, unsigned long long *start,
 #define COMMAND_LINE_SIZE	512 /* from kernel */
 /*fs2dt*/
 void reserve(unsigned long long where, unsigned long long length);
+
+/* Defined kexec-uImage-ppc.c */
+extern char* slurp_ramdisk_ppc(const char *filename, off_t *r_size);
 #endif /* KEXEC_PPC_H */

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Applied
#3 lore raw
Quoted 7 lines · Athira Rajeev

From: Suzuki K. Poulose <[email protected]>

We should check if the initrd is in uImage format, when the kernel might be in ELF.

Thanks, applied.

Quoted 33 lines

---

 kexec/arch/ppc/kexec-elf-ppc.c |    2 +-
 kexec/arch/ppc/kexec-ppc.h     |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
kexec/arch/ppc/kexec-elf-ppc.c +1 -1
index 98cae9c..df1b521 100644
@@ -371,7 +371,7 @@ int elf_ppc_load(int argc, char **argv,	const char *buf, off_t len,
 	blob_buf = fixup_dtb_init(info, blob_buf, &blob_size, kernel_addr, &dtb_addr);
 
 	if (ramdisk) {
-		seg_buf = slurp_file(ramdisk, &seg_size);
+		seg_buf = slurp_ramdisk_ppc(ramdisk, &seg_size);
 		/* load the ramdisk *above* the device tree */
 		hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
 				0, dtb_addr + blob_size + 1,  max_addr, -1);
kexec/arch/ppc/kexec-ppc.h +3 -0
index 68728c6..904cf48 100644
@@ -78,4 +78,7 @@ extern int read_memory_region_limits(int fd, unsigned long long *start,
 #define COMMAND_LINE_SIZE	512 /* from kernel */
 /*fs2dt*/
 void reserve(unsigned long long where, unsigned long long length);
+
+/* Defined kexec-uImage-ppc.c */
+extern char* slurp_ramdisk_ppc(const char *filename, off_t *r_size);
 #endif /* KEXEC_PPC_H */
Quoted 5 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec