From f42ac6c2248c3b1f49795abd2597856ceb1d8ce3 Mon Sep 17 00:00:00 2001 From: Gabriel Ionescu Date: Tue, 13 Jun 2017 13:58:37 +0200 Subject: Kernel: Add start-end messages for guest kernel Signed-off-by: Gabriel Ionescu Signed-off-by: Adrian Dudau --- ...-Enea-Linux-guest-boot-start-end-messages.patch | 95 ++++++++++++++++++++++ .../kernel_startend_msg/kernel_startend_msg.scc | 4 + 2 files changed, 99 insertions(+) create mode 100644 patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch create mode 100644 patches/kernel_startend_msg/kernel_startend_msg.scc 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 @@ +From b91730ba705d151577974d5fb9f5371a4569b467 Mon Sep 17 00:00:00 2001 +From: Adrian Calianu +Date: Tue, 6 Jun 2017 15:47:54 +0200 +Subject: [PATCH 1/1] printk: add Enea Linux boot start/end messages + +Signed-off-by: Adrian Calianu +--- + 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 b3c5a5f0..9fdf3c6 100644 +--- a/arch/x86/boot/compressed/misc.c ++++ b/arch/x86/boot/compressed/misc.c +@@ -202,10 +202,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. +@@ -286,7 +286,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) +@@ -360,17 +360,18 @@ 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("\nEnea Linux guest kernel boot start\n"); + + free_mem_ptr = heap; /* 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 +@@ -401,11 +402,11 @@ 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 8358cbe..613caa1 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -976,8 +976,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/init.txt for guidance."); +-- +2.7.4 + 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 @@ +define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" +define KFEATURE_COMPATIBILITY all + +patch 0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch -- cgit v1.2.3-54-g00ecf