-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrepareEnv.sh
executable file
·79 lines (65 loc) · 1.55 KB
/
PrepareEnv.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
source script/config.cfg
source script/Utils.sh
Usage () {
echo "X86 DOTNET Builder for PPC64 BE/LE Targets - by Manuel Virgilio"
echo ""
echo "This script will prepare a chroot environment to isolate the build process and the ppc related libraries"
echo ""
echo "Usage: ./PrepareEnv.sh <arch>"
echo "Arch can be: "
echo " ppc64 : big endian"
echo " ppc64le : little endian"
}
# check parameters
if [[ $# -lt 1 ]]; then
Usage
exit 1
fi
# check arch keyword
unset ARCH
case "$1" in
ppc64)
ARCH=ppc64
;;
ppc64le)
ARCH=ppc64le
;;
*)
echo "Wrong Architecture, available ppc64, ppc64le"
exit 1
;;
esac
# Load common variables
source script/Common.sh
source script/Chroot.sh
# Now we can build chroot
Utils_Title "BUILD CHROOT Environment"
Chroot_build host
Utils_Title "BUILD Dedicated $ARCH sysroot"
Chroot_build rootfs
Utils_Title "Create nuget-package directory"
mkdir -p $BASE_DIR/nuget-packages
echo "Created"
if [ ! -d redist ]; then
mkdir -p redist
fi
SDK_FILE=$(basename "$X86_DOTNET_SDK")
if [ ! -f $BASE_DIR/redist/$SDK_FILE ]; then
Utils_Title "Get X86 DOTNET SDK from Repo"
pushd $BASE_DIR/redist
wget $X86_DOTNET_SDK
popd
fi
Utils_Title "DOTNET Runtime"
pushd $X86_DIR/opt
if [ ! -d dotnet-runtime ]; then
mkdir -p dotnet-runtime
cd dotnet-runtime
tar xzf $BASE_DIR/redist/$SDK_FILE
else
echo "RUNTIME already installed"
fi
popd
Utils_Title "Done"