1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
From 30aff2983e14dc6482dd2cd6c9a3b96db65c689e Mon Sep 17 00:00:00 2001
From: Matei Valeanu <Matei.Valeanu@enea.com>
Date: Wed, 20 Jun 2018 09:41:46 +0200
Subject: [PATCH] printk: Add Enea Linux guest boot start/end messages
rebased for 4.14
Upstream-status: Inappropriate [specific measurement]
Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
Signed-off-by: Matei Valeanu <Matei.Valeanu@enea.com>
---
arch/x86/boot/compressed/misc.c | 23 ++++++++++++-----------
init/main.c | 4 +++-
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 252fee3..ecff964 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -212,10 +212,10 @@ static void handle_relocations(void *output, unsigned long output_len,
delta = virt_addr - LOAD_PHYSICAL_ADDR;
if (!delta) {
- debug_putstr("No relocation needed... ");
+ /* debug_putstr("No relocation needed... "); */
return;
}
- debug_putstr("Performing relocations... ");
+ /* debug_putstr("Performing relocations... "); */
/*
* Process relocations: 32 bit relocations first then 64 bit after.
@@ -296,7 +296,7 @@ static void parse_elf(void *output)
return;
}
- debug_putstr("Parsing ELF... ");
+ /* debug_putstr("Parsing ELF... ");*/
phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
if (!phdrs)
@@ -374,7 +374,8 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
cols = boot_params->screen_info.orig_video_cols;
console_init();
- debug_putstr("early console in extract_kernel\n");
+ /* debug_putstr("early console in extract_kernel\n");*/
+ debug_putstr("\n");debug_putstr("Enea Linux guest kernel boot start\n");
if (IS_ENABLED(CONFIG_X86_5LEVEL) && !l5_supported()) {
error("This linux kernel as configured requires 5-level paging\n"
@@ -386,11 +387,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
/* Report initial kernel position details. */
- debug_putaddr(input_data);
- debug_putaddr(input_len);
- debug_putaddr(output);
- debug_putaddr(output_len);
- debug_putaddr(kernel_total_size);
+ /*debug_putaddr(input_data); */
+ /*debug_putaddr(input_len); */
+ /*debug_putaddr(output); */
+ /*debug_putaddr(output_len); */
+ /*debug_putaddr(kernel_total_size);*/
/*
* The memory hole needed for the kernel is the larger of either
@@ -423,12 +424,12 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
error("Destination virtual address changed when not relocatable");
#endif
- debug_putstr("\nDecompressing Linux... ");
+ /*debug_putstr("\nDecompressing Linux... ");*/
__decompress(input_data, input_len, NULL, NULL, output, output_len,
NULL, error);
parse_elf(output);
handle_relocations(output, output_len, virt_addr);
- debug_putstr("done.\nBooting the kernel.\n");
+ /*debug_putstr("done.\nBooting the kernel.\n");*/
return output;
}
diff --git a/init/main.c b/init/main.c
index 56210eb..9e61f9d 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1025,8 +1025,10 @@ static int __ref kernel_init(void *unused)
if (!try_to_run_init_process("/sbin/init") ||
!try_to_run_init_process("/etc/init") ||
!try_to_run_init_process("/bin/init") ||
- !try_to_run_init_process("/bin/sh"))
+ !try_to_run_init_process("/bin/sh")) {
+ printk(KERN_EMERG "Enea Linux guest kernel boot end\n");
return 0;
+ }
panic("No working init found. Try passing init= option to kernel. "
"See Linux Documentation/admin-guide/init.rst for guidance.");
--
2.7.4
|