I'm working on wifi on eclair.
I found functions in libhardware_legacy/wifi/wifi.c is called in user
system. It tries to copy conf template to /data/misc/wifi/
wap_supplicant.conf, and chown to use wifi group system. but system
can not chown to wifi use, right?
And in init.rc, /data/misc/wifi is set to owner wifi group wifi.
wpa_supplicant uses setuid to switch to use wifi, but it always report
it don't have permission to read wpa_supplicant.conf.
Thanks
Richard
Currently, my /data/misc/wifi is 0770 wifi:wifi, is it correct?
"cat /proc/pid/status" shows system_server is in 1010(wifi) group.
But it always fails at
libhardware_legacy/wifi.c:
int ensure_config_file_exists()
{
char buf[2048];
int srcfd, destfd;
int nread;
if (access(SUPP_CONFIG_FILE, R_OK|W_OK) == 0) {
return 0;
} else if (errno != ENOENT) {
LOGE("Cannot access \"%s\": %s", SUPP_CONFIG_FILE,
strerror(errno)); //fail here
return -1;
}
Do you have any clue?
Thanks
Richard
That sounds right to me. On my Nexus One I have:
/data/misc/wifi:
drwxrwx--- wifi wifi 2010-02-19 19:29 wifi
/data/misc/wifi/wpa_supplicant.conf:
-rw-rw---- system wifi 254 2010-02-21 09:13 wpa_supplicant.conf
So both the system server and wpa_supplicant can read and write the
wpa_supplicant.conf file, and create the file if it does not exist.
When the system starts for the first time, a default
wpa_supplicant.conf file is copied from
/system/etc/wifi/wpa_supplicant.conf. Maybe you are seeing an error
message when the phone starts for the first time and the file has not
been copied yet?
Mike
--
Mike Lockwood
Google android team
Is Nexus using hardware/libhardware_legacy/wifi/wifi.c?
Thanks
Richard
Mike
It's caused by nfs. If I use a sd card with ext3 fs, it won't have the problem.
Thanks
Richard