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

Build for arm64 #44

Open
mikey0000 opened this issue Jul 27, 2022 · 7 comments
Open

Build for arm64 #44

mikey0000 opened this issue Jul 27, 2022 · 7 comments

Comments

@mikey0000
Copy link

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
Copy link

jogerj commented Sep 29, 2022

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 kohlschutter/junixsocket#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
Copy link
Author

@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
Copy link

jogerj commented Sep 30, 2022

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
Copy link
Author

mikey0000 commented Sep 30, 2022

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
Copy link
Author

mikey0000 commented Oct 1, 2022 via email

@innotelinc
Copy link

Please send me info on how you did it

@jogerj
Copy link

jogerj commented Apr 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants