mirror of
https://github.com/linux-msm/tqftpserv.git
synced 2024-11-23 10:03:25 +08:00
translate: lookup firmware files under /lib/firmware/updates
`/lib/firmware/updates` is a legitimate location for firmware files, `tqftpserv` should look there as well.
This commit is contained in:
parent
48e143d273
commit
4744c0ce07
11
translate.c
11
translate.c
@ -24,6 +24,7 @@
|
|||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
#define FIRMWARE_BASE "/lib/firmware/"
|
#define FIRMWARE_BASE "/lib/firmware/"
|
||||||
#define TQFTPSERV_TMP "/tmp/tqftpserv"
|
#define TQFTPSERV_TMP "/tmp/tqftpserv"
|
||||||
|
#define UPDATES_DIR "updates/"
|
||||||
#else
|
#else
|
||||||
#define FIRMWARE_BASE "/vendor/firmware/"
|
#define FIRMWARE_BASE "/vendor/firmware/"
|
||||||
#define TQFTPSERV_TMP "/data/vendor/tmp/tqftpserv"
|
#define TQFTPSERV_TMP "/data/vendor/tmp/tqftpserv"
|
||||||
@ -129,17 +130,25 @@ static int translate_readonly(const char *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now try with base path */
|
/* now try with base path */
|
||||||
if (strlen(FIRMWARE_BASE) + strlen(firmware_value) + 1 +
|
if (strlen(FIRMWARE_BASE) + strlen(UPDATES_DIR) + strlen(firmware_value) + 1 +
|
||||||
strlen(file) + 1 > sizeof(path))
|
strlen(file) + 1 > sizeof(path))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strcpy(path, FIRMWARE_BASE);
|
strcpy(path, FIRMWARE_BASE);
|
||||||
|
strcat(path, UPDATES_DIR);
|
||||||
strcat(path, firmware_path);
|
strcat(path, firmware_path);
|
||||||
strcat(path, "/");
|
strcat(path, "/");
|
||||||
strcat(path, file);
|
strcat(path, file);
|
||||||
|
|
||||||
fd = open_maybe_compressed(path);
|
fd = open_maybe_compressed(path);
|
||||||
|
if (fd < 0) {
|
||||||
|
strcpy(path, FIRMWARE_BASE);
|
||||||
|
strcat(path, firmware_path);
|
||||||
|
strcat(path, "/");
|
||||||
|
strcat(path, file);
|
||||||
|
|
||||||
|
fd = open_maybe_compressed(path);
|
||||||
|
}
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user