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/pkgmgr | |
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/pkgmgr')
4 files changed, 122 insertions, 2 deletions
diff --git a/meta-application-manager/recipes-application-framework/pkgmgr/files/0002-pkgmgr-initdb.patch b/meta-application-manager/recipes-application-framework/pkgmgr/files/0002-pkgmgr-initdb.patch new file mode 100644 index 0000000..6dfa9e6 --- /dev/null +++ b/meta-application-manager/recipes-application-framework/pkgmgr/files/0002-pkgmgr-initdb.patch @@ -0,0 +1,65 @@ +--- a/tool/pkg_createdb.c ++++ b/tool/pkg_createdb.c +@@ -261,15 +261,21 @@ + 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, GLOBAL_USER, OWNER_ROOT, buf); ++ //_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf); + return -1; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 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", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return -1; + } + } +@@ -357,7 +363,10 @@ + return -1; + } + +- setuid(OWNER_ROOT); ++ ret=setuid(OWNER_ROOT); ++ if(ret!=0){ ++ printf("@%d__setuid err = %d\n",__LINE__,errno); ++ } + ret = createdb_change_perm(PACKAGE_INFO_DB_FILE); + if (ret == -1) { + _E("cannot chown."); + +--- a/tool/pkg_initdb.c ++++ b/tool/pkg_initdb.c +@@ -208,15 +208,21 @@ + 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, GLOBAL_USER, OWNER_ROOT, buf); ++ //_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf); + return -1; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 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", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return -1; + } + } diff --git a/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch b/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch new file mode 100644 index 0000000..4773426 --- /dev/null +++ b/meta-application-manager/recipes-application-framework/pkgmgr/files/pkgmgr-journaldb.patch @@ -0,0 +1,52 @@ +diff --git a/tool/pkg_createdb.c b/tool/pkg_createdb.c +--- a/tool/pkg_createdb.c ++++ b/tool/pkg_createdb.c +@@ -261,15 +261,21 @@ + 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, GLOBAL_USER, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf); + return -1; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 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 -1; + } + } + +--- a/tool/pkg_initdb.c ++++ b/tool/pkg_initdb.c +@@ -208,15 +208,21 @@ + 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, GLOBAL_USER, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf); + return -1; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 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 -1; + } + } + + diff --git a/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr.inc b/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr.inc index 144d882..19035ec 100644 --- a/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr.inc +++ b/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr.inc @@ -5,7 +5,11 @@ LICENSE = "Apache-2.0" PV = "0.2.89" PR = "r1" -SRC_URI = " file://0001-remove-TizenConfig.patch " +SRC_URI = " \ + file://0001_change-tzglobalapp-to-aglglobalapp.patch \ + file://0001-remove-TizenConfig.patch \ + file://0002-pkgmgr-initdb.patch \ + " S = "${WORKDIR}/git" diff --git a/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr_%.bbappend b/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr_%.bbappend deleted file mode 100644 index 1d47580..0000000 --- a/meta-application-manager/recipes-application-framework/pkgmgr/pkgmgr_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -SRC_URI += "file://0001_change-tzglobalapp-to-aglglobalapp.patch" |