Zimbra / installguides

Zimbra Installation Guides
https://zimbra.github.io/installguides/
Other
30 stars 22 forks source link

Build for arm64 #44

Open mikey0000 opened 2 years ago

mikey0000 commented 2 years ago

Just to let you know I built zimbra for arm64, works great, made a few changes to some of the packages to get it to work but yeah, it works with not too many changes.

Lemme know if you'd like to see the code changes.

jogerj commented 1 year ago

I tried to apply the same changes on latest zm-build develop branch and it failed to compile junixsocket, so I had to use version 2.5.1 (see https://github.com/kohlschutter/junixsocket/issues/102)

The build completed successfully, but upon install did not work. I tried targetting Ubuntu 20.04 on 9.0.0. I invoked the following ./build.pl --build-release=Kepler --build-release-no=9.0.0 --build-release-candidate=GA --build-type=FOSS --build-thirdparty-server=files.zimbra.com --build-no=4178

Output ``` ========================================================================================================= BUILD_NO : cmdline : 4178 BUILD_TS : default : 20220930013811 BUILD_OS : cmdline : UBUNTU20_64 BUILD_DESTINATION_BASE_DIR : default : /home/ubuntu/zimbra/BUILDS BUILD_SOURCES_BASE_DIR : default : /home/ubuntu/zimbra BUILD_RELEASE : cmdline : Kepler BUILD_RELEASE_NO : cmdline : 9.0.0 BUILD_RELEASE_CANDIDATE : cmdline : GA BUILD_TYPE : cmdline : FOSS BUILD_THIRDPARTY_SERVER : cmdline : files.zimbra.com BUILD_PROD_FLAG : default : 1 BUILD_DEBUG_FLAG : default : 0 BUILD_DEV_TOOL_BASE_DIR : default : /home/ubuntu/.zm-dev-tools INTERACTIVE : default : 1 DISABLE_TAR : default : 0 DISABLE_BUNDLE : default : 0 EXCLUDE_GIT_REPOS : default : STOP_AFTER_CHECKOUT : default : 0 BUILD_HOSTNAME : cmdline : example.com BUILD_ARCH : default : arm64 PKG_OS_TAG : default : u20 BUILD_RELEASE_NO_SHORT : default : 900 DESTINATION_NAME : default : UBUNTU20_64-Kepler-900-20220930013811-FOSS-4178 BUILD_DIR : default : /home/ubuntu/zimbra/.staging/UBUNTU20_64-Kepler-900-20220930013811-FOSS-4178 DEPLOY_URL_PREFIX : default : http://example.com:8008/UBUNTU20_64-Kepler-900-20220930013811-FOSS-4178 ========================================================================================================= ```

the error upon running install.sh was Error: no such file ":Aborting, unknown platform: UBUNTU20"

mikey0000 commented 1 year ago

@jogerj you need to update the install script specifically bin/get_plat_tag.sh to recognise ubuntu20 by default it only goes up to 18, better add that to my readme. Yes you do need to upgrade junixsocket, there are a bunch of post install steps in my readme as well.

jogerj commented 1 year ago

you need to update the install script specifically bin/get_plat_tag.sh to recognise ubuntu20 by default

Ubuntu 20 has been supported on latest builds for a while now. But from the file you hinted at I found there's another check for architecture at this line

``` if [ -f /etc/lsb-release ]; then LSB="lsb_release" i=`dpkg --print-architecture` if [ "x$i" = "xamd64" ]; then i="_64" else i="" fi ```

the check needs to be replaced to arm64 not amd64. Patching it proper would be if [ "x$i" = "xamd64" || "x$i" = "xarm64" ]; then

Another check is done in util/modules/packages.sh

modified lines ``` local file=${global_pkg_file[$package]} if grep -q i386 <(echo $file) then PROC="i386" elif grep -q x86_64 <(echo $file); then PROC="x86_64" else PROC="arm64" fi if [[ $PLATFORM == "DEBIAN"* || $PLATFORM == "UBUNTU"* ]]; then LOCALPROC=`dpkg --print-architecture` if [ x"$LOCALPROC" == "xamd64" ]; then LOCALPROC="x86_64" fi if [ x"$LOCALPROC" == "xarm64" ]; then LOCALPROC="arm64" fi else LOCALPROC=`uname -i` fi ```

with that out of the way, I only got as far as package selection. After that, it complains of all the missing packages such as zimbra-core-components. Using Zimbra's repository does not help as they only have x86 binaries afaik, so even when the packages are found it won't install

I was really hoping to get this to work on oracle cloud. If I can't get this running, I guess I'd better stick with amd64 instances, even if it's more expensive

mikey0000 commented 1 year ago

Ahh yes, you need to create your own repo with the compiled packages. like so

deb [trusted=yes] file:/home/git/packages/zimbra / deb [trusted=yes] file:/home/git/packages/thirdparty /

making sure to run the command dpkg-scanpackages -m . > Packages

mikey0000 commented 1 year ago

If your still struggling I'll setup a repo with the packages for you.

30/09/2022 5:13:10 pm jogerj @.***>:

you need to update the install script specifically bin/get_plat_tag.sh to recognise ubuntu20 by default

Ubuntu 20 has been supported on latest builds for a while now. But from the file you hinted at I found there's another check for architecture at this line

if [ -f /etc/lsb-release ]; then LSB="lsb_release" i=dpkg --print-architecture if [ "x$i" = "xamd64" ]; then i="_64" else
i="" fi
the check needs to be replaced to arm64 not amd64. Patching it proper would be if [ "x$i" = "xamd64" || "x$i" = "xarm64" ]; then

Another check is done in util/modules/packages.sh

modified lines *local file=${global_pkg_file[$package]} if grep -q i386 <(echo $file) then PROC="i386" elif grep -q x86_64 <(echo $file); then PROC="x86_64" else PROC="arm64" fi

     if [[ $PLATFORM == "DEBIAN"* || $PLATFORM == "UBUNTU"* ]]; then
        LOCALPROC=`dpkg --print-architecture`
        if [ x"$LOCALPROC" == "xamd64" ]; then
           LOCALPROC="x86_64"
        fi
        if [ x"$LOCALPROC" == "xarm64" ]; then 
           LOCALPROC="arm64"
        fi
     else
        LOCALPROC=`uname -i`
     fi

* with that out of the way, I only got as far as package selection. After that, it complains of all the missing packages such as zimbra-core-components. Using Zimbra's repository does not help as they only have x86 binaries afaik, so even when the packages are found it won't install

— Reply to this email directly, view it on GitHub[https://github.com/Zimbra/installguides/issues/44#issuecomment-1263080060], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AALDOPP2NRUL6BIRUJNLVXLWAZSERANCNFSM54YW567A]. You are receiving this because you authored the thread.[Tracking image][https://github.com/notifications/beacon/AALDOPN2Y54XOFGJATBWXRDWAZSERA5CNFSM54YW567KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJNERE7A.gif]

innotelinc commented 1 year ago

Please send me info on how you did it

jogerj commented 1 year ago

In the end I opted to use x86 builds, this solution is simply not production ready at its current state, but would really love to see more development in this direction.