*available_flash_size = ((long long)vfs.f_bsize * (long long)vfs.f_bavail >= (long long)SIZE_4GB) ? SIZE_4GB : vfs.f_bsize * vfs.f_bavail;
if (*available_flash_size == 0) {
*available_flash_size = 0x80000; //Same as Legecy RB
- LOGE("available_flash_size=%u(vfs.f_bsize=%d vfs.f_bavail=%d\n",
- (unsigned int)*available_flash_size, (int)vfs.f_bsize, (int)vfs.f_bavail);
return 0; // Same as Legecy RB
}
return 0;
return SS_GetUpgradeState();
}
-/*!
- *********************************************************************************
- * SS_FSUpdatemain
- *********************************************************************************
- *
- * @brief
- * This is the API exposed from the engine to update FS.
- * FS entry function for updating FS partition. Should be invoked only after verification of the partition
- *
- *
- * @param Requires common data structure having all details & Partition Index.
- * (Used for getting right NODES information that built during verification)
- * (Configuration, Delta info, Partition Info, UI link , Kind of operation.(Verify or Updates))
- *
- * @return returns S_SS_SUCCESS
- * E_SS_FAILURE in case of error
- *
- *********************************************************************************
- */
-size_t SS_FSAvailiableFreeSpace(char *block_name)
-{
-
- struct mntent *ent;
- FILE *aFile;
- struct statfs sb;
- aFile = setmntent("/proc/mounts", "r");
- if (aFile == NULL) {
- LOGE("setmntent error\n");
- return E_SS_FAILURE;
- }
- while (NULL != (ent = getmntent(aFile))) {
- if (strcmp(ent->mnt_fsname, block_name) == 0) {
- if (statfs(ent->mnt_dir, &sb) == 0)
- LOGL(LOG_SSENGINE, "Total free space = %" PRIu64 ", blocks free = %" PRIu64 "\n", sb.f_bsize * sb.f_bavail, sb.f_bfree);
- }
- }
- endmntent(aFile);
- return ((long long)sb.f_bsize * (long long)sb.f_bavail >= (long long)SIZE_4GB) ? SIZE_4GB : sb.f_bsize * sb.f_bavail ;
-}
int SS_FSVerifyPartition(ua_dataSS_t * ua_dataSS)
{