Skip to content

Commit 9e66853

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1675 from jaapmarcus/feature/arm64-support
Feature/arm64 support
2 parents ece53bc + 7a78e21 commit 9e66853

File tree

4 files changed

+170
-29
lines changed

4 files changed

+170
-29
lines changed

bin/v-update-sys-hestia-git

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ BUILD_DIR='/tmp/hestiacp-src'
7272
DEB_DIR="$BUILD_DIR/debs"
7373
INSTALL_DIR='/usr/local/hestia'
7474
ARCHIVE_DIR="${BUILD_DIR}/archive"
75+
architecture="$(uname -m)"
76+
if [ $architecture == 'aarch64' ]; then
77+
BUILD_ARCH='arm64'
78+
else
79+
BUILD_ARCH='amd64'
80+
fi
7581

7682
# Set command variables
7783
fork=$1
@@ -81,7 +87,6 @@ flags=$4
8187

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

298306
# Configure PHP
299-
./configure --prefix=/usr/local/hestia/php \
307+
if [ $BUILD_ARCH = 'amd64' ]; then
308+
./configure --prefix=/usr/local/hestia/php \
300309
--enable-fpm \
301310
--with-fpm-user=admin \
302311
--with-fpm-group=admin \
303312
--with-libdir=lib/x86_64-linux-gnu \
304313
--with-mysqli \
314+
--with-gettext \
305315
--with-curl \
316+
--with-zip \
317+
--with-gmp \
306318
--enable-mbstring
319+
else
320+
./configure --prefix=/usr/local/hestia/php \
321+
--enable-fpm \
322+
--with-fpm-user=admin \
323+
--with-fpm-group=admin \
324+
--with-libdir=lib/aarch64-linux-gnu \
325+
--with-mysqli \
326+
--with-gettext \
327+
--with-curl \
328+
--with-zip \
329+
--with-gmp \
330+
--enable-mbstring
331+
fi
307332

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

324352
# Move php directory
@@ -375,6 +403,9 @@ if [ "$HESTIA_B" = true ] ; then
375403
# Download control, postinst and postrm files
376404
cd DEBIAN
377405
download_file $GIT_REP/hestia/control
406+
if [ "$BUILD_ARCH" != "amd64" ]; then
407+
sed -i "s/amd64/${BUILD_ARCH}/g" "control"
408+
fi
378409
download_file $GIT_REP/hestia/copyright
379410
download_file $GIT_REP/hestia/postinst
380411

install/hst-install-debian.sh

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ HESTIA='/usr/local/hestia'
1414
LOG="/root/hst_install_backups/hst_install-$(date +%d%m%Y%H%M).log"
1515
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
1616
hst_backups="/root/hst_install_backups/$(date +%d%m%Y%H%M)"
17-
arch=$(uname -i)
1817
spinner="/-\|"
1918
os='debian'
19+
architecture="$(uname -m)"
2020
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
2121
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
2222
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
@@ -413,6 +413,36 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
413413
fi
414414
fi
415415

416+
case $architecture in
417+
x86_64)
418+
ARCH="amd64"
419+
;;
420+
aarch64)
421+
ARCH="arm64"
422+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
423+
echo
424+
echo -e "\e[91mInstallation aborted\e[0m"
425+
echo "===================================================================="
426+
echo -e "\e[33mERROR: HestiaCP on ARM is currently not supported with install from ATP!\e[0m"
427+
echo -e "\e[33mPlease compile your own packages for HestiaCP. \e[0m"
428+
echo -e "\e[33mPlease follow the instructions at: \e[0m"
429+
echo -e " \e[33mhttps://docs.hestiacp.com/development/panel.html#compiling\e[21m\e[0m"
430+
echo ""
431+
check_result 1 "Installation aborted"
432+
fi
433+
;;
434+
*)
435+
echo
436+
echo -e "\e[91mInstallation aborted\e[0m"
437+
echo "===================================================================="
438+
echo -e "\e[33mERROR: $architecture is currently not supported!\e[0m"
439+
echo -e "\e[33mPlease verify the achitecture used is currenlty supported\e[0m"
440+
echo ""
441+
echo -e "\e[33mhttps://github.com/hestiacp/hestiacp/blob/main/README.md\e[0m"
442+
echo ""
443+
check_result 1 "Installation aborted"
444+
esac
445+
416446
#----------------------------------------------------------#
417447
# Brief Info #
418448
#----------------------------------------------------------#
@@ -602,11 +632,11 @@ echo "Adding required repositories to proceed with installation:"
602632
echo
603633

