How to load a new kernel on ChromeOS

88 views
Skip to first unread message

Paco GB

unread,
Dec 29, 2016, 5:01:16 AM12/29/16
to Chromium OS dev
Hi,

I'm new in ChromiumOS dev, first thing i tried to do is to compile a new version of the kernel and try to load it in ChromeOs.

I did manage to download, configure and compile the Kernel using crouton, but know i don't know how to load it.

After reading the presentation of "Verified boot"


In the slide  21 I see that in developer mode it is possible to load a different kernel without modifying the firmware. But I'm not really sure how?
Do you know any documentation or reference where i can look to? 

Thanks, 

Christopher Friedt

unread,
Dec 29, 2016, 11:56:41 AM12/29/16
to Paco GB, Chromium OS dev
That's a really good question... I recently found that
CONFIG_HID_MAGICMOUSE is not enabled for the kernel in my Asus
ChromeBit, and imagine that it could possibly take years for the CrOS
team to change that, just so that I can scroll with my mouse.

Steev Klimaszewski

unread,
Dec 29, 2016, 1:20:33 PM12/29/16
to Christopher Friedt, Paco GB, Chromium OS dev
Or, you could create a pull request enabling the option and explaining it and submitting it to their codereview.  Which is what I've done on occasions where I've wanted an option enabled.  It did not take years, it simply took me doing the work and explaining why it was needed.  Doing the work instead of waiting for someone on the team to have the same hardware and desires as you tends to get things done quicker. 

Dmitry Torokhov

unread,
Dec 29, 2016, 1:43:05 PM12/29/16
to Steev Klimaszewski, Christopher Friedt, Paco GB, Chromium OS dev
Hmm, we do have this driver enabled on most of our builds, so there
shouldn't be issues enabling it on chromebits as well:

(cr) dtor@dtor-ws ~/trunk/src/third_party/kernel $ grep -r MAGICM v*/chromeos/
v3.10/chromeos/config/base.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/mips/common.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/i386/common.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/arm64/common.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/armel/chromiumos-rockchip.flavour.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/armel/chromiumos-cygnus.flavour.config:#
CONFIG_HID_MAGICMOUSE is not set
v3.14/chromeos/config/armel/chromiumos-arm.flavour.config:CONFIG_HID_MAGICMOUSE=m
v3.14/chromeos/config/x86_64/common.config:CONFIG_HID_MAGICMOUSE=m
v3.18/chromeos/config/mips/common.config:CONFIG_HID_MAGICMOUSE=m
v3.18/chromeos/config/i386/common.config:CONFIG_HID_MAGICMOUSE=m
v3.18/chromeos/config/arm64/common.config:CONFIG_HID_MAGICMOUSE=m
v3.18/chromeos/config/armel/chromiumos-ipq40xx.flavour.config:#
CONFIG_HID_MAGICMOUSE is not set
v3.18/chromeos/config/armel/chromiumos-arm.flavour.config:CONFIG_HID_MAGICMOUSE=m
v3.18/chromeos/config/armel/chromiumos-armada38x.flavour.config:#
CONFIG_HID_MAGICMOUSE is not set
v3.18/chromeos/config/x86_64/common.config:CONFIG_HID_MAGICMOUSE=m
v3.8/chromeos/config/base.config:CONFIG_HID_MAGICMOUSE=m
v4.4/chromeos/config/base.config:CONFIG_HID_MAGICMOUSE=m

Hmm, Chromebits are Rockchip devices with 3.14 kernel, so they should
already have magicmouse enabled (see
v3.14/chromeos/config/armel/chromiumos-rockchip.flavour.config). Could
it be that you need some other driver? Or maybe support for your
version of device was added to a newer kernel?

Thanks,
Dmitry

Christopher Friedt

unread,
Dec 29, 2016, 2:15:08 PM12/29/16
to Dmitry Torokhov, Steev Klimaszewski, Paco GB, Chromium OS dev
On Thu, Dec 29, 2016 at 1:42 PM, Dmitry Torokhov <dt...@chromium.org> wrote:
> Hmm, we do have this driver enabled on most of our builds, so there
> shouldn't be issues enabling it on chromebits as well:
>
> (cr) dtor@dtor-ws ~/trunk/src/third_party/kernel $ grep -r MAGICM v*/chromeos/
> v3.14/chromeos/config/armel/chromiumos-rockchip.flavour.config:CONFIG_HID_MAGICMOUSE=m

> Hmm, Chromebits are Rockchip devices with 3.14 kernel, so they should
> already have magicmouse enabled (see
> v3.14/chromeos/config/armel/chromiumos-rockchip.flavour.config). Could
> it be that you need some other driver? Or maybe support for your
> version of device was added to a newer kernel?

Hmm... I have a Magic Mouse 2 (which is the bluetooth version). After
looking in drivers/hid-magicmouse.c, it looked as though it was part
of that driver. None of the scrolling (vert / horiz) or any other
mouse gestures seem to do anything in CrOS, so I assumed the module
was not loaded.

