ExtendedAndroidTools icon indicating copy to clipboard operation
ExtendedAndroidTools copied to clipboard

Enabling touchscreen and wifi modules of pixel3a by default

Open yanivagman opened this issue 5 years ago • 3 comments

Hi,

I'm so glad I found this repo, as I wanted to experiment running bpf code on a pixel3a phone I have, and didn't know how to port the bpf code to 4.9.

I understand that touchscreen and wifi are kernel modules in pixel3a, which require the use of adb and remounting to copy the updated modules (every time phone is restarted?) but if I change: CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_CORE_v27=m CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI_DEV_v27=m CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_v27=m CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_TEST_REPORTING_v27=m

in bonito_defconfig to 'y', touchscreen is now enabled without the need for a kernel module!

so I wanted to ask:

  1. Is there a reason not to change this from 'm' to 'y'?
  2. Wifi code is available out of tree in google sources - do you think it should be easy to put it in the kernel sources and also compile it with the kernel? I tried to do that and failed :-(

Thanks, Yaniv

yanivagman avatar Oct 01 '20 15:10 yanivagman

Hi,

This is a great suggestion, thanks. Having to update modules manually is a pain. I don't know how to build the wifi driver not as a standalone module, but I'll look around.

From my experience it's enough to copy modules once and then the files stay there in the vendor partition, even if I restart the phone. Is that not the case for you ?

michalgr avatar Oct 01 '20 18:10 michalgr

Hi,

The thing is that I'm trying to avoid compiling a user-debug android image, and only use fastboot to boot to the compiled kernel. Using android production build, I can't remount the vendor partition, so I'm trying to workaround this by compiling the modules directly to the kernel image.

I can see in the pixel 3a wifi sources path 'android-kernel/private/msm-google-modules/wlan/qcacld-3.0' that it already has Kconfig, Kbuild, and Android.mk - so I'm sure it should be possible to compile it as part of the kernel image.

I also see in: https://android.googlesource.com/kernel/msm/+/android-msm-wahoo-4.4-oreo-m4/drivers/staging/qcacld-3.0 that this driver was part of the 'drivers/staging' in the past - not sure why the decided to put it as a module. I tried to put it in the same directory and add its configs, but the build failed (I don't remember the exact reason).

If you'll have any other ideas for how to do this, I'll really appreciate it.

I have another question, if you don't mind. BCC fails to find the kernel headers - do you know how can I tell it where to find them?

modprobe: chdir '/lib/modules/4.9.165-01459-ge33b0b6ac10b': No such file or directory
Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version.
chdir(/lib/modules/4.9.165-01459-ge33b0b6ac10b/build): No such file or directory

Thanks, Yaniv

yanivagman avatar Oct 01 '20 20:10 yanivagman

You can point BCC and bpftrace to the right directory by setting these env variables:

michalgr avatar Oct 01 '20 22:10 michalgr