From: Woongsuk Cho Date: Tue, 29 Mar 2022 22:34:50 +0000 (+0900) Subject: Add --skip-ro-app option X-Git-Tag: accepted/tizen/unified/20220501.223640~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c700b156c497c87eb2857f10fe4429302589b2c;p=platform%2Fcore%2Fdotnet%2Flauncher.git Add --skip-ro-app option The "--ni-regen-all-app" option performs AOTC again for all installed apps. If the "--ni-regen-all-app" option is performed after FOTA (OTN), an error may occur or unnecessary AOTC may be performed by running AOTC for an app installed in the RO area. To avoid this situation, the "--skip-ro-app" option is added. If this option is set, native image regenration for apps installed in the RO area is skipped. Note! this option works with "--ni-regen-all-app" option only. --- diff --git a/NativeLauncher/inc/ni_common.h b/NativeLauncher/inc/ni_common.h index ca53f72..cec0125 100644 --- a/NativeLauncher/inc/ni_common.h +++ b/NativeLauncher/inc/ni_common.h @@ -38,6 +38,7 @@ #define NI_FLAGS_NO_PIPELINE 0x0080 #define NI_FLAGS_MIBC 0x0100 #define NI_FLAGS_PRINT_CMD 0x0200 +#define NI_FLAGS_SKIP_RO_APP 0x0400 typedef std::function afterCreate; diff --git a/NativeLauncher/tool/dotnettool.cc b/NativeLauncher/tool/dotnettool.cc index 4ecba24..79334a5 100644 --- a/NativeLauncher/tool/dotnettool.cc +++ b/NativeLauncher/tool/dotnettool.cc @@ -64,6 +64,8 @@ void DisplayUsage() { " (If not set, default system paths are used.)\n" " --no-pipeline - Compile the dlls individually\n" " --print-cmd - Print command and options\n" + " --skip-ro-app - Skip re-generate NI for apps installed RO area\n" + " (This option works with --ni-regen-all-app only)\n" "\n" "Usage: dotnettool [options] [command] [arguments]\n" "\n" @@ -120,6 +122,8 @@ int main(int argc, char* argv[]) opt->flags |= NI_FLAGS_NO_PIPELINE; } else if (arg == "--print-cmd") { opt->flags |= NI_FLAGS_PRINT_CMD; + } else if (arg == "--skip-ro-app") { + opt->flags |= NI_FLAGS_SKIP_RO_APP; } else if (arg == "--ibc-dir") { ++i; if (i >= argc) { diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index ab93a46..199426f 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -682,6 +682,18 @@ static int appAotCb(pkgmgrinfo_appinfo_h handle, void *userData) int ret = 0; NIOption **pOptions = (NIOption**)userData; + if ((*pOptions)->flags & NI_FLAGS_SKIP_RO_APP) { + bool isSystem = false; + int ret = pkgmgrinfo_appinfo_is_system(handle, &isSystem); + if (ret != PMINFO_R_OK) { + _SERR("Failed to check that app is System or not\n"); + return -1; + } + if (isSystem) { + return 0; + } + } + ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgId); if (ret != PMINFO_R_OK) { _SERR("Failed to get pkgid"); diff --git a/packaging/715.dotnet_regen_app_ni.patch.sh b/packaging/715.dotnet_regen_app_ni.patch.sh index 1611395..fe3037c 100644 --- a/packaging/715.dotnet_regen_app_ni.patch.sh +++ b/packaging/715.dotnet_regen_app_ni.patch.sh @@ -5,6 +5,6 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin /usr/bin/dotnettool --tac-regen-all -/usr/bin/dotnettool --ni-regen-all-app +/usr/bin/dotnettool --ni-regen-all-app --skip-ro-app /usr/bin/dotnettool --resolve-all-app /usr/bin/dotnettool --rm-all-app-profile