This question can be marked as a duplicated of this "kernel module cannot find firmware file on Android device; where should it be?" but since I could not able to solve my issue I thought of posting the question.
I am working in Android LOllipop and my Kernel module, the wifi module 8192du.ko is copied to /system/lib/modules folder and the firmware rtl81992dufw.bin was copied to "/system/etc/firmware/rtlwifi/" as per the system/core/init/devices.c file.
But I am getting "E/WifiHW ( 161): Failed to open wlan fw path param (No such file or directory)" error.
int wifi_change_fw_path(const char *fwpath){
int len;
int fd;
int ret = 0;
if (!fwpath)
return ret;
fd = TEMP_FAILURE_RETRY(open(WIFI_DRIVER_FW_PATH_PARAM, O_WRONLY));
if (fd < 0) {
ALOGE("Failed to open wlan fw path param (%s)", strerror(errno));
return -1;
}
len = strlen(fwpath) + 1;
if (TEMP_FAILURE_RETRY(write(fd, fwpath, len)) != len) {
ALOGE("Failed to write wlan fw path param (%s)", strerror(errno));
ret = -1;
}
close(fd);
return ret;}
This is my wifi.c code and I have defined the WIFI_DRIVER_FW_PATH_PARAM macro as "/system/etc/firmware/rtlwifi/".
When I copy the firmware to /system/lib/firmware/rtlwifi/ path as per the driver Makefile in kernel, I am getting Read-only filesystem error.
Both the ways I am stuck up with the firmware path issue....Any help?