Christopher Friedt

unread,
Dec 29, 2016, 3:06:19 PM12/29/16
to Dmitry Torokhov, Chromium OS dev, Paco GB, Steev Klimaszewski
This might be the issue.


Module parameter 'emulate_scroll_wheel' is not set by default.

©

Sent from my Android

Dmitry Torokhov

unread,
Dec 29, 2016, 3:15:02 PM12/29/16
to Christopher Friedt, Dmitry Torokhov, Chromium OS dev, Paco GB, Steev Klimaszewski
The parameter is on by default:

drivers/hid/hid-magicmouse.c:static bool emulate_scroll_wheel = true;

On Thu, Dec 29, 2016 at 12:06 PM, Christopher Friedt

Christopher Friedt

unread,
Dec 29, 2016, 3:15:57 PM12/29/16
to Dmitry Torokhov, Paco GB, Chromium OS dev, Steev Klimaszewski

Weird.

Does not scroll at all.

©

Sent from my Android

Dmitry Torokhov

unread,
Dec 29, 2016, 3:25:35 PM12/29/16
to Christopher Friedt, Dmitry Torokhov, Paco GB, Chromium OS dev, Steev Klimaszewski
Well, is it the original Magic mouse or a newer one? What is the
VID/PID? Do you have it working properly on a generic Linux
distribution?

Please collect the data and open a bug on crosbug.com.

Thanks,
Dmitry


On Thu, Dec 29, 2016 at 12:15 PM, Christopher Friedt
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

Justin S

unread,
Dec 29, 2016, 6:56:59 PM12/29/16
to Chromium OS dev
I'm not sure but this get threadjacked? The original post was asking if there is a how-to on loading new kernels. Since the second post this has been all about Magic Mouse scrolling support, or whatever. I've been lurking for a few weeks and he original question is the reason I joined this group in the first place. Is there a decent how-to of sorts? Thanks!

Prathmesh Prabhu Chromium

unread,
Dec 29, 2016, 7:08:25 PM12/29/16
to Justin S, Chromium OS dev
Looping back to that question, if you're in developer mode, you don't need to change the firmware to boot into an image built at your workstation. This is described in detail at http://dev.chromium.org/chromium-os/developer-guide#TOC-Installing-Chromium-OS-on-your-Device
Of course, you can build in any kernel you want into the image.

Is this what you were looking for?


On Thu, Dec 29, 2016 at 3:57 PM Justin S <jsch...@gmail.com> wrote:
I'm not sure but this get threadjacked? The original post was asking if there is a how-to on loading new kernels. Since the second post this has been all about Magic Mouse scrolling support, or whatever. I've been lurking for a few weeks and he original question is the reason I joined this group in the first place. Is there a decent how-to of sorts? Thanks!

Paco GB

unread,
Dec 30, 2016, 1:56:04 PM12/30/16
to Chromium OS dev, jsch...@gmail.com
Yes @Justin S. the thread was hijacked! ;)

No @Prathmesh Prabhu  that was not what i was looking for.

What I'm trying to do is to load my own  modified kernel into ChromeOS, not building a ChromiumOS version with a modified kernel. 
The difference basically is that I would want to keep ChromeOS and the Play store.   

I made some progress though. I saw that the kernels (A,B and C) are stored in different partitions, and those partitions are selected based on the priority flag set by cgpt.

So following the information at the end of this page:


I signed the bzImage file of the kernel i did compile using the command:

echo blah > dummy.txt

vbutil_kernel --pack kernelpart.bin \
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--version 1 \
--vmlinuz ${MY_BINARY} \
--bootloader dummy.txt \
--config dummy.txt \
--arch x86

and then i tried to copy that signed kernel image to the non active kernel partition  ( I did choose the one without the "successful" flag equal to 1, because I imagined that is the non active partition)

  dd if=kernelpart.bin of=/dev/sda4

Finally i rebooted the system and... it did not work, the system tried to load the new kernel and i got a black screen, then i turned the computer off and on again and it fallback to the previous kernel.

Any help at this point? Have anyone tried something similar? I saw that "make_dev_ssd.sh"  moves the kernel to a temp folder, makes some modifications and load it back to it's partition, so maybe there is some insights  there on how to do it. I'll keep you updated.

Ausmus, James

unread,
Jan 4, 2017, 2:28:33 PM1/4/17
to Paco GB, Chromium OS dev, jsch...@gmail.com
Try: http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-faq#TOC-How-to-quickly-test-kernel-modifications-the-fast-way-
> ---
> You received this message because you are subscribed to the Google Groups
> "Chromium OS dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chromium-os-d...@chromium.org.



--


James Ausmus
ChromeOS Integration Architect
SSG-OTC ChromeOS Integration
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages