diff options
author | Kazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp> | 2016-09-22 17:03:20 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp> | 2016-09-22 17:27:32 +0900 |
commit | 4e5d35db8a03eed001d526be639acb28f39a32b9 (patch) | |
tree | ac2e2cca1b217269818f5ec97f55be145c1b9713 /meta-application-manager/recipes-application-framework/ail | |
parent | aea89641252aef91c77309a07b2373a0dfe145b6 (diff) |
Bug fix:Fail to remove db-journal file
* Bug fix
In AGL distribution, there are no db-journal file for pkgmgr_* and app_info
in /usr/dbspace because sqlite3 maybe delete them.
If journal files doesn't exist, creating DB fails and desktop files are not created.
So, this commit change not to remove db-journal file if the files doesn't exist.
* Refactoring
Some recipe was refactored to enable patch from other layer.
* Remove unnecessary file
* Modify README
Add how to set up to enable global user to create surfaces.
Change-Id: Id73e9a840cf59e48641a0c53fbaa6d292d576ae2
Signed-off-by: Kazumasa Mitsunari <kazumasa_mitsunari_za@mail.toyota.co.jp>
Diffstat (limited to 'meta-application-manager/recipes-application-framework/ail')
-rw-r--r-- | meta-application-manager/recipes-application-framework/ail/ail.inc | 4 | ||||
-rw-r--r-- | meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch | 138 |
2 files changed, 141 insertions, 1 deletions
diff --git a/meta-application-manager/recipes-application-framework/ail/ail.inc b/meta-application-manager/recipes-application-framework/ail/ail.inc index f946869..c5b254d 100644 --- a/meta-application-manager/recipes-application-framework/ail/ail.inc +++ b/meta-application-manager/recipes-application-framework/ail/ail.inc @@ -4,7 +4,9 @@ SECTION = "Application Framework/Libraries" LICENSE = "Apache-2.0" PV = "0.2.80" -SRC_URI = "" +SRC_URI = " \ + file://ail_journal_perm_check.patch \ + " S = "${WORKDIR}/git" diff --git a/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch b/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch new file mode 100644 index 0000000..46ad215 --- /dev/null +++ b/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch @@ -0,0 +1,138 @@ +diff --git a/src/ail_db.c b/src/ail_db.c +index 462c545..5c6bb5e 100755 +--- a/src/ail_db.c ++++ b/src/ail_db.c +@@ -100,15 +100,19 @@ static int ail_db_change_perm(const char *db_file, uid_t uid) + ret = chown(files[i], uid, userinfo->pw_gid); + SET_SMACK_LABEL(files[i],uid) + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, uid, userinfo->pw_gid, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], uid, userinfo->pw_gid, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/ail_fota.c b/tool/src/ail_fota.c +index 20d17c5..c523588 100644 +--- a/tool/src/ail_fota.c ++++ b/tool/src/ail_fota.c +@@ -176,15 +176,19 @@ static int initdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], OWNER_ROOT, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/createdb.c b/tool/src/createdb.c +index f203c74..05d101d 100644 +--- a/tool/src/createdb.c ++++ b/tool/src/createdb.c +@@ -97,15 +97,19 @@ static int createdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +@@ -173,7 +177,6 @@ int main(int argc, char *argv[]) + _E(" %s is not removed",APP_INFO_DB_FILE); + if(remove(APP_INFO_DB_FILE_JOURNAL)) + _E(" %s is not removed",APP_INFO_DB_FILE_JOURNAL); +- return -1; + } + ret = setenv("AIL_INITDB", "1", 1); + _D("AIL_INITDB : %d", ret); +diff --git a/tool/src/initdb.c b/tool/src/initdb.c +index 75d5788..79df936 100755 +--- a/tool/src/initdb.c ++++ b/tool/src/initdb.c +@@ -174,15 +174,19 @@ static int initdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/syncdb.c b/tool/src/syncdb.c +index 247602b..1ba2490 100644 +--- a/tool/src/syncdb.c ++++ b/tool/src/syncdb.c +@@ -176,15 +176,19 @@ static int syncdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } |