File tree Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Original file line number Diff line number Diff line change @@ -56,3 +56,37 @@ function patch_repo() {
56
56
echo -e " [${FUNCNAME[0]} ] Patched ${name} @ $( git describe --all --long 2> /dev/null) in ${repo_dir} dir.\n"
57
57
popd
58
58
}
59
+
60
+ function check_platform_support() {
61
+ # No args
62
+ # Exits with return code 1 if the platform is unsupported
63
+
64
+ # Make sure we are on a supported platform
65
+ if [[ " ${ARCH} " != " x86_64" ]] && [[ " ${ARCH} " != " aarch64" ]] \
66
+ && [[ " ${ARCH} " != " arm64" ]]; then
67
+ echo " [main] Error: only x86-64 & aarch64 architecture is supported for now!"
68
+ exit 1
69
+ fi
70
+ }
71
+
72
+ function check_os_support() {
73
+ # No args
74
+ # Exits with return code 1 if invalid combination of platform and os
75
+
76
+ # Check valid combinations of OS and platform
77
+
78
+ # Linux on x86_64
79
+ if [[ " ${ARCH} " == " x86_64" ]] && [[ " ${OS} " != " Linux" ]]; then
80
+ echo " Error: Only Linux is supported on x86_64"
81
+ exit 1
82
+ fi
83
+
84
+ # Linux on arm64/aarch64
85
+ # Darwin on arm64/aarch64
86
+ if [[ " ${ARCH} " == " aarch64" ]] || [[ " ${ARCH} " == " arm64" ]]; then
87
+ if [[ " ${OS} " != " Darwin" ]] || [[ " ${OS} " != " Linux" ]]; then
88
+ echo " Error: Only Linux and Darwin are supported on arm64"
89
+ exit 1
90
+ fi
91
+ fi
92
+ }
Original file line number Diff line number Diff line change @@ -347,15 +347,6 @@ function create_setup_path(){
347
347
fi
348
348
}
349
349
350
- function check_platform_support() {
351
- # Make sure we are on a supported platform
352
- if [[ " ${ARCH} " != " x86_64" ]] && [[ " ${ARCH} " != " aarch64" ]] \
353
- && [[ " ${ARCH} " != " arm64" ]]; then
354
- echo " [main] Error: only x86-64 & aarch64 architecture is supported for now!"
355
- exit 1
356
- fi
357
- }
358
-
359
350
360
351
# #######
361
352
# ## main
@@ -367,9 +358,13 @@ if [[ $is_script_sourced -eq 0 ]]; then
367
358
368
359
check_options " $@ "
369
360
361
+ # Import utils
362
+ source $et_dir /backends/arm/scripts/utils.sh
370
363
source $et_dir /backends/arm/scripts/fvp_utils.sh
371
364
365
+ echo " [main]: Checking platform and os"
372
366
check_platform_support
367
+ check_os_support
373
368
374
369
cd " ${script_dir} "
375
370
@@ -387,9 +382,6 @@ if [[ $is_script_sourced -eq 0 ]]; then
387
382
echo " enable-vela=${enable_vela} "
388
383
echo " mlsdk-manifest-url=${mlsdk_manifest_url} "
389
384
390
- # Import utils
391
- source $et_dir /backends/arm/scripts/utils.sh
392
-
393
385
# Select appropriate toolchain
394
386
select_toolchain
395
387
You can’t perform that action at this time.
0 commit comments