604634
# Installing Nginx repo
635+
605636
echo "[ * ] NGINX"
606-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
637+
echo "deb [arch=$ARCH] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
607638
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
608639

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

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

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

install/hst-install-ubuntu.sh

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ HESTIA='/usr/local/hestia'
1414
LOG="/root/hst_install_backups/hst_install-$(date +%d%m%Y%H%M).log"
1515
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
1616
hst_backups="/root/hst_install_backups/$(date +%d%m%Y%H%M)"
17-
arch=$(uname -i)
1817
spinner="/-\|"
1918
os='ubuntu'
2019
release="$(lsb_release -s -r)"
2120
codename="$(lsb_release -s -c)"
21+
architecture="$(uname -m)"
2222
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

@@ -387,6 +387,35 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
387387
fi
388388
fi
389389

390+
case $architecture in
391+
x86_64)
392+
ARCH="amd64"
393+
;;
394+
aarch64)
395+
ARCH="arm64"
396+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
397+
echo
398+
echo -e "\e[91mInstallation aborted\e[0m"
399+
echo "===================================================================="
400+
echo -e "\e[33mERROR: HestiaCP on ARM is currently not supported with install from ATP!\e[0m"
401+
echo -e "\e[33mPlease compile your own packages for HestiaCP. \e[0m"
402+
echo -e "\e[33mPlease follow the instructions at: \e[0m"
403+
echo -e " \e[33mhttps://docs.hestiacp.com/development/panel.html#compiling\e[21m\e[0m"
404+
echo ""
405+
check_result 1 "Installation aborted"
406+
fi
407+
;;
408+
*)
409+
echo
410+
echo -e "\e[91mInstallation aborted\e[0m"
411+
echo "===================================================================="
412+
echo -e "\e[33mERROR: $architecture is currently not supported!\e[0m"
413+
echo -e "\e[33mPlease verify the achitecture used is currenlty supported\e[0m"
414+
echo ""
415+
echo -e "\e[33mhttps://github.com/hestiacp/hestiacp/blob/main/README.md\e[0m"
416+
echo ""
417+
check_result 1 "Installation aborted"
418+
esac
390419
#----------------------------------------------------------#
391420
# Brief Info #
392421
#----------------------------------------------------------#
@@ -574,9 +603,10 @@ echo "Adding required repositories to proceed with installation:"
574603
echo
575604

576605
# Installing Nginx repo
606+
577607
echo "[ * ] NGINX"
578-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
579-
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
608+
echo "deb [arch=ARCH] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
609+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
580610

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

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

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

src/hst_autocompile.sh

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# and the script will not try to download the arhive from github, since '~' char is
77
# not accepted in branch name.
88
# Compile but dont install -> ./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
9-
# Compilea and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
9+
# Compile and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
1010

1111
# Clear previous screen output
1212
clear
@@ -106,6 +106,12 @@ BUILD_DIR='/tmp/hestiacp-src'
106106
INSTALL_DIR='/usr/local/hestia'
107107
SRC_DIR="$(cd "$(dirname "$0")/.." && pwd)"
108108
ARCHIVE_DIR="$SRC_DIR/src/archive/"
109+
architecture="$(uname -m)"
110+
if [ $architecture == 'aarch64' ]; then
111+
BUILD_ARCH='arm64'
112+
else
113+
BUILD_ARCH='amd64'
114+
fi
109115
RPM_DIR="$BUILD_DIR/rpm/"
110116
DEB_DIR="$BUILD_DIR/deb/"
111117
if [ -f '/etc/redhat-release' ]; then
@@ -204,7 +210,6 @@ fi
204210

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

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

250255
# Fix for Debian PHP Envroiment
251256
if [ ! -e /usr/local/include/curl ]; then
252-
ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
257+
if [ $BUILD_ARCH == "amd64" ]; then
258+
ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
259+
else
260+
echo "No x86_64 working"
261+
fi
253262
fi
254263
fi
255264
fi
@@ -270,6 +279,7 @@ if [ "$HESTIA_DEBUG" ]; then
270279
echo "Hestia version : $BUILD_VER"
271280
echo "Nginx version : $NGINX_V"
272281
echo "PHP version : $PHP_V"
282+
echo "Architecture : $BUILD_ARCH"
273283
echo "Debug mode : $HESTIA_DEBUG"
274284
echo "Source directory : $SRC_DIR"
275285
fi
@@ -372,6 +382,9 @@ if [ "$NGINX_B" = true ] ; then
372382
# Get Debian package files
373383
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
374384
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
385+
if [ "$BUILD_ARCH" != "amd64" ]; then
386+
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
387+
fi
375388
get_branch_file 'src/deb/nginx/copyright' "$BUILD_DIR_HESTIANGINX/DEBIAN/copyright"
376389
get_branch_file 'src/deb/nginx/postinst' "$BUILD_DIR_HESTIANGINX/DEBIAN/postinst"
377390
get_branch_file 'src/deb/nginx/postrm' "$BUILD_DIR_HESTIANGINX/DEBIAN/portrm"
@@ -451,18 +464,33 @@ if [ "$PHP_B" = true ] ; then
451464
cd $BUILD_DIR_PHP
452465

453466
# Configure PHP
454-
./configure --prefix=/usr/local/hestia/php \
455-
--enable-fpm \
456-
--with-fpm-user=admin \
457-
--with-fpm-group=admin \
458-
--with-libdir=lib/x86_64-linux-gnu \
459-
--with-mysqli \
460-
--with-gettext \
461-
--with-curl \
462-
--with-zip \
463-
--with-gmp \
464-
--enable-intl \
465-
--enable-mbstring
467+
if [ $BUILD_ARCH = 'amd64' ]; then
468+
./configure --prefix=/usr/local/hestia/php \
469+
--enable-fpm \
470+
--with-fpm-user=admin \
471+
--with-fpm-group=admin \
472+
--with-libdir=lib/x86_64-linux-gnu \
473+
--with-mysqli \
474+
--with-gettext \
475+
--with-curl \
476+
--with-zip \
477+
--with-gmp \
478+
--enable-intl \
479+
--enable-mbstring
480+
else
481+
./configure --prefix=/usr/local/hestia/php \
482+
--enable-fpm \
483+
--with-fpm-user=admin \
484+
--with-fpm-group=admin \
485+
--with-libdir=lib/aarch64-linux-gnu \
486+
--with-mysqli \
487+
--with-gettext \
488+
--with-curl \
489+
--with-zip \
490+
--with-gmp \
491+
--enable-intl \
492+
--enable-mbstring
493+
fi
466494
fi
467495

468496
cd $BUILD_DIR_PHP
@@ -503,6 +531,9 @@ if [ "$PHP_B" = true ] ; then
503531
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
504532
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
505533
get_branch_file 'src/deb/php/control' "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
534+
if [ "$BUILD_ARCH" != "amd64" ]; then
535+
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
536+
fi
506537
get_branch_file 'src/deb/php/copyright' "$BUILD_DIR_HESTIAPHP/DEBIAN/copyright"
507538

508539
# Get custom config
@@ -600,6 +631,9 @@ if [ "$HESTIA_B" = true ]; then
600631
# Get Debian package files
601632
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
602633
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
634+
if [ "$BUILD_ARCH" != "amd64" ]; then
635+
sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIA/DEBIAN/control"
636+
fi
603637
get_branch_file 'src/deb/hestia/copyright' "$BUILD_DIR_HESTIA/DEBIAN/copyright"
604638
get_branch_file 'src/deb/hestia/postinst' "$BUILD_DIR_HESTIA/DEBIAN/postinst"
605639
chmod +x $BUILD_DIR_HESTIA/DEBIAN/postinst

0 commit comments

Comments
 (0)