From 3f3db1d8054d4f8eb32a74de2b870e1820fa95c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=A1=B0=EC=9B=85=EC=84=9D/MDE=20Lab=28SR=29/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 18 Jul 2024 08:41:16 +0900 Subject: [PATCH] Remove ni file before RO app AOTC (#570) * Remove ni file before RO app AOTC If AOTC is performed for a RO app, a native image file will be generated under /opt/usr/dotnet/apps. During OTN, pkg_upgrade may trigger AOTC again for the RO application. In this case, it is necessary to remove the previously created file and create a new one. * Remove RO app ni files under /opt/usr/dotnet/apps Recreated NI files of RO app, should be removed at FOTA/OTN --- NativeLauncher/tool/ni_common.cc | 4 ++++ packaging/715.dotnet_regen_app_ni.patch.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index 9a2e0c5..36e39cb 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -1090,6 +1090,10 @@ ni_error_e createNIUnderPkgRoot(const std::string& pkgId, NIOption* opt) if (isReadOnlyArea(rootPath)) { opt->flags |= NI_FLAGS_APP_UNDER_RO_AREA; opt->flags |= NI_FLAGS_NO_PIPELINE; + std::string tmpPath = replaceAll(rootPath, getBaseName(rootPath), __READ_ONLY_APP_UPDATE_DIR); + if (!removeAll(tmpPath)){ + _SERR("Fail to remove RO App update path : %s", tmpPath.c_str()); + } _SERR("Only no-pipeline mode supported for RO app. Set no-pipeline option forcibly"); } else { opt->flags &= ~NI_FLAGS_APP_UNDER_RO_AREA; diff --git a/packaging/715.dotnet_regen_app_ni.patch.sh b/packaging/715.dotnet_regen_app_ni.patch.sh index c877058..12496a9 100644 --- a/packaging/715.dotnet_regen_app_ni.patch.sh +++ b/packaging/715.dotnet_regen_app_ni.patch.sh @@ -4,6 +4,9 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin +# remove application native image files of RO app +rm -rf /opt/usr/dotnet/apps/* + /usr/bin/dotnettool --tac-regen-all /usr/bin/dotnettool --ni-regen-all-app --skip-ro-app /usr/bin/dotnettool --resolve-all-app -- 2.7.4