From 8f518f2c7e4a53549c4bf05884008e65887a2b74 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 10 Jul 2019 22:00:24 +0200 Subject: [PATCH 1/2] separation between arm and arm64 --- conf/{arm.src => arm64.src} | 0 scripts/detect_arch | 8 ++++---- scripts/install | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) rename conf/{arm.src => arm64.src} (100%) diff --git a/conf/arm.src b/conf/arm64.src similarity index 100% rename from conf/arm.src rename to conf/arm64.src diff --git a/scripts/detect_arch b/scripts/detect_arch index 20ab9dc..ba04b7e 100644 --- a/scripts/detect_arch +++ b/scripts/detect_arch @@ -1,14 +1,14 @@ #!/bin/bash -if [ -n "$(uname -m | grep x86_64)" ]; then +if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then + architecture="arm64" +elif [ -n "$(uname -m | grep 64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then architecture="i386" elif [ -n "$(uname -m | grep arm)" ]; then architecture="arm" -elif [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm" else - ynh_die --message="Unable to detect your achitecture, please open a bug describing \ + ynh_die "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 fi diff --git a/scripts/install b/scripts/install index c3af6fa..19f0bab 100755 --- a/scripts/install +++ b/scripts/install @@ -46,6 +46,12 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_print_info --message="Validating installation parameters..." +# Check machine architecture (in particular, we don't support ARM and 32bit machines) +if [ $architecture == "x86_64" ] && [ $architecture == "arm" ] +then + ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" +fi + final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" From b28183a3cbc5f3919efe09d44490c83c7756a51a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 10 Jul 2019 23:20:31 +0200 Subject: [PATCH 2/2] fix architecture comparison --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 19f0bab..1ff8708 100755 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ app=$YNH_APP_INSTANCE_NAME ynh_print_info --message="Validating installation parameters..." # Check machine architecture (in particular, we don't support ARM and 32bit machines) -if [ $architecture == "x86_64" ] && [ $architecture == "arm" ] +if [ $architecture == "x86_64" ] || [ $architecture == "arm" ] then ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" fi