Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/arm64 support #1675

Merged
23 commits merged into from Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a7da10c
Upgrade versions to 8.0.3 / 1.19.8
jaapmarcus Mar 13, 2021
535ac74
Add support for ARM64
jaapmarcus Mar 13, 2021
09e41d7
Fix issue that architecture wasn’t replaced in /DEBIAN/control
jaapmarcus Mar 14, 2021
9997bbf
Fix error in check line 256
jaapmarcus Mar 14, 2021
1531315
Undo change
jaapmarcus Mar 14, 2021
882296b
arm64 /usr/include/x86_64-linux-gnu/curl doesn’t exits might need to …
jaapmarcus Mar 14, 2021
fe3fdf1
Use aarch64 instead of x86_64
jaapmarcus Mar 14, 2021
cb99eb7
one = instead of ==
jaapmarcus Mar 14, 2021
a506e21
Create ARM installer for Ubuntu
jaapmarcus Mar 14, 2021
f7af5d3
Modify hst-install-ubuntu to support ARM
jaapmarcus Mar 15, 2021
0170959
Fix error on default statement line 381
jaapmarcus Mar 15, 2021
736884e
Make both installers arm proof. Please not packages for HestiaCP ARM …
jaapmarcus Mar 15, 2021
2bc9294
Use hst-install-ubuntu-arm.sh instead
jaapmarcus Mar 15, 2021
56c0e8e
Update v-update-sys-hestia-git
jaapmarcus Mar 15, 2021
7bda36d
Remove BUILD_ARCH on line 89 as it was set before
jaapmarcus Mar 15, 2021
ee885e1
Block use of ARM64 in installer as no packages are availble
jaapmarcus Mar 15, 2021
ba76638
Hash out atp for arm + add notice
jaapmarcus Mar 15, 2021
0d833d3
Error in double quotation mark
jaapmarcus Mar 17, 2021
6d9cf3c
Fix error message
jaapmarcus Mar 17, 2021
fd2ae28
Change version to 7.4.16 allowing merging
jaapmarcus Mar 18, 2021
4abfbe6
Fix spelling in header
jaapmarcus Mar 21, 2021
70c22e9
Merge branch 'main' into feature/arm64-support
jaapmarcus Mar 28, 2021
7a78e21
Merge branch 'main' into feature/arm64-support
jaapmarcus Mar 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 33 additions & 2 deletions bin/v-update-sys-hestia-git
Expand Up @@ -72,6 +72,12 @@ BUILD_DIR='/tmp/hestiacp-src'
DEB_DIR="$BUILD_DIR/debs"
INSTALL_DIR='/usr/local/hestia'
ARCHIVE_DIR="${BUILD_DIR}/archive"
architecture="$(uname -m)"
if [ $architecture == 'aarch64' ]; then
BUILD_ARCH='arm64'
else
BUILD_ARCH='amd64'
fi

# Set command variables
fork=$1
Expand All @@ -81,7 +87,6 @@ flags=$4

