Adding a kernel module for USB wifi adapter
-
It does not like that
.configfile being there.Using /root/ubp-5.1/kernel/lge/hammerhead as source for kernel /root/ubp-5.1/kernel/lge/hammerhead is not clean, please run 'make mrproper' in the '/root/ubp-5.1/kernel/lge/hammerhead' directory. Copy: /root/ubp-5.1/out/target/product/hammerhead/system/etc/audio_policy.conf Copy xml: /root/ubp-5.1/out/target/product/hammerhead/system/etc/mixer_paths.xml /root/ubp-5.1/kernel/lge/hammerhead/Makefile:976: recipe for target 'prepare3' failed make[2]: *** [prepare3] Error 1 Makefile:130: recipe for target 'sub-make' failed make[1]: *** [sub-make] Error 2 make[1]: Leaving directory '/root/ubp-5.1/kernel/lge/hammerhead' Copy xml: /root/ubp-5.1/out/target/product/hammerhead/system/etc/media_codecs_google_audio.xml build/core/tasks/kernel.mk:277: recipe for target 'TARGET_KERNEL_BINARIES' failedAs further evidenced by what running the command it wants does:
root@ubports:~/ubp-5.1/kernel/lge/hammerhead# make mrproper CLEAN scripts/basic CLEAN scripts/kconfig CLEAN include/config CLEAN .configBut that file is supposed to be there, and I am doing this correctly, according to this article on kernel configuration.
-
This time I used the
make_defconfig.shscript inhammerhead/instead ofmake ARCH=arm menuconfig. This script wants a config file fromarch/arm/configs/to edit. The problem is that there are 3 different configs for hammerhead:- cyanogenmod_hammerhead_defconfig
- hammerhead_defconfig
tct_hammer_defconfig(I guess this one says "hammer", not "hammerhead")
When I do
uname -aon my Nexus, it sayscyanogenmodin there, so I picked that one. Building now. -
Build was successful. Still no driver in the output though.
root@ubports:~/ubp-5.1/out/target/product/hammerhead# find . |grep -i mt76 root@ubports:~/ubp-5.1/out/target/product/hammerhead# find . |grep -i mediatek ./obj/KERNEL_OBJ/include/config/wlan/vendor/mediatek.h root@ubports:~/ubp-5.1/out/target/product/hammerhead# cat ./obj/KERNEL_OBJ/include/config/wlan/vendor/mediatek.h root@ubports:~/ubp-5.1/out/target/product/hammerhead# -
This time I did
./make_defconfig.sh hammerhead_defconfig. Note how the changes made to the cyanogenmod file remain despitemake cleanandmake mrproper:modified: arch/arm/configs/cyanogenmod_hammerhead_defconfig modified: arch/arm/configs/hammerhead_defconfigAnother potentially relevant thing I noticed: In the configuration menu provided by
make_defconfig.sh, only a Mediatek group is shown. There is no entry for themt7601u. This was not the case when I usedmake ARCH=arm menuconfig. Perhaps an indication of a configuration issue that is causing the driver to not be detected? But then why was it detected in the other case? Assuming this build fails to produce the desired result, I will investigate this next. -
I assumed correctly. Here is the section referencing Mediatek in the
.configthatmake_defconfig.shwould generate:CONFIG_WLAN_VENDOR_MEDIATEK=yCompare the Broadcom (I think) drivers section:
CONFIG_BCMDHD=y CONFIG_BCM4339=y CONFIG_BCMDHD_FW_PATH="/vendor/firmware/fw_bcmdhd.bin" CONFIG_BCMDHD_NVRAM_PATH="/etc/wifi/bcmdhd.cal"And the Mediatek section in a
.configI generated withmake ARCH=arm menuconfig:CONFIG_WLAN_VENDOR_MEDIATEK=y CONFIG_MT7601U=mI'll try to simply manually add these two lines to
hammerhead_defconfigandcyanogenmod_hammerhead_defconfigfor the next build. -
Found this in the
mt7601u'sKconfig:depends on MAC80211 depends on USBmac80211is something that can be selected in the config menu in Networking support → Wireless. It is not selected by default. When you select it, themt7601udriver appears in the Mediatek wireless driver section of the menu as it should.I edited both
hammerhead_defconfigandcyanogenmod_hammerhead_defconfiglike this (usingmake_defconfig.shof course). Building again. -
Build finished. Seemingly no change. Maybe
out/is supposed to be like this. Will flash tomorrow and check. -
Flashed and checked with
lsmod,modinfoandfind. It looks like, despite everything, the module was still not installed. -
device/lge/hammerhead/BoardConfig.mkconfirms that the configuration file I've been working with is the right one:# Define kernel config for inline building TARGET_KERNEL_CONFIG := cyanogenmod_hammerhead_defconfig TARGET_KERNEL_SOURCE := kernel/lge/hammerheaddevice/lge/hammerhead/init.hammerhead.rchas something that could be relevant:# wifi chown wifi system /persist/wifi insmod /system/lib/modules/bcmdhd.koI'll add another
insmodline formt7601uand see what happens. My guess is it will either break something or do nothing. -
I tried
mkap, which failed to push anything to the device, but it did create./out/target/product/hammerhead/obj/KERNEL_OBJ/include/config/mt7601u.h. I also noticed that all the.hfiles inobj/KERNEL_OBJ/include/config/are empty.Flashed, replaced system image, no change.
-
I am literally unable to tell you what happened next, because all my posts are being flagged as spam.
-
@zehkira maybe because of external links. Happens sometimes.
-
I'm out of ideas.
-
@zehkira I congratulate you on your remarkable persistence, even though I have little understanding of what you have been doing.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login