How to add driver souces to android-x86 source code

1,451 views
Skip to first unread message

Dmitriy Krivtsov

unread,
Oct 28, 2018, 8:08:01 AM10/28/18
to Android-x86
The stock driver did not work, so I've replaced stock firmware for rtl8723bu WIFI. It helped to make it work partially - wifi did connect on initial boot, but after sleep or if it's manually disabled, it does not connect to APs anymore (untill reboot).
So I did get source code for rtl8723bu from github, but i have no idea how to add it to the android source.
Can anyone help me with this, or link me to any decent manual?

Mauro Rossi

unread,
Oct 28, 2018, 3:32:52 PM10/28/18
to Android-x86
Hi,
it has not been ever tested, but the two commits add the driver to kernel are here (the two top ones):


and they should apply to kernel 4.18 of oreo-x86 by doing the following:

cd kernel
git remote add maurossi https://github.com/maurossi/linux
git fetch maurossi kernel-4.18
git cherry-pick f0fc08808e24b16a9f0263768557963449ca8b5d
git cherry-pick b71d45c75b4656f510cb7f51d205bd6fefc4c1e2

Then you'll need to add CONFIG_RTL8723BU in arch/x86/configs/android-x86_64_defconfig and android-x86_defconfig,
rebuild image with kernel and also check that the new module is loaded instead of the previous one.

Mauro

Christian

unread,
Oct 30, 2018, 1:24:09 AM10/30/18
to Android-x86
I tried it does not work.

Dmitriy Krivtsov

unread,
Oct 30, 2018, 3:00:07 PM10/30/18
to Android-x86
Hello, thanks for the reply.
I've added those commits successfully, but I'm getiing an error when building:
FAILED: /home/arteee/android-x86/out/target/product/x86_64/obj/kernel/.config
/bin/bash -c "(mkdir -p /home/arteee/android-x86/out/target/product/x86_64/obj/kernel && cat kernel/arch/x86/configs/android-x86_64_defconfig device/generic/common/selinux_diffconfig > /home/arteee/android-x86/out/target/product/x86_64/obj/kernel/.config ) && (ln -sf ../../../../../../external /home/arteee/android-x86/out/target/product/x86_64/obj/kernel ) && (make -j4 -j\$(nproc) -l\$((\$(nproc)+2)) -C kernel O=/home/arteee/android-x86/out/target/product/x86_64/obj/kernel ARCH=x86_64 CROSS_COMPILE=\" /home/arteee/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-\"  YACC=/home/arteee/android-x86/prebuilts/misc/linux-x86/bison/bison LEX=/home/arteee/android-x86/prebuilts/misc/linux-x86/flex/flex-2.5.39  olddefconfig )"


The string I've added was
CONFIG_RTL8723BU=m
(like other wifi cards are listed there)
to the end of android-x86/kernel/arch/x86/configs/android-x86_64_defconfig and android-x86_defconfig


воскресенье, 28 октября 2018 г., 22:32:52 UTC+3 пользователь Mauro Rossi написал:

Mauro Rossi

unread,
Oct 30, 2018, 5:06:41 PM10/30/18
to Android-x86
Hi,


On Tuesday, October 30, 2018 at 8:00:07 PM UTC+1, Dmitriy Krivtsov wrote:
Hello, thanks for the reply.
I've added those commits successfully, but I'm getiing an error when building:
FAILED: /home/arteee/android-x86/out/target/product/x86_64/obj/kernel/.config
/bin/bash -c "(mkdir -p /home/arteee/android-x86/out/target/product/x86_64/obj/kernel && cat kernel/arch/x86/configs/android-x86_64_defconfig device/generic/common/selinux_diffconfig > /home/arteee/android-x86/out/target/product/x86_64/obj/kernel/.config ) && (ln -sf ../../../../../../external /home/arteee/android-x86/out/target/product/x86_64/obj/kernel ) && (make -j4 -j\$(nproc) -l\$((\$(nproc)+2)) -C kernel O=/home/arteee/android-x86/out/target/product/x86_64/obj/kernel ARCH=x86_64 CROSS_COMPILE=\" /home/arteee/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-\"  YACC=/home/arteee/android-x86/prebuilts/misc/linux-x86/bison/bison LEX=/home/arteee/android-x86/prebuilts/misc/linux-x86/flex/flex-2.5.39  olddefconfig )"


I don't get this error, the reason may be I usually use the following commands, where 4180_64_defconfig is the modified defconfig file:

lunch android_x86_64-eng && make -j4 iso_img TARGET_KERNEL_CONFIG=4180_64_defconfig

Alternatively you could try:

cd /home/arteee/android-x86/out/target/product/x86_64/obj/kernel/
make oldconfig

and then try to rebuild.
Mauro

Christian

unread,
Oct 31, 2018, 8:09:00 AM10/31/18
to Android-x86
HOW TO PATCH ???

I enter to Terminal:

$ su > (My Passwort)
than > cd Kernel // Answer back "Not found".

What do i Wrong???

DDS Central

unread,
Oct 31, 2018, 9:24:09 AM10/31/18
to andro...@googlegroups.com
It's called "kernel", not "Kernel". In Linux, filenames are case sensitive.
Also, please refrain from posting in such a large font, it looks like you are screaming.

--
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 https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

Christian

unread,
Oct 31, 2018, 10:12:39 AM10/31/18
to Android-x86
Yes because i need a solution

Christian

unread,
Oct 31, 2018, 11:30:34 AM10/31/18
to Android-x86
even if I write kernel small, that does not work.


Am Mittwoch, 31. Oktober 2018 14:24:09 UTC+1 schrieb Povilas Staniulis:

DDS Central

unread,
Oct 31, 2018, 11:38:06 AM10/31/18
to andro...@googlegroups.com
cd to directory with Android x86 source code. There will be a directory called  "kernel". From there you can configure and build the Linux kernel. Android x86 defconfig files are located IIRC in arch/x86/configs.

Christian

unread,
Oct 31, 2018, 1:02:02 PM10/31/18
to Android-x86
x86_64:/ $ su
255|x86_64:/ $ cd kernel
/system/bin/sh: cd: /kernel: No such file or directory
2|x86_64:/ $

Mauro Rossi

unread,
Oct 31, 2018, 7:28:16 PM10/31/18
to Android-x86


On Wednesday, October 31, 2018 at 4:30:34 PM UTC+1, Christian wrote:
even if I write kernel small, that does not work.

Please Christian, calm down or you will miss even obvious things
 

Am Mittwoch, 31. Oktober 2018 14:24:09 UTC+1 schrieb Povilas Staniulis:
It's called "kernel", not "Kernel". In Linux, filenames are case sensitive.
Also, please refrain from posting in such a large font, it looks like you are screaming.

On Wed, Oct 31, 2018, 14:09 'Christian' via Android-x86 <andro...@googlegroups.com wrote:
HOW TO PATCH ???

The commands are in the previous post, you  need:

- oreo-x86 source (instructions on how to get it are in android-x86 web page)
- build system with all packages installed as described in AOSP web site (libssl-dev
- git software to apply the patches

kernel folder becomes available getting oreo-x86 sources

 

I enter to Terminal:

$ su > (My Passwort)

su is not needed
 
than > cd Kernel // Answer back "Not found".

What do i Wrong???


Looking at your messages it seams you are trying the commands in android-x86 installation,
while it may be common to build kernel and modules in a Linux distro, 
in android the kernel and modules need to be built on a separate build system.
Mauro

Christian

unread,
Nov 1, 2018, 12:18:20 AM11/1/18
to Android-x86
I have asked this more often and never got an answer that is really helpful. you are all seemingly programmers who know how to do it, but you do not want to share it.

no master has fallen from the sky yet.

Christian

unread,
Nov 1, 2018, 1:20:16 AM11/1/18
to Android-x86
can someone please give me the finished commands to the patch on kernel 4.19

Many Thanks

Am Sonntag, 28. Oktober 2018 13:08:01 UTC+1 schrieb Dmitriy Krivtsov:

Mauro Rossi

unread,
Nov 1, 2018, 8:52:02 AM11/1/18
to Android-x86
Hi,


On Thursday, November 1, 2018 at 6:20:16 AM UTC+1, Christian wrote:
can someone please give me the finished commands to the patch on kernel 4.19

Many Thanks

Ok, first thing you need to start from an android-x86 enabled kernel,
but in case you are in "don't know what you are doing" stage (like we all were at some point, of course)
then as a suggestion (the do what you want...as you are in charge of yourself, not us)
try the kernel-4.18 branch that comes with android-x86 project

cd [source of android-x86 you have repo init and repo synced as per android-x86 web page]
cd kernel
git fetch x86 kernel
-4.18
git checkout FETCH_HEAD
git remote add maurossi
https://github.com/maurossi/linux

git fetch maurossi kernel
-4.18
git cherry
-pick f0fc08808e24b16a9f0263768557963449ca8b5d
git cherry
-pick b71d45c75b4656f510cb7f51d205bd6fefc4c1e2

If you want kernel-4.19 you could just checkout the following, as rtl8723bu driver is been my branches,
but as I said I never tested it, just updated the driver from the manainers github repo

cd [source of android-x86 you have repo init and repo synced as per android-x86 web page]

cd kernel
git remote add maurossi
https://github.com/maurossi/linux

git fetch maurossi kernel
-4.19
git checkout FETCH_HEAD

Since you asked how to patch kernel, you are served, you're welcome.
Mauro

Christian

unread,
Nov 1, 2018, 9:08:13 AM11/1/18
to Android-x86
@Mauro THANKS!!

But what is meant with "cd [source of android-x86 you have repo init and repo synced as per android-x86 web page]" 

example??? i using Android-x86 8.1-rc2 (Oreo-x86) (2018/10/18)

DDS Central

unread,
Nov 1, 2018, 9:35:30 AM11/1/18
to andro...@googlegroups.com

Dmitriy Krivtsov

unread,
Nov 1, 2018, 10:51:16 AM11/1/18
to Android-x86
Hi, neither of those commands worked - imported files from git cherry-pick have broken frormatting because of some github's text (idk what is it) insterted to random lines, it refused to build as-is.

Didnt want to check every file for broken structure, so ive done this:
1) redownloaded repo and placed driver source manually to android-x86/kernel/drivers/net/wireless/realtek/rtl8723bu
2) modified Kconfig and Makefile at android-x86/kernel/drivers/net/wireless/realtek  to include it.
3) added CONFIG_RTL8723BU=m to android-x86/kernel/arch/x86/configs/android-x86_64_defconfig and android-x86_defconfig
4) commented out (#) RTL8723BU-related stuff in drivers/staging/Kconfig and Makefile.
So far its building (finally).

среда, 31 октября 2018 г., 0:06:41 UTC+3 пользователь Mauro Rossi написал:

Dmitriy Krivtsov

unread,
Nov 13, 2018, 3:13:05 AM11/13/18
to Android-x86
Update: iso did build without any errors.
After boot driver module is being loaded (8723bu.ko) but wifi still has the same problem.

четверг, 1 ноября 2018 г., 17:51:16 UTC+3 пользователь Dmitriy Krivtsov написал:

Mauro Rossi

unread,
Nov 13, 2018, 3:45:29 PM11/13/18
to Android-x86


On Thursday, November 1, 2018 at 3:51:16 PM UTC+1, Dmitriy Krivtsov wrote:
Hi, neither of those commands worked - imported files from git cherry-pick have broken frormatting because of some github's text (idk what is it) insterted to random lines, it refused to build as-is.

Didnt want to check every file for broken structure, so ive done this:
1) redownloaded repo and placed driver source manually to android-x86/kernel/drivers/net/wireless/realtek/rtl8723bu
2) modified Kconfig and Makefile at android-x86/kernel/drivers/net/wireless/realtek  to include it.
3) added CONFIG_RTL8723BU=m to android-x86/kernel/arch/x86/configs/android-x86_64_defconfig and android-x86_defconfig
4) commented out (#) RTL8723BU-related stuff in drivers/staging/Kconfig and Makefile.

This step 4) is not necessary and it could cause problems itself
As additional info the driver has been updated for kernel-4.19 and kernel-4.20 API changes, so try with updated code

