Question about Kernel

66 views
Skip to first unread message

Jingwen Ye

unread,
Apr 25, 2022, 9:17:27 AM4/25/22
to Chromium OS Development
I just want to modify chromimum_kernel_5_10, completed step is shown in below

- Added some patches in chromiumos/src/third_party/chromiumos-overlay/sys-kernel/chromeos-kernel-5_10/chromeos-kernel-5_10-9999.ebuild

The questions are :
1. In above path, there is an another ebuild file: chromeos-kernel-5_10-5.10.111-r1825.ebuild, what is the difference between 9999 and r1825? Which file will be used during kernel compiling?
(Based on my resaerach on Google, 9999 is "live" but I cannot understand the meaning of "live". But after my edition, I could see patched are installed from the log. However, I am still confused with the connection among these files)

2. Can someone tell me where is the file(or bash) that contains the information about compiling the kernel? I just want to confirm which instruction calls ebuild.

3. What I need to do for the next step is modifying config. Luckly, I found the bash (kernelconfig). However, I am confused that my edition using kernelconfig will be kept forever(In another word, when I run ./build_img, will the edition of kernel be removed or saved)? This question seems to have connection with 2nd Question. 

Harry Cutts

unread,
Apr 25, 2022, 1:37:18 PM4/25/22
to Chromium OS Development, jy...@cornell.edu
Hi,

Have you read through the Kernel Development page in the docs? That should contain all the information you need for modifying and compiling the Kernel.

Jingwen Ye

unread,
Apr 27, 2022, 11:19:34 AM4/27/22
to Chromium OS Development, hcu...@chromium.org, Jingwen Ye
Thanks, guy

After reading the instruction, I learned the ebuild knowledge. My tasks about patches completed by adding 

PATCHES=(
    "${FILESDIR}"/rtc.patch
    "${FILESDIR}"/acpi_uart.patch
    "${FILESDIR}"/iommu.patch
    "${FILESDIR}"/dmac_iommu_wa.patch
)

to chromeos-kernel-5_10-9999.ebuild and I saw these patches are added by reading the log

14:53:05 >>> Preparing source in /build/amd64-generic/tmp/portage/sys-kernel/chromeos-kernel-5_10-5.10.111-r1825/work/chromeos-kernel-5_10-5.10.111 ...
  [32;01m* [0m Applying acpi_uart.patch ...
[A [198C [34;01m[ [32;01mok [34;01m ] [0m
  [32;01m* [0m Applying dmac_iommu_wa.patch ...
[A [198C [34;01m[ [32;01mok [34;01m ] [0m
  [32;01m* [0m Applying iommu.patch ...
[A [198C [34;01m[ [32;01mok [34;01m ] [0m
  [32;01m* [0m Applying rtc.patch ...
[A [198C [34;01m[ [32;01mok [34;01m ] [0m
>>> Source prepared.

Is it correct? 

The next step is modifying kernel config. Based on my knowledge, I need to run make menuconfig to change the config on Linux. In Chromium OS, I found a script 

https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-configuration/

to edit the config manully. But this is not an ideal method. Does chromium OS provides an auto-run method about config edit? (Just like adding PATCHES to 9999.ebuild file instead of manully installing patches on Linux. )

Would you like to give me some hints?

Brian Norris

unread,
Apr 27, 2022, 3:55:19 PM4/27/22
to Jingwen Ye, Chromium OS Development, hcu...@chromium.org
https://chromium.googlesource.com/chromiumos/docs/+/HEAD/kernel_development.md#Kernel-configuration
->
https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/HEAD/eclass/cros-kernel/README.md

That tells you how you can specify your own .config (via
CHROMEOS_KERNEL_CONFIG). Or if you really want a "patch"-like
approach, you can use the "config fragments" described here:

https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/0231ecbaf9379061044c8495a9029bd47ca82c4d/eclass/cros-kernel2.eclass#154

Heed the warnings, and realize you're accepting some fragility, as
config patching is a bit hard to maintain, given a changing Kconfig
dependency tree over time.

Brian
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> https://groups.google.com/a/chromium.org/group/chromium-os-dev
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages