diff options
| author | Gabriel Ionescu <gabriel.ionescu@enea.com> | 2017-06-08 18:13:42 +0200 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2017-06-09 12:23:55 +0200 |
| commit | e07993bedd511575ccb0802cd14690111978b50a (patch) | |
| tree | 7d7a2af922d679d4d1aff422f97cbc088bbd0314 /patches | |
| parent | 20a2437ae70d46e830f0e343d2d6e4c5315dc2c8 (diff) | |
| download | enea-kernel-cache-e07993bedd511575ccb0802cd14690111978b50a.tar.gz | |
Kernel: Optimize boot time and add start/end messages
Signed-off-by: Gabriel Ionescu <gabriel.ionescu@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch | 95 | ||||
| -rw-r--r-- | patches/kernel_startend_msg/kernel_startend_msg.scc | 4 |
2 files changed, 99 insertions, 0 deletions
diff --git a/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch new file mode 100644 index 0000000..0fa8756 --- /dev/null +++ b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | From b91730ba705d151577974d5fb9f5371a4569b467 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Adrian Calianu <adrian.calianu@enea.com> | ||
| 3 | Date: Tue, 6 Jun 2017 15:47:54 +0200 | ||
| 4 | Subject: [PATCH 1/1] printk: add Enea Linux boot start/end messages | ||
| 5 | |||
| 6 | Signed-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 | |||
| 12 | diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c | ||
| 13 | index 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("Enea Linux 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 | } | ||
| 77 | diff --git a/init/main.c b/init/main.c | ||
| 78 | index 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 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 | -- | ||
| 94 | 2.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..e6da49c --- /dev/null +++ b/patches/kernel_startend_msg/kernel_startend_msg.scc | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" | ||
| 2 | define KFEATURE_COMPATIBILITY all | ||
| 3 | |||
| 4 | patch 0001-printk-add-Enea-Linux-boot-start-end-messages.patch | ||
