Recomended way to change kernel for a device

382 views
Skip to first unread message

Ronoaldo Pereira

unread,
Aug 6, 2015, 5:08:05 PM8/6/15
to Chromium OS dev
Hi everyone!

I am hacking on Chromium OS to learn with the source code, and run it on my existing notebooks. Some friends also are interested in running Chromium OS on their machines as well.

I followed the Developer Guide (http://www.chromium.org/chromium-os/developer-guide) and was able to build an image, including a set of features, and I am testing it on various AMD64 devices. The documentation is very well written, and I was able to follow all the steps to get the image for testing on a USB drive. I used the amd64-generic board to build the image, as all devices I will run tests are 64 bit.

During tests, I discovered that some hardware components were not working properly:
  • On my Lenovo G40-70 the Realtek Wifi card was not enabled, only the ethernet card.
  • On a Dell Vostro, the wifi worked just fine, but the sound card was not working.
  • On an HP G42, both wifi and sound card was not working.
I would love to use Chromium OS on those devices. To do so, I will need to rebuild the image, but this time enabling the missing drivers.

Here are my findinds so far:
  • First I started following the Section 5 of the developer guide, to just make changes to the kernel config (http://www.chromium.org/chromium-os/developer-guide#TOC-Making-changes-to-packages-whose-source-code-is-checked-into-Chromium-OS-git-repositories) as described here (http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-configuration)
    • I actualy was able to figure out from the Kernel Config docs, how to run the kernelconfig script. However, I discovered that my wifi driver was not there on the kernel settings, they are only part of 3.16 or newer.
  • So, I needed a newer kernel for my wifi, from 3.16 and up, but 3.14 was used by the board
    • This lead me to try to modify the kernel used by the board. Then I was unsure how to proceed, properly...
    • Should I cros_workon on the board (amd64-generic) to make the changes I need, and send a CL to include those drivers, or should I create a new board/variant to add those extra drivers/kernel versions?
    • Or should I cros_workon on the board (which I also unsure if is the correct way to do :-/), and create just a new profile, such as, custom, in which I then can make the changes.
    • Or should I just work on a private overlay for that board and make the changes there? In this case, as I'm also new on how the Portage build works, I don't know how to "replace" only the kernel version on the profile for my private overlay.
I really apreciate any input on this, and I'm going to update with more findings as I do more testing. I would love to make this result into a contribution to the project, and any guidance on a good aproach to proceed is more than welcome.

Thanks!

Nam Nguyen

unread,
Aug 6, 2015, 5:16:44 PM8/6/15
to Ronoaldo Pereira, Chromium OS dev
Ronoaldo,

Please see this thread for instructions to switch to 3.18
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-os-discuss/ZGGQqbLti-4

Cheers,
Nam
> --
> --
> 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
>

Ronoaldo José de Lana Pereira

unread,
Aug 10, 2015, 8:39:23 AM8/10/15
to Nam Nguyen, Chromium OS dev
Hi Nam,

Thanks for the reply! (and sorry for the double mail, cc/ list this time :( )

To avoid having local changes on my repo, I opted to setup a private overlay, that inherits from amd64-generic, and added the changes you suggested. However the build fails when I add the kernel 3.18 and remove the kernel 3.14.

My private overlay is as follows:
 
$ find -type f | xargs tail -n 100
==> ./make.conf <==
# Use a newer kernel
USE="${USE} -kernel-3_14 kernel-3_18"

==> ./metadata/layout.conf <==
masters = portage-stable chromiumos eclass-overlay amd64-generic
profile-formats = portage-2 profile-default-eapi
profile_eapi_when_unspecified = 5-progress
repo-name = amd64-generic-private
thin-manifests = true
use-manifests = true

==> ./profiles/base/parent <==
amd64-generic:base

==> ./toolchain.conf <==
# This is our main toolchain.
x86_64-cros-linux-gnu

# Since this is a paladin bot, we need this toolchain in order to test
# any packages that might need this (such as cros-workon chromeos-ec).
# If this board stops being a paladin bot, we can drop this.
arm-none-eabi

I was able to run this:

(cr) $ ./setup_board --board=amd64-generic --force

 I was able to see the profile from my private board being selected!

But when I run:

(cr) $ /build_packages --board=amd64-generic --usepkg

I get the following error (full output here: http://pastebin.com/z4V8mnY8)
(...)
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV620_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RS780_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV635_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *
chromeos-kernel-3_18-3.18-r352:  * Searching all installed packages for file collisions...
chromeos-kernel-3_18-3.18-r352:  *
chromeos-kernel-3_18-3.18-r352:  * Press Ctrl-C to Stop
chromeos-kernel-3_18-3.18-r352:  *
chromeos-kernel-3_18-3.18-r352:  * sys-kernel/linux-firmware-0.0.1-r68:0::chromiumos
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R100_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R200_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R300_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R420_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R600_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/R600_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RS600_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RS690_cp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RS780_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV610_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV610_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV620_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV635_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV670_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV670_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV710_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV710_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV730_me.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV730_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *      /build/amd64-generic/lib/firmware/radeon/RV770_pfp.bin
chromeos-kernel-3_18-3.18-r352:  *
chromeos-kernel-3_18-3.18-r352:  * Package 'sys-kernel/chromeos-kernel-3_18-3.18-r352' NOT merged due to
chromeos-kernel-3_18-3.18-r352:  * file collisions. If necessary, refer to your elog messages for the
chromeos-kernel-3_18-3.18-r352:  * whole content of the above message.
=== Complete: job chromeos-kernel-3_18-3.18-r352 (0m24.3s) ===
Failed sys-kernel/chromeos-kernel-3_18-3.18-r352 (in 0m24.3s). Your build has failed.
Pending 6/6, [Time 1m27.9s Load 1.42 0.65 0.47]
Packages failed:
        sys-kernel/chromeos-kernel-3_18-3.18-r352
ERROR   : Sat Aug  8 18:50:51 UTC 2015
ERROR   :  PGID  PPID   PID     ELAPSED     TIME %CPU COMMAND
ERROR   :    10     6    10  1-21:52:33 00:00:00  0.0 -bash
ERROR   : 16021    10 16021       02:34 00:00:00  0.0  \_ /bin/bash ./build_packages --board=amd64-generic --usepkg
ERROR   : 16021 16021 17515       00:00 00:00:00  0.0      \_ /bin/bash ./build_packages --board=amd64-generic --usepkg
ERROR   : 16021 17515 17516       00:00 00:00:00  0.0          \_ ps f -o pgid,ppid,pid,etime,cputime,%cpu,command
ERROR   : Arguments of 16021: ./build_packages '--board=amd64-generic' '--usepkg'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :  build_packages:254:main(), called: die_err_trap
ERROR   :
ERROR   : Command failed:
ERROR   :   Command '[[ $# -eq 0 ]]' exited with nonzero code: 1
(cr) ((37d5785...)) ronoaldo@chromeosbuild ~/trunk/src/scripts $

If I am understanding this correctly, the kernel 3_18 is shipping the same files as the chromiumos linux-firmware, but I don't think I can "remove" chromiumos right (like in USE="-chromiumos")? Any hints on how to fix this?

Thanks for the help!
--
Ronoaldo Pereira

Nehal Shah

unread,
Aug 10, 2015, 11:22:33 AM8/10/15
to Chromium OS dev
Hi Ronoaldo 

You need to do following thing.

This will help you.

Add following line to overlays/overlay-amd64-generic/make.conf

FEATURES="-collision-detect -protect-owned"

This will remove the errors of collision

Regards
Nehal

Mike Frysinger

unread,
Aug 10, 2015, 11:30:43 AM8/10/15
to Nehal Shah, Chromium OS dev
you don't want to turn that off.  either disable USE=firmware_install on the kernel, or change the LINUX_FIRMWARE setting in the make.conf.
-mike

--

Ronoaldo Pereira

unread,
Aug 10, 2015, 9:46:13 PM8/10/15
to Chromium OS dev, 21.n...@gmail.com
Thanks for the reply,

I think I don't want to "skip" colision validation, I want to understand why I can't build the newer kernel on amd64-generic board... Maybe I did something wrong in the configuration of the flags that are breaking my build.

First I did:
$ emerge-amd64-generic --info | grep USE 
USE="X acpi amd64 bindist bluetooth buffet bzip2 cairo cros-debug cros_p2p crypt cxx dri fbconsole hardened iconv kernel-3_18 legacy_keyboard legacy_power_button mbim mmx modules mudflap ncurses nptl nptlonly opengl pam peerd readline scanner sse sse2 ssl sysfs unicode usb vaapi vlan vtconsole wifi_bootstrapping xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" BOARD_USE="amd64-generic" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics cmt" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" LINUX_FIRMWARE="iwlwifi-all" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby19 ruby18" TTY_CONSOLE="tty2" USERLAND="GNU" VIDEO_CARDS="intel nouveau radeon fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

to check what was the "defaults" from the profile settings. Seemed OK for me, but I'm not sure as I am not experienced with gentoo builds.

Then I did the "emerge --pretent" to check what was going on with the kernel package:

$ emerge-amd64-generic --pretent --verbose sys-kernel/chromeos-kernel-3_18 | grep USE
[ebuild  N     ] sys-libs/zlib-1.2.8-r1 to /build/amd64-generic/ USE="static-libs -minizip" 0 KiB
[ebuild  N     ] app-arch/xz-utils-5.2.0 to /build/amd64-generic/ USE="static-libs threads -nls" 0 KiB
[ebuild  N     ] dev-libs/expat-2.1.0-r3 to /build/amd64-generic/ USE="-examples -static-libs -unicode" 0 KiB
[ebuild  N     ] app-arch/bzip2-1.0.6-r7 to /build/amd64-generic/ USE="-static -static-libs" 0 KiB
[ebuild  N     ] sys-apps/findutils-4.4.2-r2 to /build/amd64-generic/ USE="-debug -nls (-selinux) -static" 0 KiB
[ebuild  N     ] sys-libs/ncurses-5.9-r4:5 to /build/amd64-generic/ USE="minimal -ada -cxx -debug -doc -gpm -profile -static-libs -tinfo -trace -unicode" 0 KiB
[ebuild  N     ] sys-devel/m4-1.4.16 to /build/amd64-generic/ USE="-examples" 0 KiB
[ebuild  N     ] dev-libs/libltdl-2.4.6 to /build/amd64-generic/ USE="-static-libs" 0 KiB
[ebuild  N     ] sys-libs/readline-6.3_p8-r2 to /build/amd64-generic/ USE="-static-libs -utils" 0 KiB
[ebuild  N     ] sys-apps/diffutils-3.3 to /build/amd64-generic/ USE="-nls -static" 0 KiB
[ebuild  N     ] sys-devel/autoconf-2.69:2.5 to /build/amd64-generic/ USE="-emacs -multislot" 0 KiB
[ebuild  N     ] dev-libs/openssl-1.0.2d::chromiumos to /build/amd64-generic/ USE="asm (sse2) zlib (-bindist) -gmp -kerberos -rfc3779 -sctp -static-libs {-test} -tls-heartbeat -vanilla" 0 KiB
[ebuild  N     ] dev-libs/libpcre-8.35-r1:3 to /build/amd64-generic/ USE="bzip2 cxx jit readline recursion-limit (unicode) zlib -libedit -pcre16 -pcre32 -static-libs" 0 KiB
[ebuild  N     ] sys-devel/libtool-2.4.6:2 to /build/amd64-generic/ USE="-vanilla" 0 KiB
[ebuild  N     ] net-misc/curl-7.42.1 to /build/amd64-generic/ USE="ssl -adns -idn -ipv6 -kerberos -ldap -metalink -rtmp -samba -ssh -static-libs {-test} (-threads)" CURL_SSL="openssl -axtls -gnutls -nss -polarssl -winssl" 0 KiB
[ebuild  N     ] app-arch/cpio-2.11-r3 to /build/amd64-generic/ USE="-nls" 0 KiB
[ebuild  N     ] dev-vcs/git-2.1.2 to /build/amd64-generic/ USE="blksha1 curl iconv pcre threads webdav -cgi (-cvs) -doc -emacs -gnome-keyring -gpg -gtk -highlight -mediawiki -nls -perl (-ppcsha1) -python (-subversion) {-test} -tk -xinetd" PYTHON_TARGETS="python2_7" 0 KiB
[ebuild  N     ] sys-kernel/linux-firmware-0.0.1-r68::chromiumos to /build/amd64-generic/ USE="-cros_host -profiling" LINUX_FIRMWARE="iwlwifi-all -ath3k-all -ath3k-ar3011 -ath3k-ar3012 -ath9k_htc -bcm4354-bt -brcmfmac-all -brcmfmac4354-sdio -brcmfmac4356-pcie -cros-pd -fw_sst -fw_sst2 -ibt-hw -iwlwifi-100 -iwlwifi-1000 -iwlwifi-105 -iwlwifi-135 -iwlwifi-2000 -iwlwifi-2030 -iwlwifi-3160 -iwlwifi-3945 -iwlwifi-4965 -iwlwifi-5000 -iwlwifi-5150 -iwlwifi-6000 -iwlwifi-6005 -iwlwifi-6030 -iwlwifi-6050 -iwlwifi-7260 -iwlwifi-7265 -iwlwifi-7265D -marvell-pcie8897 -nvidia-xusb -rt2870" VIDEO_CARDS="radeon" 0 KiB
[ebuild  N     ] sys-kernel/chromeos-kernel-3_18-3.18-r352::chromiumos to /build/amd64-generic/ USE="fbconsole mbim vlan vtconsole -acpi_ac_off -android_test -binder -blkdevram -boot_dts_device_tree -builtin_fw_t124_xusb -builtin_fw_t210_nouveau -builtin_fw_t210_xusb -ca0132 -cifs -cros_ec_mec -cros_host -device_tree -dwc2_dual_role -dyndebug -factory_shim_ramfs -firmware_install -gdmwimax -gobi -highmem -i2cdev -kgdb -kvm -loader_kernel_ramfs -lxc -netboot_ramfs -nfc -nfs -nowerror -pcserial -ppp -profiling -qmi -realtekpstor -recovery_ramfs -samsung_serial -socketmon -systemtap -tpm -usb_gadget -usb_gadget_acm -usb_gadget_audio -usb_gadget_ncm -vfat -wifi_debug -wifi_testbed_ap -wireless316 -wireless318 -wireless34 -wireless38 -x32" BOARD_USE="amd64-generic -acorn -amd64-corei7 -amd64-generic_embedded -amd64-generic_freon -amd64-generic_mobbuild -amd64-host -aries -arkham -arm-generic -arm-generic_freon -arm64-generic -auron -auron_paine -auron_pearlvalley -auron_yuna -banjo -bayleybay -beaglebone -beaglebone_servo -beaglebone_vv1 -beltino -blackwall -bobcat -bolt -bruteus -buddy -butterfly -butterfly_freon -bwtm2 -bxt-rvp -candy -cardhu -celes -cid -clapper -cosmos -cranky -cyan -cyclone -daisy -daisy_embedded -daisy_skate -daisy_snow -daisy_spring -daisy_winter -dalmore -danger -danger_embedded -duck -enguarde -envoy-jerry -expresso -falco -falco_gles -falco_li -fb1 -foster -gandof -gizmo -glados -glimmer -gnawty -guado -guado_moblab -heli -hsb -ironhide -jecht -kayle -kip -klang -kunimitsu -lakitu -lakitu_mobbuild -laser -leon -link -lulu -lumpy -lumpy_freon -mappy -mappy-envoy -mappy_flashstation -marble -mccloud -minnowboard -mipseb-n32-generic -mipseb-n64-generic -mipseb-o32-generic -mipsel-n32-generic -mipsel-n64-generic -mipsel-o32-generic -monroe -moose -ninja -nyan -nyan_big -nyan_blaze -nyan_freon -nyan_kitty -oak -optimus -orco -panda -panther -panther_embedded -panther_goofy -panther_moblab -parrot -parrot32 -parrot64 -parrot_freon -parrot_ivb -peach -peach_kirby -peach_pi -peach_pit -peppy -ppcbe-32-generic -ppcbe-64-generic -ppcle-32-generic -ppcle-64-generic -puppy -purin -quawks -quawks_freon -rambi -raspberrypi -reptile -rikku -rizer -rotor -rush -rush_ryu -sama5d3 -samus -shogun -sklrvp -slippy -smaug -sonic -squawks -storm -storm_nand -stout -stout_freon -strago -stumpy -stumpy_freon -stumpy_moblab -stumpy_pico -sumo -swanky -tails -tegra3-generic -tidus -tricky -veyron -veyron_brain -veyron_caution -veyron_danger -veyron_gus -veyron_jaq -veyron_jerry -veyron_mickey -veyron_mighty -veyron_minnie -veyron_nicky -veyron_pinky -veyron_remy -veyron_rialto -veyron_romy -veyron_shark -veyron_speedy -veyron_thea -whirlwind -winky -wizpig -wolf -wsb -x32-generic -x86-agz -x86-alex -x86-alex32 -x86-alex32_he -x86-alex_freon -x86-alex_he -x86-alex_he-freon -x86-alex_hubble -x86-dogfood -x86-generic -x86-generic_embedded -x86-generic_freon -x86-mario -x86-mario64 -x86-mario_freon -x86-zgb -x86-zgb32 -x86-zgb32_he -x86-zgb_freon -x86-zgb_he -x86-zgb_he-freon -zako" 0 KiB

So, -firmware_install is already in USE flags for the kernel package. Maybe VIDEO_CARDS=radeon could be the issue? How should I change my package.use file to avoid the collision? I checked this wiki but got no clues: https://wiki.gentoo.org/wiki/Radeon

My goal is to first build the newer kernel image, but also to be able to change the newer kernel config later so my wifi card works.
As a side note, if this is an issue with 3.18, how do I build the 4.1.4 kernel image instead? This one shold work even better because it has a fix for a connection issue with my particular wifi driver.

Thanks!

Mike Frysinger

unread,
Aug 11, 2015, 12:11:52 AM8/11/15
to Ronoaldo Pereira, Chromium OS dev, Nehal Shah
it's not really anything you've done wrong.  we've had a bit of a mismatch between the firmware the kernel itself installs and the external firmware package.  we haven't gotten around to fully unwinding things yet.
-mike

Ronoaldo Pereira

unread,
Aug 11, 2015, 11:58:13 PM8/11/15
to Chromium OS dev, rono...@gmail.com, 21.n...@gmail.com
Thanks Mike. Could you point me to a way to add a newer kernel on my board overlay then? I'm using a "private" overlay that derives from overlay-amd64-generic, just to not mess with my local copy of the original board, so I can rebuild the updates regularly.

The source I'm using is published here: https://github.com/ronoaldo/chromiumos-amd64-generic

What I'm not sure how to do is how to add a custom kernel, and make it get picked up by the build system.

Thanks.

Mike Frysinger

unread,
Aug 13, 2015, 5:47:04 AM8/13/15
to Ronoaldo Pereira, Chromium OS dev, Nehal Shah
in your local overlay, add a virtual/linux-sources ebuild that points to your custom kernel.  a few boards do this already so you should be able to double check against them.
-mike
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages