Building a specific linux kernel for chromiumos

378 views
Skip to first unread message

Ravishankar S

unread,
May 12, 2021, 1:25:51 PM5/12/21
to Chromium OS Development
Hi all,

I want to separately build the exact same kernel from a chromiumos arm64-generic build.

For example:


The kernel version here is:

Linux version 4.19.188-11540-gfe9315762f7a (chrome-bot@
os-ci-full-us-central2-c-x32-1-6pyn) 

I have followed a few instructions from here:


Now I did this :

From here :

I could see that this branch is closest : stable-merge/linux/v4.19.188

So i did a :

git clone -b  stable-merge/linux/v4.19.188 https://chromium.googlesource.com/chromiumos/third_party/kernel

Then I did a :

git checkout 11540-gfe9315762f7a

Now when I build the kernel with defconfig, I get the kernel versions as:

Linux version 4.19.188-29846-gfe9315762f7a (rreddy78@jetson-nano)

Why did the version change ?

Thanks and Regards
Ravishankar



Brian Norris

unread,
May 12, 2021, 7:54:49 PM5/12/21
to Ravishankar S, Chromium OS Development
The version changed because you guessed at the wrong commit-ref to
use, and the version text is based on git-describe output.

To get precisely the right version for a given build, you'd normally
reference the manifest buildspecs:
https://chromium.googlesource.com/chromiumos/manifest-versions/+/refs/heads/main/buildspecs/

I don't think the public manifests give you every canary/ToT build
though (so for example, I think it's missing R92-13931.0.0, which was
your example).

But you're in luck: the "Linux version" banner is already giving you
the precise info in that string -- just check out commit fe9315762f7a.
(e.g., `git clone -b chromeos-4.19 ...`, `git checkout fe9315762f7a`).
> --
> --
> 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

Ravishankar S

unread,
May 13, 2021, 4:00:16 AM5/13/21
to Brian Norris, Chromium OS Development
Thanks for the hints, but still no luck. 

I get his output on booting

 qemu-system-aarch64 -M virt -m 2048 -smp 2 -cpu host -enable-kvm  -kernel vmlinuz-4.19.188-11540-arm64vm5 \
> -append 'init=/sbin/init boot=local rootwait ro noresume noswap loglevel=7 noinitrd console=ttyAMA0  i915.modeset=1 cros_efi cros_debug root=PARTUUID=97b4aaf3-6484-b743-bd18-1d64f5c946b8' \
> -device usb-ehci -device usb-kbd -device usb-mouse -usb  -serial stdio -device virtio-gpu-pci,virgl=on,xres=1600,yres=900 -display sdl,gl=on \
> -device virtio-blk-device,drive=hd -drive if=none,file=/home/rreddy78/Downloads/chromiumos_test_image.bin,format=raw,id=hd  \
> -netdev user,id=mynet -device virtio-net-device,netdev=mynet
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd071]
[    0.000000] Linux version 4.19.188-29846-gfe9315762f7a (rreddy78@jetson-nano) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP PREEMPT Thu May 13 10:50:03 IST 2021

At the end I get this message..

[    5.344745] init: early-failure main process (1460) terminated with status 124
[    5.673115] init: udev pre-start process (1467) killed by ABRT signal
[    5.678280] EXT4-fs (vda1): The kernel was not built with CONFIG_QUOTA and CONFIG_QFMT_V2
[    5.692584] chromeos-boot-alert: self_repair
chromeos-boot-alert: self_repair

I want this new kernel because the generic one does not enable CONFIG_DRM_VIRTIO_GPU for graphical output on qemu. 
 And unfortunately I can write the modules into the RO ROOT-A fs when using a different kernel.

Now when I use the  default kernel that is in the the build, the boot log ends like this

init: cgroups main process (345) terminated with status 1
[    6.899169] init: tcsd main process (703) terminated with status 137
[    6.902081] init: tcsd main process ended, respawning
[    7.493886] init: machine-info pre-start process (564) terminated with status 1
[    8.948091] audit: type=1326 audit(1577923206.220:2): auid=4294967295 uid=247 gid=247 ses=4294967295 subj=kernel pid=1605 comm="attestationd" exe="/usr/sbin/attestationd" sig=0 arch=c00000b7 syscall=198 compat=0 ip=0x7ad656274c code=0x7ffc0000
[   12.613101] init: ui main process (1102) terminated with status 2
[   13.187683] init: machine-info pre-start process (1887) terminated with status 1
[   13.931793] hrtimer: interrupt took 3411042 ns
[   15.318101] init: ui main process (2134) terminated with status 2
[   15.759871] init: machine-info pre-start process (2419) terminated with status 1
[   17.383963] init: ui main process (2666) terminated with status 2
[   17.814207] init: machine-info pre-start process (2948) terminated with status 1
[   19.444688] init: ui main process (3195) terminated with status 2
[   19.917655] init: machine-info pre-start process (3480) terminated with status 1
[   21.591530] init: ui main process (3727) terminated with status 2
[   22.008478] init: machine-info pre-start process (4009) terminated with status 1
[   23.667768] init: ui main process (4256) terminated with status 2
[   24.076247] init: machine-info pre-start process (4539) terminated with status 1
[   25.724740] init: ui main process (4786) terminated with status 2

So the generic kernel is missing the options to use graphical output..

Thanks and Regards
Ravishankar









Brian Norris

unread,
May 14, 2021, 2:12:06 PM5/14/21
to Ravishankar S, Chromium OS Development
I missed something the first time around: you actually did already have the right kernel hash in the first place, but the git-describe version output was still different. I'm a bit at a loss for why that happens, but...

...off-the-wall guess: maybe you have a different version of 'git', and it computes git-describe differently? I'm sure that algorithm has to be at least somewhat complex, because the complex web of merges in a git tree would make it hard to compute exactly how many patches there are between a given tag and the current HEAD. But I say that with zero knowledge of how git tries to do this.

Can you check what `git describe fe9315762f7a` produces? And compare that with `git describe fe9315762f7a` inside a CrOS SDK?
Also, maybe `git version`?

BTW, those docs you are following are 100% unsupported/unofficial.

Also, if you have a mismatched kernel like this, modprobe may not find your kernel modules, and it's not surprising that, for instance, the graphical UI can't start up properly (e.g., no GPU drivers).

Ravishankar S

unread,
May 15, 2021, 9:54:48 AM5/15/21
to Brian Norris, Chromium OS Development
And I have tried to use a kernel built without modules. I can see graphical output with the boot logo. But stuck at repairing boot message.

Ravishankar S

unread,
May 15, 2021, 9:54:48 AM5/15/21
to Brian Norris, Chromium OS Development
Thanks Brain.

rreddy78@jetson-nano:~/chromiumos/kernel$ git describe fe9315762f7a
v4.19-29846-gfe9315762f7a

rreddy78@jetson-nano:~/chromiumos/kernel$ git version
git version 2.17.1

I will be setting up a CrSDK on a x86 machine soon. I was using the prebuilt ones as I didn't have development machine

Regards


On Fri, May 14, 2021 at 11:42 PM Brian Norris <brian...@chromium.org> wrote:

Baker, Edward

unread,
May 17, 2021, 7:01:13 PM5/17/21
to Brian Norris, Ravishankar S, Chromium OS Development

Hi all,

 

I did a few git describe checks on my local development machine running Ubuntu 20.04.

$ git --version
git version 2.25.1

 

My primary, frequently repo synced, and oldest Chromium OS tree seems to match the builder.

~/chromiumos/src/third_party/kernel/v4.19$ git describe fe9315762f7a

v4.19.188-11540-gfe9315762f7a

 

A newer (relative to the above tree’s original clone) produced a slightly different describe.

/mnt/misc/clean-trees/tree3/src/third_party/kernel/v4.19$ git describe fe9315762f7a

v4.19.186-11620-gfe9315762f7a

 

Then a kernel cloned this morning matches the original question.

/tmp/chromiumos-kernel$ git describe fe9315762f7a

v4.19-29846-gfe9315762f7a

 

I’m wondering if my rolling Chromium OS development tree accumulates tags? In any case this fresh tree did not have a v4.19.188 tag. If I add the stable kernel repo to pick up more tags, it then matches my primary development tree and the chrome-bot.

/tmp/chromiumos-kernel$ git tag --list 'v4.19.18*'
v4.19.189

/tmp/chromiumos-kernel$ git remote add upstream-stable https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

/tmp/chromiumos-kernel$ git fetch upstream-stable

/tmp/chromiumos-kernel$ git tag --list 'v4.19.18*'
v4.19.18
v4.19.180
v4.19.181
v4.19.182
v4.19.183
v4.19.184
v4.19.185
v4.19.186
v4.19.187
v4.19.188
v4.19.189

/tmp/chromiumos-kernel$ git describe fe9315762f7a
v4.19.188-11540-gfe9315762f7a

 

Thanks,

Ed

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages