summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Ionescu <gabriel.ionescu@enea.com>2017-06-13 13:58:37 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2017-06-21 10:31:30 +0200
commitf42ac6c2248c3b1f49795abd2597856ceb1d8ce3 (patch)
tree0938e522a846573f5d47ef60c7475e83a1092d2e
parent15324fcc8bbcf283a31847c0f4c8b97debd4a1d7 (diff)
downloadenea-kernel-cache-f42ac6c2248c3b1f49795abd2597856ceb1d8ce3.tar.gz
Kernel: Add start-end messages for guest kernel
Signed-off-by: Gabriel Ionescu <gabriel.ionescu@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r--patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch95
-rw-r--r--patches/kernel_startend_msg/kernel_startend_msg.scc4
2 files changed, 99 insertions, 0 deletions
diff --git a/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch
new file mode 100644
index 0000000..ce5fb21
--- /dev/null
+++ b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch
@@ -0,0 +1,95 @@
1From b91730ba705d151577974d5fb9f5371a4569b467 Mon Sep 17 00:00:00 2001
2From: Adrian Calianu <adrian.calianu@enea.com>
3Date: Tue, 6 Jun 2017 15:47:54 +0200
4Subject: [PATCH 1/1] printk: add Enea Linux boot start/end messages
5
6Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
7---
8 arch/x86/boot/compressed/misc.c | 23 ++++++++++++-----------
9 init/main.c | 4 +++-
10 2 files changed, 15 insertions(+), 12 deletions(-)
11
12diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
13index b3c5a5f0..9fdf3c6 100644
14--- a/arch/x86/boot/compressed/misc.c
15+++ b/arch/x86/boot/compressed/misc.c
16@@ -202,10 +202,10 @@ static void handle_relocations(void *output, unsigned long output_len,
17 delta = virt_addr - LOAD_PHYSICAL_ADDR;
18
19 if (!delta) {
20- debug_putstr("No relocation needed... ");
21+ /* debug_putstr("No relocation needed... "); */
22 return;
23 }
24- debug_putstr("Performing relocations... ");
25+ /* debug_putstr("Performing relocations... "); */
26
27 /*
28 * Process relocations: 32 bit relocations first then 64 bit after.
29@@ -286,7 +286,7 @@ static void parse_elf(void *output)
30 return;
31 }
32
33- debug_putstr("Parsing ELF... ");
34+ /* debug_putstr("Parsing ELF... ");*/
35
36 phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
37 if (!phdrs)
38@@ -360,17 +360,18 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
39 cols = boot_params->screen_info.orig_video_cols;
40
41 console_init();
42- debug_putstr("early console in extract_kernel\n");
43+ /* debug_putstr("early console in extract_kernel\n");*/
44+ debug_putstr("\n");debug_putstr("\nEnea Linux guest kernel boot start\n");
45
46 free_mem_ptr = heap; /* Heap */
47 free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
48
49 /* Report initial kernel position details. */
50- debug_putaddr(input_data);
51- debug_putaddr(input_len);
52- debug_putaddr(output);
53- debug_putaddr(output_len);
54- debug_putaddr(kernel_total_size);
55+ /*debug_putaddr(input_data); */
56+ /*debug_putaddr(input_len); */
57+ /*debug_putaddr(output); */
58+ /*debug_putaddr(output_len); */
59+ /*debug_putaddr(kernel_total_size);*/
60
61 /*
62 * The memory hole needed for the kernel is the larger of either
63@@ -401,11 +402,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
64 error("Destination virtual address changed when not relocatable");
65 #endif
66
67- debug_putstr("\nDecompressing Linux... ");
68+ /*debug_putstr("\nDecompressing Linux... ");*/
69 __decompress(input_data, input_len, NULL, NULL, output, output_len,
70 NULL, error);
71 parse_elf(output);
72 handle_relocations(output, output_len, virt_addr);
73- debug_putstr("done.\nBooting the kernel.\n");
74+ /*debug_putstr("done.\nBooting the kernel.\n");*/
75 return output;
76 }
77diff --git a/init/main.c b/init/main.c
78index 8358cbe..613caa1 100644
79--- a/init/main.c
80+++ b/init/main.c
81@@ -976,8 +976,10 @@ static int __ref kernel_init(void *unused)
82 if (!try_to_run_init_process("/sbin/init") ||
83 !try_to_run_init_process("/etc/init") ||
84 !try_to_run_init_process("/bin/init") ||
85- !try_to_run_init_process("/bin/sh"))
86+ !try_to_run_init_process("/bin/sh")) {
87+ printk(KERN_EMERG "Enea Linux guest kernel boot end\n");
88 return 0;
89+ }
90
91 panic("No working init found. Try passing init= option to kernel. "
92 "See Linux Documentation/init.txt for guidance.");
93--
942.7.4
95
diff --git a/patches/kernel_startend_msg/kernel_startend_msg.scc b/patches/kernel_startend_msg/kernel_startend_msg.scc
new file mode 100644
index 0000000..ae49e89
--- /dev/null
+++ b/patches/kernel_startend_msg/kernel_startend_msg.scc
@@ -0,0 +1,4 @@
1define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting"
2define KFEATURE_COMPATIBILITY all
3
4patch 0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch