Compile Driver for Android (x86)

The following instructions cover the driver compiling process for BLUE bean on devices running Linux. We recommend using Debian or Ubuntu. It also might be possible to compile on OSX. Compiling directly on a Windows platform is not supported. However, if all you have available is a windows machine then we would recommend to set up a linux based virtual machine.

Android Oreo

1. Prepare build environment (for more details visit the official Android guide)

sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install dosfstools genisoimage bc libssl-dev python2.7 python-mako git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip

2. Install Repo:

mkdir ~/bin
curl > ~/bin/repo
chmod a+x ~/bin/repo

3. Checkout Android sources:

mkdir android-x86; cd android-x86
repo init -u git:// -b oreo-x86
repo sync -j$(nproc) --no-tags --no-clone-bundle

4. Prepare Android build:

sudo ln -s /sbin/mkdosfs /home/${USER}/bin/
. build/
lunch android_x86-eng

5. Edit line: 84 of file bootable/newinstaller/ (vi or vim editors recommended):

Find this line:

-no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot \

Replace line with:

-no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -eltorito-boot boot/grub/efi.img -no-emul-boot \

6. Build Android (long process, powerful system recommended):

m -j$(nproc) iso_img

7. Get the latest qcacld-2.0 sources from 8devices:

cd ..
git clone -b caf-wlan/LNX.LEH.
cd qcacld-2.0

8. Build QCA driver:

PATH=$ANDROID_BUILD_PATHS$PATH KERNEL_SRC=$ANDROID_BUILD_TOP/out/target/product/x86/obj/kernel/ ARCH=x86 CROSS_COMPILE=$ANDROID_TOOLCHAIN/x86_64-linux-android-  make wlan-usb -j$(nproc)

9. Edit Android sources to include blobs:


Change LOCAL_PATH variable accordingly to path of qca driver source folder and append to file:

# qcacld driver usb blobs:
    $(LOCAL_PATH)/firmware/usb/utf.bin:root/lib/firmware/utf.bin \
    $(LOCAL_PATH)/firmware/usb/athwlan.bin:root/lib/firmware/athwlan.bin \
    $(LOCAL_PATH)/firmware/usb/otp.bin:root/lib/firmware/otp.bin \
    $(LOCAL_PATH)/firmware/usb/fakeboar.bin:root/lib/firmware/fakeboar.bin \
    $(LOCAL_PATH)/firmware/usb/wlan/usb_qcom_cfg.ini:root/lib/firmware/wlan/usb_qcom_cfg.ini \
    $(LOCAL_PATH)/firmware/usb/wlan/usb_cfg.dat:root/lib/firmware/wlan/usb_cfg.dat \
    $(LOCAL_PATH)/firmware/usb/qca61x4.bin:root/lib/firmware/qca61x4.bin \
    $(LOCAL_PATH)/wlan-usb.ko:root/lib/modules/wlan-usb.ko \

10. Build Android image:

m -j$(nproc) iso_img

11. Upon finished build, your image android_x86.iso will be available at:

ls $ANDROID_BUILD_TOP/out/target/product/x86/

12. Once you have android installed, up and runnning, insert the module with:

insmod /lib/modules/wlan-usb.ko

More information here: