summaryrefslogtreecommitdiff
path: root/scripts/iot-making-building-blocks-dll.post
blob: 1001ba4c938b7fea98ff21e64b53c8549b93ae7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

echo "############### iot-making-building-blocks-dll.post ################"

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
export MIC_CROSSGEN2_ENABLED=1

DOTNET_MIC_DIR=/opt/usr/dotnet/mic

if [ -f  /opt/share/bb/make_tizenfx_from_bb.sh ]
then
	/opt/share/bb/make_tizenfx_from_bb.sh
	if [ -f /usr/bin/dotnettool ]
	then
		# remove previous native image
		dotnettool --ni-reset-system

		chmod 755 /usr/bin/patchelf
		chmod 755 $DOTNET_MIC_DIR/*

		# set the patchelf
		/usr/bin/patchelf --set-interpreter $DOTNET_MIC_DIR/ld-linux-x86-64.so.2 $DOTNET_MIC_DIR/crossgen2
		/usr/bin/patchelf --set-rpath $DOTNET_MIC_DIR $DOTNET_MIC_DIR/crossgen2

		for file in $( find $DOTNET_MIC_DIR -type f \( -name "*.so" -or -name "*.so.*" \) -not -name "*.dbg" -not -name "ld-*.so*" )
		do
		    /usr/bin/patchelf --set-rpath $DOTNET_MIC_DIR ${file}
		done

		# generate native image for system
		dotnettool --ni-system --inputbubble

		# generate native image for all app
		dotnettool --ni-regen-all-app
		dotnettool --tac-regen-all
	else
		echo "There is no execute file - /usr/bin/dotnettool"
	fi
else
	echo "There is no script file - /opt/share/bb/make_tizenfx_from_bb.sh"
fi

# remove files and package related to dotnet used only in MIC
rm -rf $DOTNET_MIC_DIR
rpm -e patchelf --nodeps
rpm -e crossgen2-mic --nodeps