How to port a newer kernel to android-x86

3,045 views
Skip to first unread message

Mario Holzinger

unread,
Nov 21, 2015, 4:56:47 AM11/21/15
to Android-x86
Hi all

I love to build my own images directly from sources.
Due to the fact that I'm not an expert in git/porting/... I'd like to know if anybody can help me find the way to get things working.

building lollipop images for x86 and x86_64 are working fine for me (iso_img & efi_img)
aslo changing the kernel to 3.18 or 3.10.y on the x86 builds are working fine

I use a Microsoft Suface Pro 2 with 8GB RAM to build and thest my images and with kernel 4.0 my WiFi is broken. best kernel at the moment is 3.18 for me but here only x86 builds are bootable.

So I'd like to port a mainline kernel (4.3 stable or 4.4 atm) and get it workng to see if WiFi is working (thats what I figured out on Ubuntu 15.10 thats 4.3 gets WiFi back to live)

What I did so far:

cd kernel
git remote add mainline https
://github.com/torvalds/linux.git
git fetch mainline master
git checkout mainline
/master
cp
~/android-x86_64_defconfig ~/android-x86/kernel/arch/x86/configs/
cd
..
. build/envsetup.sh
lunch android_x86_64
-eng
make efi_img
-j4


this was not working so I think I have to edit the original kernel config from kernel 4.4 and set the parameters discribed in

to make my next test


Is there someting I forget?
Or is ther an easier way to set the values from AOSP to the kernel Config than searching and clicking through "menueconfig" that is described here:



JJ Meijer

unread,
Nov 21, 2015, 7:29:58 AM11/21/15
to Android-x86
You could also take my source from here: https://github.com/meijjaa/linux/tree/android, it is vanilla from 2 weeks ago with only crucial patches to get it to work with Android-x86.

Just rename: arch/x86/configs/baytrail_defconfig to arch/x86/configs/android-x86_defconfig and you are ready to go.



Op zaterdag 21 november 2015 10:56:47 UTC+1 schreef Mario Holzinger:

Mario Holzinger

unread,
Nov 21, 2015, 7:51:49 AM11/21/15
to Android-x86
great thank you for that.

from your commits I see that I'm on the correct way if I like to port it by myselfe.
only a few mods for baytrail and batterie log, the rest is directly edit the kernel config to fit the current kernel version.

I'l give it a try with your repo on x86 and x86_64 builds (efi_img) and poste the result when i'm finished.

best regards
Mario

Mario Holzinger

unread,
Nov 22, 2015, 8:14:16 AM11/22/15
to Android-x86
many thanks for your repository.

kernel 4.3 is working in the x86 edition.
btw. I also need to create an additional copy of the baytrail config as android-x86_64_defconfig

And due to the fact that this is the original source, my patch that is integrated into android-x86 kernels was also necessarre to be implemented.
(rename the marvell WiFi adapter from mlanX to wlanX to get it working in android)

next step is to try a x86_64 build.

best regards
Mario from Austria

Mauro Rossi

unread,
Nov 22, 2015, 9:50:36 PM11/22/15
to Android-x86
Hi,

thanks a lot to meijjaa,

I've rebased your repo to kernel 4.4rc2, updated broadsoft-sta hybrid driver to latest version ,
built x86 and x86_64 kernel and updated the defconfig files of lollipop-x86 kernel 4.0.9 with default values for 4.4


In order to build the updated broadsoft drivers the attached patch is also necessary for build project.

In principle the broadcom driver updates are applicable to kernel 4.0.9 too,
but they need to be tested.

Mauro


0001-kernel.mk-use-updated-broadcom-sta-hybrid-driver.patch
Message has been deleted

JJ Meijer

unread,
Nov 23, 2015, 7:59:08 AM11/23/15
to Android-x86
No problem and thank you, nice improvements!

Mauro Rossi

unread,
Nov 23, 2015, 4:12:20 PM11/23/15
to Android-x86
Hi,

my "shortcut" of using the defaults for new kernel options (by hitting always ENTER key) did work for trying latest nouveau changes,
but unfortunately for Intel GPUs produces a systematic hang,

my crash-test-dummy defconfig files will need some futher changes to work properly.
M.


Mauro Rossi

unread,
Nov 27, 2015, 3:13:48 PM11/27/15
to Android-x86

> my crash-test-dummy defconfig files will need some futher changes to work properly.
> M.

Hi!

I have managed to find what was the problem in my defconfigs,
as usual I was missing the basics...

GPU authentication needs to be disabled for the kernel to work with Android and I always forget that.

Now I can boot on sandybridge (Dell E6420) and it works very nicely,
but I still have some problems to boot on Acer 5620, as per attached screenshots.

Updated kernel repo availble here:

https://github.com/maurossi/linux/tree/kernel-4.4rc2_rebase

Mauro

IMG_20151127_163621.jpg
IMG_20151127_163650.jpg
Message has been deleted

JJ Meijer

unread,
Nov 27, 2015, 3:31:40 PM11/27/15
to Android-x86
I think you had a different problem because I completely removed the authentication code: https://github.com/maurossi/linux/commit/44a7dcc5f1efe5c65569573de2fd530ccff16807 also tried your new mesa 11 branch but wasn't able to get it loaded during boot (Bay Trail). I was a bit to busy with the Intel UFO driver / kernel, will try again next week :)

Mauro Rossi

unread,
Nov 27, 2015, 8:12:43 PM11/27/15
to Android-x86

> I think you had a different problem because I completely removed the authentication code: https://github.com/maurossi/linux/commit/44a7dcc5f1efe5c65569573de2fd530ccff16807 also tried your new mesa 11 branch but wasn't able to get it loaded during boot (Bay Trail). I was a bit to busy with the Intel UFO driver / kernel, will try again next week :)

Hi,

on sandybridge (Dell 6420) I've enabled DRM_I915_KMS and DRM_I915_FBDEV,
to see it booting.

Regarding my problem with X3100 GPU (Acer 5620) I saw the errors were ACPI related and I could boot with acpi=off parameter added in grub line.

Should I do some other changes in kernel config or source, to avoid the problem?

Mauro

JJ Meijer

unread,
Nov 28, 2015, 6:15:41 AM11/28/15
to Android-x86
Hi,

Are you sure about this? Those options seem no longer available with kernel 4.4, did you add them manually?

Also a nice way to config the kernel:
make menuconfig KCONFIG_CONFIG= your config file

Then use "/" to search through the config options (like "i915"), when found type the number in front to jump to the option in the menu.

Mauro Rossi

unread,
Nov 28, 2015, 3:29:07 PM11/28/15
to Android-x86
Thanks, infact all the option I had added were deleted in .config file generated at the build.
The acpi problem may be a 4.4rc2 bug, fingers crossed for upcoming 4.4rc3

Mauro Rossi

unread,
Dec 1, 2015, 6:34:16 PM12/1/15
to Android-x86
With 4.4rc3 still no boot without acpi=off GRUB line on Acer 5620, but on Dell E6420 and desktops it works.

I'm looking forward to GPU debugging tools in Android Studio to do further trobleshooting of GPU problems

M.

JJ Meijer

unread,
Dec 2, 2015, 6:57:36 AM12/2/15
to Android-x86
Also tested rc3. On Bay Trail GPU works without acpi=off but my sdio WiFi card won't init so not really an option for me. Also the Intel UFO driver still fails to alloc memory, invalid flag...

Povilas Staniulis

unread,
Dec 2, 2015, 6:09:15 PM12/2/15
to andro...@googlegroups.com
Someone on Asus T100 Google+ group mentioned that WiFi can be fixed by
reverting commit 9faac7b95ea4f9e83b7a914084cc81ef1632fd91
"mmc: sdhci: enable tuning for DDR50" (/drivers/mmc/host/sdhci.c)

Didn't test this myself, but it may be worth trying.

JJ Meijer

unread,
Dec 2, 2015, 8:13:22 PM12/2/15
to Android-x86
Thanks! I will check it out next RC. At the moment running 4.1.13, very fast and stable so far  (baytrail_defconfig): https://github.com/meijjaa/linux/tree/android-longterm

Can't wait to get to use it with the Intel UFO driver.... I would like to help fix all issues with MESA but I wouldn’t know where to start. (colorfade on suspend bug, Google Maps, pixel formats, ...)


Op donderdag 3 december 2015 00:09:15 UTC+1 schreef Povilas Staniulis:

Povilas Staniulis

unread,
Dec 2, 2015, 8:27:40 PM12/2/15
to andro...@googlegroups.com
Thanks.
Will check this kernel out on my T100.

What device are you running this on ?
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

JJ Meijer

unread,
Dec 3, 2015, 4:44:50 AM12/3/15
to Android-x86
I'm using a HP Omni 10, very comparable hardware so I guess it should work for you as well.

Op donderdag 3 december 2015 02:27:40 UTC+1 schreef Povilas Staniulis:

Mario Holzinger

unread,
Dec 8, 2015, 5:59:43 AM12/8/15
to Android-x86
Did some of you tried the kernel from JJ on marshmallow??

it compiles but after grub the screen gets black without any reaction.

Tried also to fetch my own copy of the mainline kernel but can not compile it so far
- fecht the mainline repository
- patch my mwifiex kernel patch to get WiFi working on my SP2
- set all found kernel configuration parameters (Base Configuration mentioned on AOSP)

when compiling I stuck on different errors
e.g. error: code model kernel does not support PIC mode

Mario Holzinger

unread,
Dec 8, 2015, 6:18:13 AM12/8/15
to Android-x86
on my own kernel based on mainline kernel

its interresting when compiling an iso_img I get 

fatal error: openssl/opensslv.h: No such file or directory

when compiling an efi_img the error

JJ Meijer

unread,
Dec 8, 2015, 7:26:40 AM12/8/15
to Android-x86
Are you using x86 or x64?

Also it might be easier to build the kernel outside of the Android build tree, just run:

 KCONFIG_CONFIG="path to kernel config" INSTALL_MOD_PATH="Path to Android system output dir" make -jX (X would be the number of threads like 8 or something)

replace the Android kernel with arch/boot/x86/bzImage

And do "make snod" in the Android tree to rebuild the system image.

Op dinsdag 8 december 2015 12:18:13 UTC+1 schreef Mario Holzinger:

Chih-Wei Huang

unread,
Dec 8, 2015, 8:21:22 AM12/8/15
to Android-x86
2015-12-08 20:26 GMT+08:00 JJ Meijer <jjmei...@gmail.com>:
> Are you using x86 or x64?
>
> Also it might be easier to build the kernel outside of the Android build
> tree, just run:
>
> KCONFIG_CONFIG="path to kernel config" INSTALL_MOD_PATH="Path to Android
> system output dir" make -jX (X would be the number of threads like 8 or
> something)
>
> replace the Android kernel with arch/boot/x86/bzImage
>
> And do "make snod" in the Android tree to rebuild the system image.

Hmm, I don't recommend this way unless
he is very familiar with the kernel building process
and how android-x86 image is combined.

The better (easier) way is just set
KERNEL_DIR to the path of the customized kernel tree.

> Op dinsdag 8 december 2015 12:18:13 UTC+1 schreef Mario Holzinger:
>>
>> on my own kernel based on mainline kernel
>>
>> its interresting when compiling an iso_img I get
>>
>> fatal error: openssl/opensslv.h: No such file or directory
>>
>> when compiling an efi_img the error
>>
>> error: code model kernel does not support PIC mode

You need this patch to build x86_64 kernel
(with android toolchains)

https://sourceforge.net/p/android-x86/kernel/ci/e3bd23b0986b5cfc8cd930222187d74ee6f76a86/


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

JJ Meijer

unread,
Dec 8, 2015, 10:01:38 AM12/8/15
to Android-x86
You are very right, that's a lot easier and I also must recommend your way :). I just like my way better because it's a lot faster during testing and I don't have to worry about the Android build system.



Op dinsdag 8 december 2015 14:21:22 UTC+1 schreef Chih-Wei Huang:

JJ Meijer

unread,
Dec 9, 2015, 5:03:00 PM12/9/15
to Android-x86
Thank's to Chih-Wei, Mauro and Povilas here is a new kernel 4.4 rc4 with the pic build fix, WiFi is working again and I added the Andoid-x86 configs again:  https://github.com/meijjaa/linux/tree/android

Although WiFi is working there is no status information any more, much like I experienced before with kernel 4.2 / 4.3.

Povilas Staniulis

unread,
Dec 9, 2015, 6:44:04 PM12/9/15
to andro...@googlegroups.com
By status information, you mean signal strength ?


On 2015.12.10 00:03, JJ Meijer wrote:
Thank's to Chih-Wei, Mauro and Povilas here is a new kernel 4.4 rc4 with the pic build fix, WiFi is working again and I added the Andoid-x86 configs again:  https://github.com/meijjaa/linux/tree/android

Although WiFi is working there is no status information any more, much like I experienced before with kernel 4.2 / 4.3.

Mauro Rossi

unread,
Dec 9, 2015, 7:58:26 PM12/9/15
to Android-x86

With 4.4rc3 still no boot without acpi=off GRUB line on Acer 5620, but on Dell E6420 and desktops it works.

With 4.4rc4 the problem disappeared, no more need of adding acpi=off line in amy of my laptops/desktops
It is not far from being production stable.
Mauro

Mauro Rossi

unread,
Dec 9, 2015, 8:23:52 PM12/9/15
to Android-x86

> Although WiFi is working there is no status information any more, much like I experienced before with kernel 4.2 / 4.3.

On Intel WiFi of Dell E6420 and Acer Extensa 5620 the WiFi status information is visible, meaning SSID, Status, Signal Strength, Frequency and Security.
M.

JJ Meijer

unread,
Dec 10, 2015, 2:19:57 AM12/10/15
to Android-x86
You are right, that's a better description. I guess there is one more commit to revert.
I'm wondering what's the root cause of these sdio issues.

Mauro Rossi

unread,
Dec 10, 2015, 7:32:04 AM12/10/15
to Android-x86
Basic questions, because I don't know how sdio Wi-Fi works,
is the sdio module loaded before last exit?

If not what happens issuing this command before last exit?

modprobe libertas_sdio

M.

Reply all
Reply to author
Forward
0 new messages