# Set Version for compiling
BUILD_VER=$(curl -s https://raw.githubusercontent.com/$fork/hestiacp/$branch/src/deb/hestia/control | grep "Version:" | cut -d' ' -f2)
BUILD_ARCH='amd64'
HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
NGINX_V=$(curl -s https://raw.githubusercontent.com/$fork/hestiacp/$branch/src/deb/nginx/control |grep "Version:" |cut -d' ' -f2)
OPENSSL_V='1.1.1g'
Expand Down Expand Up @@ -234,6 +239,9 @@ if [ "$NGINX_B" = true ] ; then
# Download control, postinst and postrm files
cd DEBIAN
download_file $GIT_REP/nginx/control
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "control"
fi
download_file $GIT_REP/nginx/copyright
download_file $GIT_REP/nginx/postinst
download_file $GIT_REP/nginx/postrm
Expand Down Expand Up @@ -296,14 +304,31 @@ if [ "$PHP_B" = true ] ; then
cd php-$PHP_V

# Configure PHP
./configure --prefix=/usr/local/hestia/php \
if [ $BUILD_ARCH = 'amd64' ]; then
./configure --prefix=/usr/local/hestia/php \
--enable-fpm \
--with-fpm-user=admin \
--with-fpm-group=admin \
--with-libdir=lib/x86_64-linux-gnu \
--with-mysqli \
--with-gettext \
--with-curl \
--with-zip \
--with-gmp \
--enable-mbstring
else
./configure --prefix=/usr/local/hestia/php \
--enable-fpm \
--with-fpm-user=admin \
--with-fpm-group=admin \
--with-libdir=lib/aarch64-linux-gnu \
--with-mysqli \
--with-gettext \
--with-curl \
--with-zip \
--with-gmp \
--enable-mbstring
fi

# Create the files and install them
make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
Expand All @@ -319,6 +344,9 @@ if [ "$PHP_B" = true ] ; then
# Download control, postinst and postrm files
cd DEBIAN
download_file $GIT_REP/php/control
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "control"
fi
download_file $GIT_REP/php/copyright

# Move php directory
Expand Down Expand Up @@ -375,6 +403,9 @@ if [ "$HESTIA_B" = true ] ; then
# Download control, postinst and postrm files
cd DEBIAN
download_file $GIT_REP/hestia/control
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "control"
fi
download_file $GIT_REP/hestia/copyright
download_file $GIT_REP/hestia/postinst

Expand Down
50 changes: 44 additions & 6 deletions install/hst-install-debian.sh
Expand Up @@ -14,9 +14,9 @@ HESTIA='/usr/local/hestia'
LOG="/root/hst_install_backups/hst_install-$(date +%d%m%Y%H%M).log"
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
hst_backups="/root/hst_install_backups/$(date +%d%m%Y%H%M)"
arch=$(uname -i)
spinner="/-\|"
os='debian'
architecture="$(uname -m)"
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
Expand Down Expand Up @@ -413,6 +413,36 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
fi
fi

case $architecture in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
echo
echo -e "\e[91mInstallation aborted\e[0m"
echo "===================================================================="
echo -e "\e[33mERROR: HestiaCP on ARM is currently not supported with install from ATP!\e[0m"
echo -e "\e[33mPlease compile your own packages for HestiaCP. \e[0m"
echo -e "\e[33mPlease follow the instructions at: \e[0m"
echo -e " \e[33mhttps://docs.hestiacp.com/development/panel.html#compiling\e[21m\e[0m"
echo ""
check_result 1 "Installation aborted"
fi
;;
*)
echo
echo -e "\e[91mInstallation aborted\e[0m"
echo "===================================================================="
echo -e "\e[33mERROR: $architecture is currently not supported!\e[0m"
echo -e "\e[33mPlease verify the achitecture used is currenlty supported\e[0m"
echo ""
echo -e "\e[33mhttps://github.com/hestiacp/hestiacp/blob/main/README.md\e[0m"
echo ""
check_result 1 "Installation aborted"
esac

#----------------------------------------------------------#
# Brief Info #
#----------------------------------------------------------#
Expand Down Expand Up @@ -602,11 +632,11 @@ echo "Adding required repositories to proceed with installation:"
echo

# Installing Nginx repo

echo "[ * ] NGINX"
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
echo "deb [arch=$ARCH] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1


# Installing sury PHP repo
echo "[ * ] PHP"
echo "deb https://packages.sury.org/php/ $codename main" > $apt/php.list
Expand All @@ -622,19 +652,27 @@ fi
# Installing MariaDB repo
if [ "$mysql" = 'yes' ]; then
echo "[ * ] MariaDB"
echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
echo "deb [arch=$ARCH] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
fi

# Installing HestiaCP repo
echo "[ * ] Hestia Control Panel"
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
if [ "$ARCH" = "amd64" ]; then
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
else
echo "# deb https://$RHOST/ $codename main" > $apt/hestia.list
echo -e "\e[91m[ ! ] HestiaCP on ARM is currently in Development.\e[0m"
echo -e "\e[91m This will mean that we don't provide any packages and you are responisble\e[0m"
echo -e "\e[91m for building the packages your self. To build your own packeges see\e[0m"
echo -e "\e[91m https://docs.hestiacp.com/development/panel.html#compiling\e[0m"
fi
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1

# Installing PostgreSQL repo
if [ "$postgresql" = 'yes' ]; then
echo "[ * ] PostgreSQL"
echo "deb [arch=amd64] https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
echo "deb [arch=$ARCH] https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
apt-key adv --fetch-keys 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' > /dev/null 2>&1
fi

Expand Down
50 changes: 44 additions & 6 deletions install/hst-install-ubuntu.sh
Expand Up @@ -14,11 +14,11 @@ HESTIA='/usr/local/hestia'
LOG="/root/hst_install_backups/hst_install-$(date +%d%m%Y%H%M).log"
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
hst_backups="/root/hst_install_backups/$(date +%d%m%Y%H%M)"
arch=$(uname -i)
spinner="/-\|"
os='ubuntu'
release="$(lsb_release -s -r)"
codename="$(lsb_release -s -c)"
architecture="$(uname -m)"
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
VERBOSE='no'

Expand Down Expand Up @@ -387,6 +387,35 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
fi
fi

case $architecture in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
echo
echo -e "\e[91mInstallation aborted\e[0m"
echo "===================================================================="
echo -e "\e[33mERROR: HestiaCP on ARM is currently not supported with install from ATP!\e[0m"
echo -e "\e[33mPlease compile your own packages for HestiaCP. \e[0m"
echo -e "\e[33mPlease follow the instructions at: \e[0m"
echo -e " \e[33mhttps://docs.hestiacp.com/development/panel.html#compiling\e[21m\e[0m"
echo ""
check_result 1 "Installation aborted"
fi
;;
*)
echo
echo -e "\e[91mInstallation aborted\e[0m"
echo "===================================================================="
echo -e "\e[33mERROR: $architecture is currently not supported!\e[0m"
echo -e "\e[33mPlease verify the achitecture used is currenlty supported\e[0m"
echo ""
echo -e "\e[33mhttps://github.com/hestiacp/hestiacp/blob/main/README.md\e[0m"
echo ""
check_result 1 "Installation aborted"
esac
#----------------------------------------------------------#
# Brief Info #
#----------------------------------------------------------#
Expand Down Expand Up @@ -574,9 +603,10 @@ echo "Adding required repositories to proceed with installation:"
echo

# Installing Nginx repo

echo "[ * ] NGINX"
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
echo "deb [arch=ARCH] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1

# Installing sury PHP repo
echo "[ * ] PHP"
Expand All @@ -591,19 +621,27 @@ fi
# Installing MariaDB repo
if [ "$mysql" = 'yes' ]; then
echo "[ * ] MariaDB"
echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
echo "deb [arch=$ARCH] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
fi

# Installing HestiaCP repo
echo "[ * ] Hestia Control Panel"
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
if [ "$ARCH" = "amd64" ]; then
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
else
echo "# deb https://$RHOST/ $codename main" > $apt/hestia.list
echo -e "\e[91m[ ! ] HestiaCP on ARM is currently in Development.\e[0m"
echo -e "\e[91m This will mean that we don't provide any packages and you are responisble\e[0m"
echo -e "\e[91m for building the packages your self. To build your own packeges see\e[0m"
echo -e "\e[91m https://docs.hestiacp.com/development/panel.html#compiling\e[0m"
fi
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1

# Installing PostgreSQL repo
if [ "$postgresql" = 'yes' ]; then
echo "[ * ] PostgreSQL"
echo "deb [arch=amd64] https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
echo "deb [arch=$ARCH] https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
apt-key adv --fetch-keys 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' > /dev/null 2>&1
fi

Expand Down
64 changes: 49 additions & 15 deletions src/hst_autocompile.sh
Expand Up @@ -6,7 +6,7 @@
# and the script will not try to download the arhive from github, since '~' char is
# not accepted in branch name.
# Compile but dont install -> ./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
# Compilea and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
# Compile and install -> ./hst_autocompile.sh --hestia --install '~localsrc'

