add script to generate native image at mic (#232)
author조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Mon, 25 May 2020 07:51:04 +0000 (16:51 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Mon, 25 May 2020 07:51:04 +0000 (16:51 +0900)
resource/wearable-dotnet-generate-ni.high.post [new file with mode: 0644]
resource/wearable-dotnet-generate-ni.low.post [new file with mode: 0644]
resource/wearable-dotnet-generate-ni.middle.post [new file with mode: 0644]

diff --git a/resource/wearable-dotnet-generate-ni.high.post b/resource/wearable-dotnet-generate-ni.high.post
new file mode 100644 (file)
index 0000000..ad01dfe
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+echo "############### wearable-dotnet-generate-ni.post ################"
+
+SYSTEM_DIRS="
+    /usr/share/dotnet.tizen/netcoreapp
+    /usr/share/dotnet.tizen/framework
+"
+
+export IBCDATA_DIR=/usr/share/dotnet.tizen/ibcdata
+export COMPlus_UseIBCFile=1
+export COMPlus_IBCFileDir=$IBCDATA_DIR
+
+# remove previous native image
+dotnettool --ni-reset-system
+
+# generate SPC native image and remove origin
+dotnettool --ni-dll /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll
+if [ -f '/usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup' ]
+then
+    echo "remove origin file : System.Private.CoreLib.dll.Backup"
+    rm -f /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+    touch /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+fi
+
+# generate ni file and remove origin dll file
+for target_dir in $SYSTEM_DIRS
+do
+    for target_dll in $target_dir/*.dll;
+    do
+        dotnettool --ni-dll $target_dll;
+        if [ -f ${target_dll//.dll/.ni.dll} ]
+        then
+            echo "remove origin file : $target_dll"
+            rm -f $target_dll
+        fi
+    done;
+done;
+
+# remove ibc data
+if [ -d $IBCDATA_DIR ]
+then
+    echo "remove ibc data and directory"
+    rm -rf $IBCDATA_DIR
+fi
+
diff --git a/resource/wearable-dotnet-generate-ni.low.post b/resource/wearable-dotnet-generate-ni.low.post
new file mode 100644 (file)
index 0000000..b40e01a
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+echo "############### wearable-dotnet-generate-ni.post ################"
+
+DLL_LIST="
+        /usr/share/dotnet.tizen/netcoreapp/System.Collections.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Collections.Concurrent.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Console.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.Debug.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.IO.FileSystem.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Linq.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Linq.Expressions.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.ObjectModel.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Private.DataContractSerialization.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Private.Uri.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Private.Xml.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Reflection.Extensions.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Reflection.Metadata.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Runtime.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Runtime.Extensions.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Runtime.InteropServices.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Security.Cryptography.Algorithms.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Security.Cryptography.Primitives.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Text.RegularExpressions.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Threading.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Threading.Tasks.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Threading.Thread.dll
+        /usr/share/dotnet.tizen/netcoreapp/System.Threading.Timer.dll
+        /usr/share/dotnet.tizen/framework/ElmSharp.dll
+        /usr/share/dotnet.tizen/framework/Tizen.dll
+        /usr/share/dotnet.tizen/framework/Tizen.Applications.Common.dll
+        /usr/share/dotnet.tizen/framework/Tizen.Applications.UI.dll
+        /usr/share/dotnet.tizen/framework/Tizen.Applications.Service.dll
+        /usr/share/dotnet.tizen/framework/Tizen.System.Information.dll
+        /usr/share/dotnet.tizen/framework/XSF.dll
+"
+
+export IBCDATA_DIR=/usr/share/dotnet.tizen/ibcdata
+export COMPlus_UseIBCFile=1
+export COMPlus_IBCFileDir=$IBCDATA_DIR
+
+# remove previous native image
+dotnettool --ni-reset-system
+
+# generate SPC native image and remove origin
+dotnettool --ni-dll /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll
+if [ -f '/usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup' ]
+then
+    echo "remove origin file : System.Private.CoreLib.dll.Backup"
+    rm -f /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+    touch /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+fi
+
+# generate native image
+for target in $DLL_LIST;
+do
+    dotnettool --ni-dll $target;
+    if [ -f ${target//.dll/.ni.dll} ]
+    then
+        echo "remove origin file : $target"
+        rm -f $target
+    fi
+done;
+
+# remove ibc data
+if [ -d $IBCDATA_DIR ]
+then
+    echo "remove ibc data and directory"
+    rm -rf $IBCDATA_DIR
+fi
+
+
diff --git a/resource/wearable-dotnet-generate-ni.middle.post b/resource/wearable-dotnet-generate-ni.middle.post
new file mode 100644 (file)
index 0000000..946169c
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+echo "############### wearable-dotnet-generate-ni.post ################"
+
+DLL_LIST="
+    /usr/share/dotnet.tizen/netcoreapp/Microsoft.Win32.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/netstandard.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Collections.Concurrent.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Collections.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Collections.Immutable.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Collections.NonGeneric.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Collections.Specialized.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.ComponentModel.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.ComponentModel.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.ComponentModel.TypeConverter.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Console.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Data.Common.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.Debug.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.DiagnosticSource.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.Process.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.StackTrace.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.TraceSource.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Diagnostics.Tracing.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Drawing.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.IO.FileSystem.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.IO.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.IO.IsolatedStorage.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Linq.Expressions.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Linq.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Linq.Queryable.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Memory.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.Http.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.NameResolution.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.Requests.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.Security.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.Sockets.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.WebClient.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Net.WebProxy.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.ObjectModel.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Private.DataContractSerialization.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Private.Uri.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Private.Xml.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Reflection.Emit.ILGeneration.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Reflection.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Reflection.Metadata.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Reflection.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Resources.ResourceManager.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.Extensions.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.InteropServices.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.Numerics.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.Serialization.Formatters.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Runtime.Serialization.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Security.Cryptography.Algorithms.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Security.Cryptography.Primitives.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Security.Cryptography.X509Certificates.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Text.RegularExpressions.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Threading.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Threading.Tasks.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Threading.Timer.dll
+    /usr/share/dotnet.tizen/netcoreapp/System.Xml.ReaderWriter.dll
+    /usr/share/dotnet.tizen/framework/ElmSharp.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Account.AccountManager.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.Alarm.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.Common.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.ComponentBased.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.DataControl.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.MessagePort.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.Notification.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.PackageManager.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.Preference.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.Service.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.UI.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.WatchApplication.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Applications.WidgetApplication.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Content.Download.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Content.MediaContent.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Content.MimeType.dll
+    /usr/share/dotnet.tizen/framework/Tizen.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Location.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Log.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Maps.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Messaging.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Messaging.Push.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.AudioIO.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.Camera.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.MediaPlayer.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.Recorder.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Multimedia.Remoting.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Network.Bluetooth.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Network.Connection.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Network.WiFi.dll
+    /usr/share/dotnet.tizen/framework/Tizen.NUI.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Security.PrivacyPrivilegeManager.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Security.SecureRepository.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Sensor.dll
+    /usr/share/dotnet.tizen/framework/Tizen.System.Feedback.dll
+    /usr/share/dotnet.tizen/framework/Tizen.System.dll
+    /usr/share/dotnet.tizen/framework/Tizen.System.Information.dll
+    /usr/share/dotnet.tizen/framework/Tizen.System.Storage.dll
+    /usr/share/dotnet.tizen/framework/Tizen.System.SystemSettings.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Uix.Stt.dll
+    /usr/share/dotnet.tizen/framework/Tizen.Uix.Tts.dll
+    /usr/share/dotnet.tizen/framework/Tizen.WebView.dll
+    /usr/share/dotnet.tizen/framework/XSF.dll
+"
+
+export IBCDATA_DIR=/usr/share/dotnet.tizen/ibcdata
+export COMPlus_UseIBCFile=1
+export COMPlus_IBCFileDir=$IBCDATA_DIR
+
+# remove previous native image
+dotnettool --ni-reset-system
+
+# generate SPC native image and remove origin
+dotnettool --ni-dll /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll
+if [ -f '/usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup' ]
+then
+    echo "remove origin file : System.Private.CoreLib.dll.Backup"
+    rm -f /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+    touch /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll.Backup
+fi
+
+# generate native image
+for target in $DLL_LIST;
+do
+    dotnettool --ni-dll $target;
+    if [ -f ${target//.dll/.ni.dll} ]
+    then
+        echo "remove origin file : $target"
+        rm -f $target
+    fi
+done;
+
+# remove ibc data
+if [ -d $IBCDATA_DIR ]
+then
+    echo "remove ibc data and directory"
+    rm -rf $IBCDATA_DIR
+fi
+