diff options
author | Brian Swetland <swetland@google.com> | 2010-09-19 03:49:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-19 03:49:43 -0700 |
commit | 3b5214a67f43e2e4f69428e98d3a2c130c7c87d8 (patch) | |
tree | e8e91a8942a7a26bf063734b93e77e1aa1d0aa3a /init | |
parent | 06b21887e8f5719e9b421371b4a47ef371c972b5 (diff) | |
parent | 02863b957cfbfc302d3136ed78c0cba86accacd8 (diff) | |
download | system_core-3b5214a67f43e2e4f69428e98d3a2c130c7c87d8.zip system_core-3b5214a67f43e2e4f69428e98d3a2c130c7c87d8.tar.gz system_core-3b5214a67f43e2e4f69428e98d3a2c130c7c87d8.tar.bz2 |
am 02863b95: add /vendor support
Merge commit '02863b957cfbfc302d3136ed78c0cba86accacd8' into gingerbread-plus-aosp
* commit '02863b957cfbfc302d3136ed78c0cba86accacd8':
add /vendor support
Diffstat (limited to 'init')
-rw-r--r-- | init/devices.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/init/devices.c b/init/devices.c index d7aa3a6..8e12a97 100644 --- a/init/devices.c +++ b/init/devices.c @@ -39,7 +39,8 @@ #include "list.h" #define SYSFS_PREFIX "/sys" -#define FIRMWARE_DIR "/etc/firmware" +#define FIRMWARE_DIR1 "/etc/firmware" +#define FIRMWARE_DIR2 "/vendor/firmware" static int device_fd = -1; @@ -480,7 +481,7 @@ out: static void process_firmware_event(struct uevent *uevent) { - char *root, *loading, *data, *file; + char *root, *loading, *data, *file1 = NULL, *file2 = NULL; int l, loading_fd, data_fd, fw_fd; log_event_print("firmware event { '%s', '%s' }\n", @@ -498,7 +499,11 @@ static void process_firmware_event(struct uevent *uevent) if (l == -1) goto loading_free_out; - l = asprintf(&file, FIRMWARE_DIR"/%s", uevent->firmware); + l = asprintf(&file1, FIRMWARE_DIR1"/%s", uevent->firmware); + if (l == -1) + goto data_free_out; + + l = asprintf(&file2, FIRMWARE_DIR2"/%s", uevent->firmware); if (l == -1) goto data_free_out; @@ -510,14 +515,17 @@ static void process_firmware_event(struct uevent *uevent) if(data_fd < 0) goto loading_close_out; - fw_fd = open(file, O_RDONLY); - if(fw_fd < 0) - goto data_close_out; + fw_fd = open(file1, O_RDONLY); + if(fw_fd < 0) { + fw_fd = open(file2, O_RDONLY); + if(fw_fd < 0) + goto data_close_out; + } if(!load_firmware(fw_fd, loading_fd, data_fd)) - log_event_print("firmware copy success { '%s', '%s' }\n", root, file); + log_event_print("firmware copy success { '%s', '%s' }\n", root, uevent->firmware); else - log_event_print("firmware copy failure { '%s', '%s' }\n", root, file); + log_event_print("firmware copy failure { '%s', '%s' }\n", root, uevent->firmware); close(fw_fd); data_close_out: @@ -525,7 +533,8 @@ data_close_out: loading_close_out: close(loading_fd); file_free_out: - free(file); + free(file1); + free(file2); data_free_out: free(data); loading_free_out: |