Remove ni file before RO app AOTC (#570) accepted/tizen/8.0/unified/20240718.144430
author조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Wed, 17 Jul 2024 23:41:16 +0000 (08:41 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Thu, 18 Jul 2024 00:11:32 +0000 (09:11 +0900)
* 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
packaging/715.dotnet_regen_app_ni.patch.sh

index ecfeee20f14e871bd26374b5320f835d11f9203a..96247a896b11b2a0c11dfd640bb92905e782dae4 100644 (file)
@@ -1059,6 +1059,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;
index c87705815338867c55c98db43927f5f2bce3c2ff..12496a9556c24277843646d52308f0e8658a0200 100644 (file)
@@ -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