If you come to identify a problem with driver, you know who you should contact,
not the driver users, but the driver mantainer

Kind regards

Mauro

chalesyu

unread,
Dec 3, 2018, 9:26:11 PM12/3/18
to Android-x86
you can try this source to see if wifi problem exist
https://github.com/ChalesYu/rtl8723bu
good luck

chalesyu

unread,
Dec 3, 2018, 11:22:42 PM12/3/18
to Android-x86

Christian

unread,
Dec 4, 2018, 4:00:32 AM12/4/18
to Android-x86
i dont know how to use git....   :-(


Am Sonntag, 28. Oktober 2018 13:08:01 UTC+1 schrieb Dmitriy Krivtsov:

chalesyu

unread,
Dec 4, 2018, 4:45:49 AM12/4/18
to Android-x86
git clone https://github.com/ulli-kroll/rtl8723bu
cd rtl8723bu

about other things, see README.md

Dmitriy Krivtsov

unread,
Dec 4, 2018, 4:51:30 AM12/4/18
to Android-x86
cd $home
git clone <repo aderss with .git in the end>

then do what i did with drivers earlier.


вторник, 4 декабря 2018 г., 12:00:32 UTC+3 пользователь Christian написал:

Antony Stone

unread,
Dec 4, 2018, 5:09:18 AM12/4/18
to andro...@googlegroups.com
On Tuesday 04 December 2018 at 10:51:29, Dmitriy Krivtsov wrote:

> cd $home

Just to be clear, that should be either "cd $HOME" or else "cd ~"
Antony.

--
What do you call a dinosaur with only one eye? A Doyouthinkesaurus.

Please reply to the list;
please *don't* CC me.
Message has been deleted

Christian

unread,
Dec 7, 2018, 2:14:00 AM12/7/18
to Android-x86

No matter what I try, it does not work.

x86_64:/ $ su
x86_64:/ # sudo
sh: sudo: not found
127|x86_64:/ # cd $HOME
x86_64:/ # cd kernel


sh: cd: /kernel: No such file or directory

2|x86_64:/ # su cd kernel
Unknown id: cd
1|x86_64:/ # git remote add maurossi https://github.com/maurossi/linux
sh: git: not found
127|x86_64:/ #

Dmitriy Krivtsov

unread,
Dec 7, 2018, 2:35:48 AM12/7/18
to Android-x86
You did it wrong.
There are 2 ways I can think of:
1) git clone rtl8723bu source to $HOME and move downloaded dir to your android-source-dir/kernel/drivers/net/wireless/realtek
2) just cd to that dir and git clone there

After that modify Makefile and kconfig in that dir to include it; and add CONFIG_RTL8723BU=m to android-x86_64_defconfig. And comment out existing driver in kernel/drivers/staging.

Chih-Wei Huang

unread,
Dec 7, 2018, 3:01:13 AM12/7/18
to Android-x86
'Christian' via Android-x86 <andro...@googlegroups.com> 於
2018年12月7日 週五 下午3:14寫道:
All of these should be carried out on
your Linux build host, not on
the android-x86 device.


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

youling 257

unread,
Dec 18, 2018, 5:27:07 AM12/18/18
to Android-x86
I find people test rtl8723bu v4.4.5 kernel, i test rtl8723bs v5.1.7 on 4.9 kernel, work nice when suspend/resume.
rtl8723bs v5.1.7 on 4.19 build problem.
https://github.com/khadas/android_hardware_wifi_realtek_drivers_8723bs/issues/1

在 2018年12月4日星期二 UTC+8下午5:45:49,chalesyu写道:
Reply all
Reply to author
Forward
0 new messages