Reland "build_kernel_image: Use syslog format for serial consoles"

This is a reland of commit b867e091af8c6647ec48ecc5628618002d8951b1

Original change's description:
> build_kernel_image: Use syslog format for serial consoles
>
> RAM OOPS pstore is registered as a serial console, for which
> we don't prepend messages with log-level/facility by default
> (MSG_FORMAT_DEFAULT).  This makes crash reports inconsistent
> because sometimes we have <level> prefix and sometimes we
> don't.
>
> Switch to MSG_FORMAT_SYSLOG so that pstore messages will always
> have log-level/facility prefix.
>
> Example (after panic)
> =====================
>
> - base
>
> cat /sys/fs/pstore/console-ramoops-0
> [..]
> [   24.907552] input: kblda7219max HDMI/DP, pcm=5 Jack as /devices/platform/kbl_da7219_mx98357a/sound/card0/input10
> [   24.912106] input: kblda7219max HDMI/DP, pcm=6 Jack as /devices/platform/kbl_da7219_mx98357a/sound/card0/input11
> [   25.677432] init: send-boot-elog-metrics main process (3456) terminated with status 1
> [   26.466787] zram: Added device: zram0
> [   26.712950] device-mapper: verity: sha256 using implementation "sha256-avx2"
> [   26.833286] zram0: detected capacity change from 0 to 14289797120
> [   27.007454] Adding 13954876k swap on /dev/zram0.  Priority:-2 extents:1 across:13954876k SS
> [   29.009623] crash-reporter: Saved OS version
> [  120.544204] ------------[ cut here ]------------
> [  120.544231] kernel BUG at fs/drop_caches.c:54!
> [  120.544256] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
> [  120.544277] CPU: 1 PID: 4378 Comm: bash Tainted: G     U            5.4.290-kasan_outline #1
> [  120.544290] Hardware name: HP Nami/Nami, BIOS Google_Nami.10775.1.0 06/12/2018
> [  120.544316] RIP: 0010:drop_caches_sysctl_handler+0x9/0x10
> [..]
>
> - patched
>
> cat /sys/fs/pstore/console-ramoops-0
> [..]
> <12>[   26.029936] init: send-boot-elog-metrics main process (3472) terminated with status 1
> <6>[   26.953501] zram: Added device: zram0
> <6>[   27.129768] device-mapper: verity: sha256 using implementation "sha256-avx2"
> <6>[   27.504036] zram0: detected capacity change from 0 to 14289797120
> <6>[   27.635588] Adding 13954876k swap on /dev/zram0.  Priority:-2 extents:1 across:13954876k SS
> <12>[   29.553790] crash-reporter: Saved OS version
> <4>[   37.165960] ------------[ cut here ]------------
> <2>[   37.166000] kernel BUG at fs/drop_caches.c:54!
> <4>[   37.166029] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
> <4>[   37.166054] CPU: 3 PID: 3891 Comm: bash Tainted: G     U            5.4.290-kasan_outline #1
> <4>[   37.166070] Hardware name: HP Nami/Nami, BIOS Google_Nami.10775.1.0 06/12/2018
> <4>[   37.166100] RIP: 0010:drop_caches_sysctl_handler+0x9/0x10
> [..]
>
>
> BUG=b:414300955
> TEST=triggered panic() and examined /sys/fs/pstore/console-ramoops-0
>      before and after the patch
> TEST=tested on nami and strongbad
> Cq-Depend:chrome-internal:8274397
>
> Disallow-Recycled-Builds: test-failures
> Change-Id: I1724a092fee1a5e4fb3b2079dcfa2d68b2b05f87
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/6549139
> Reviewed-by: Raul Rangel <rrangel@chromium.org>
> Commit-Queue: Sergey Senozhatsky <senozhatsky@chromium.org>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>

Bug: b:414300955
Change-Id: I59fba5405964548dcc7e1b91499311299c737403
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/6636950
Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Commit-Queue: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Suleiman Souhlal <suleiman@google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
1 file changed
tree: 3feb36866bf7adc60abee41e880e34dbf5874e48
  1. bin/
  2. build_library/
  3. hooks/
  4. lib/
  5. mod_for_test_scripts/
  6. .gitignore
  7. build_kernel_image.sh
  8. common.sh
  9. cros_show_stacks
  10. DIR_METADATA
  11. image_to_vm.sh
  12. make_netboot.sh
  13. mod_image_for_recovery.sh
  14. mount_gpt_image.sh
  15. OWNERS
  16. PRESUBMIT.cfg
  17. README.md
  18. update_bootloaders.sh
  19. update_kernel.sh
README.md

src/scripts directory

This repository contains build tools and scripts written in shell (e.g., Bash). Historically, much of our build process was written in shell in this directory, however, we're currently in the process of migrating many scripts to Python in Chromite.

In general, we're not currently accepting new scripts in this directory.

If you want to host a script for yourself/local team, feel free to use the src/platform/dev/contrib/ directory instead.