diff options
author | Ed Heyl <ed@google.com> | 2012-07-28 11:48:12 -0700 |
---|---|---|
committer | Ed Heyl <ed@google.com> | 2012-07-28 11:48:12 -0700 |
commit | 3cac204d3537c6a356c922bffb07fcb97f5bb0c7 (patch) | |
tree | 710f7bb28670f8df39ab4529c52fce812b471129 /init | |
parent | ce8ffda06397f4a3f8c75f8e2c41f8883625e4f3 (diff) | |
parent | c2dcdc2024ac7487f9773b9b9a4d20bf78e5b7a1 (diff) | |
download | system_core-3cac204d3537c6a356c922bffb07fcb97f5bb0c7.zip system_core-3cac204d3537c6a356c922bffb07fcb97f5bb0c7.tar.gz system_core-3cac204d3537c6a356c922bffb07fcb97f5bb0c7.tar.bz2 |
Merge remote-tracking branch 'goog/jb-dev-mako' into jb-mr1-dev
Diffstat (limited to 'init')
-rw-r--r-- | init/devices.c | 30 | ||||
-rw-r--r-- | init/property_service.c | 1 |
2 files changed, 20 insertions, 11 deletions
diff --git a/init/devices.c b/init/devices.c index e081f90..ff6244a 100644 --- a/init/devices.c +++ b/init/devices.c @@ -50,6 +50,7 @@ #define SYSFS_PREFIX "/sys" #define FIRMWARE_DIR1 "/etc/firmware" #define FIRMWARE_DIR2 "/vendor/firmware" +#define FIRMWARE_DIR3 "/firmware/image" #ifdef HAVE_SELINUX static struct selabel_handle *sehandle; @@ -725,7 +726,7 @@ static int is_booting(void) static void process_firmware_event(struct uevent *uevent) { - char *root, *loading, *data, *file1 = NULL, *file2 = NULL; + char *root, *loading, *data, *file1 = NULL, *file2 = NULL, *file3 = NULL; int l, loading_fd, data_fd, fw_fd; int booting = is_booting(); @@ -752,6 +753,10 @@ static void process_firmware_event(struct uevent *uevent) if (l == -1) goto data_free_out; + l = asprintf(&file3, FIRMWARE_DIR3"/%s", uevent->firmware); + if (l == -1) + goto data_free_out; + loading_fd = open(loading, O_WRONLY); if(loading_fd < 0) goto file_free_out; @@ -765,17 +770,20 @@ try_loading_again: if(fw_fd < 0) { fw_fd = open(file2, O_RDONLY); if (fw_fd < 0) { - if (booting) { - /* If we're not fully booted, we may be missing - * filesystems needed for firmware, wait and retry. - */ - usleep(100000); - booting = is_booting(); - goto try_loading_again; + fw_fd = open(file3, O_RDONLY); + if (fw_fd < 0) { + if (booting) { + /* If we're not fully booted, we may be missing + * filesystems needed for firmware, wait and retry. + */ + usleep(100000); + booting = is_booting(); + goto try_loading_again; + } + INFO("firmware: could not open '%s' %d\n", uevent->firmware, errno); + write(loading_fd, "-1", 2); + goto data_close_out; } - INFO("firmware: could not open '%s' %d\n", uevent->firmware, errno); - write(loading_fd, "-1", 2); - goto data_close_out; } } diff --git a/init/property_service.c b/init/property_service.c index 79914cd..4ee86c0 100644 --- a/init/property_service.c +++ b/init/property_service.c @@ -76,6 +76,7 @@ struct { { "sys.", AID_SYSTEM, 0 }, { "service.", AID_SYSTEM, 0 }, { "wlan.", AID_SYSTEM, 0 }, + { "bluetooth.", AID_SYSTEM, 0 }, { "dhcp.", AID_SYSTEM, 0 }, { "dhcp.", AID_DHCP, 0 }, { "debug.", AID_SYSTEM, 0 }, |