# Clear previous screen output
clear
Expand Down Expand Up @@ -106,6 +106,12 @@ BUILD_DIR='/tmp/hestiacp-src'
INSTALL_DIR='/usr/local/hestia'
SRC_DIR="$(cd "$(dirname "$0")/.." && pwd)"
ARCHIVE_DIR="$SRC_DIR/src/archive/"
architecture="$(uname -m)"
if [ $architecture == 'aarch64' ]; then
BUILD_ARCH='arm64'
else
BUILD_ARCH='amd64'
fi
RPM_DIR="$BUILD_DIR/rpm/"
DEB_DIR="$BUILD_DIR/deb/"
if [ -f '/etc/redhat-release' ]; then
Expand Down Expand Up @@ -204,7 +210,6 @@ fi

echo "Build version $BUILD_VER, with Nginx version $NGINX_V and PHP version $PHP_V"

BUILD_ARCH='amd64'
HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
OPENSSL_V='1.1.1j'
PCRE_V='8.44'
Expand Down Expand Up @@ -249,7 +254,11 @@ if [ "$dontinstalldeps" != 'true' ]; then

# Fix for Debian PHP Envroiment
if [ ! -e /usr/local/include/curl ]; then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
if [ $BUILD_ARCH == "amd64" ]; then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
else
echo "No x86_64 working"
fi
fi
fi
fi
Expand All @@ -270,6 +279,7 @@ if [ "$HESTIA_DEBUG" ]; then
echo "Hestia version : $BUILD_VER"
echo "Nginx version : $NGINX_V"
echo "PHP version : $PHP_V"
echo "Architecture : $BUILD_ARCH"
echo "Debug mode : $HESTIA_DEBUG"
echo "Source directory : $SRC_DIR"
fi
Expand Down Expand Up @@ -372,6 +382,9 @@ if [ "$NGINX_B" = true ] ; then
# Get Debian package files
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
fi
get_branch_file 'src/deb/nginx/copyright' "$BUILD_DIR_HESTIANGINX/DEBIAN/copyright"
get_branch_file 'src/deb/nginx/postinst' "$BUILD_DIR_HESTIANGINX/DEBIAN/postinst"
get_branch_file 'src/deb/nginx/postrm' "$BUILD_DIR_HESTIANGINX/DEBIAN/portrm"
Expand Down Expand Up @@ -451,18 +464,33 @@ if [ "$PHP_B" = true ] ; then
cd $BUILD_DIR_PHP

# Configure PHP
./configure --prefix=/usr/local/hestia/php \
--enable-fpm \
--with-fpm-user=admin \
--with-fpm-group=admin \
--with-libdir=lib/x86_64-linux-gnu \
--with-mysqli \
--with-gettext \
--with-curl \
--with-zip \
--with-gmp \
--enable-intl \
--enable-mbstring
if [ $BUILD_ARCH = 'amd64' ]; then
./configure --prefix=/usr/local/hestia/php \
--enable-fpm \
--with-fpm-user=admin \
--with-fpm-group=admin \
--with-libdir=lib/x86_64-linux-gnu \
--with-mysqli \
--with-gettext \
--with-curl \
--with-zip \
--with-gmp \
--enable-intl \
--enable-mbstring
else
./configure --prefix=/usr/local/hestia/php \
--enable-fpm \
--with-fpm-user=admin \
--with-fpm-group=admin \
--with-libdir=lib/aarch64-linux-gnu \
--with-mysqli \
--with-gettext \
--with-curl \
--with-zip \
--with-gmp \
--enable-intl \
--enable-mbstring
fi
fi

cd $BUILD_DIR_PHP
Expand Down Expand Up @@ -503,6 +531,9 @@ if [ "$PHP_B" = true ] ; then
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
get_branch_file 'src/deb/php/control' "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
fi
get_branch_file 'src/deb/php/copyright' "$BUILD_DIR_HESTIAPHP/DEBIAN/copyright"

# Get custom config
Expand Down Expand Up @@ -600,6 +631,9 @@ if [ "$HESTIA_B" = true ]; then
# Get Debian package files
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
if [ "$BUILD_ARCH" != "amd64" ]; then
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIA/DEBIAN/control"
fi
get_branch_file 'src/deb/hestia/copyright' "$BUILD_DIR_HESTIA/DEBIAN/copyright"
get_branch_file 'src/deb/hestia/postinst' "$BUILD_DIR_HESTIA/DEBIAN/postinst"
chmod +x $BUILD_DIR_HESTIA/DEBIAN/postinst
Expand Down