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() {
5656 echo -e " [${FUNCNAME[0]} ] Patched ${name} @ $( git describe --all --long 2> /dev/null) in ${repo_dir} dir.\n"
5757 popd
5858}
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(){
347347 fi
348348}
349349
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-
359350
360351# #######
361352# ## main
@@ -367,9 +358,13 @@ if [[ $is_script_sourced -eq 0 ]]; then
367358
368359 check_options " $@ "
369360
361+ # Import utils
362+ source $et_dir /backends/arm/scripts/utils.sh
370363 source $et_dir /backends/arm/scripts/fvp_utils.sh
371364
365+ echo " [main]: Checking platform and os"
372366 check_platform_support
367+ check_os_support
373368
374369 cd " ${script_dir} "
375370
@@ -387,9 +382,6 @@ if [[ $is_script_sourced -eq 0 ]]; then
387382 echo " enable-vela=${enable_vela} "
388383 echo " mlsdk-manifest-url=${mlsdk_manifest_url} "
389384
390- # Import utils
391- source $et_dir /backends/arm/scripts/utils.sh
392-
393385 # Select appropriate toolchain
394386 select_toolchain
395387
You can’t perform that action at this time.
0 commit comments