5ed524964ecfcf748f22f5823ef4e945212ac132
max
  Fri Apr 25 16:38:33 2025 -0700
adding support for Linux on ARM to GBIC, refs #29651, refs #29468

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
old mode 100644
new mode 100755
index 22ea3664220..9eeb34cacff
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -1,21 +1,21 @@
 #!/bin/bash
 
 # script to install/setup dependencies for the UCSC genome browser CGIs
 # call it like this as root from a command line: bash browserSetup.sh
 
-# you can easily debug this script with 'bash -x browserSetup.sh', it 
+# You can easily debug this script with 'bash -x browserSetup.sh', it 
 # will show all commands then
 
 exec > >(tee -a "${HOME}/browserSetup.log") 2>&1
 
 set -u -e -o pipefail # fail on unset vars and all errors, also in pipes
 
 # set all locale settings to English
 # searching for certain strings in command output might fail, if locale is different
 export LANG=C
 
 exitHandler() {
     if [ "$1" == "100" -o "$1" == "0" ] ; then
        exit $1 # all fine, a specific error message has already been output
     fi
 
@@ -34,34 +34,34 @@
 # ---- GLOBAL DEFAULT SETTINGS ----
 
 # Directory where CGI-BIN and htdocs are downloaded to.
 # this is the main runtime directory of the genome browser. It contains
 # CGI binaries, the config file (hg.conf), temporary ("trash") files, downloaded pieces of big files
 # ("udcCache") and various other runtime data needed for the browser
 APACHEDIR=/usr/local/apache
 
 # apache document root, for html documents
 HTDOCDIR=$APACHEDIR/htdocs
 # apache CGI-bin directory
 CGIBINDIR=$APACHEDIR/cgi-bin
 # directory for temporary files
 TRASHDIR=$APACHEDIR/trash
 
-# Mysql data directory 
+# Mysql data directory for most genome annotation data
 # Yes we only support mariaDB anymore, but the variables will keep their names
 # Below please assume that mariadb is meant when mysql is written.
-# For most genome annotation data
+# All user progress messages mention MariaDB, and no MySQL anymore.
 # (all non-mysql data is stored in /gbdb)
 MYSQLDIR=/var/lib/mysql
 
 # mysql admin binary, different path on OSX
 MYSQLADMIN=mysqladmin
 
 # mysql user account, different on OSX
 MYSQLUSER=mysql
 
 # mysql client command, will be adapted on OSX
 MYSQL=mysql
 
 # flag whether a mysql root password should be set
 # the root password is left empty on OSX, as mysql
 # there is not listening to a port
@@ -97,30 +97,33 @@
 # change this to 1 to rebuild CGIs locally from tarball
 BUILDKENT=${BUILDKENT:-0}
 
 # URL of a tarball with a the binaries of Apache/Mysql/Openssl
 BINPKGURL=http://hgwdev.gi.ucsc.edu/~max/gbInstall/mysqlApacheOSX_10.7.tgz
 # URL of tarball with the OSX CGI binaries
 CGIBINURL=http://hgwdev.gi.ucsc.edu/~max/gbInstall/kentCgi_OSX_10.7.tgz 
 # URL of tarball with a minimal Mysql data directory
 MYSQLDBURL=http://hgwdev.gi.ucsc.edu/~max/gbInstall/mysql56Data.tgz
 # mysql/apache startup script URL, currently only for OSX
 STARTSCRIPTURL=https://raw.githubusercontent.com/maximilianh/browserInstall/master/browserStartup.sh
 
 # the -t option allows to download only the genome databases, not hgFixed/proteome/go/uniProt
 # by default, this is off, so we download hgFixed and Co. 
 ONLYGENOMES=0
+
+# make apt-get fail on warnings
+APTERR="-o APT::Update::Error-Mode=any"
 # ---- END GLOBAL DEFAULT SETTINGS ----
 
 # ---- DEFAULT CONFIG FILES ------------------
 # We need to initialize hg.conf and apache.conf for the browser.
 # They are inline so we do not create a dependency on another file 
 # that has to be pushed to hgdownload when this script is updated
 
 # the read command always has an error exit code for here docs, so we deactivate 
 # exit on error for a moment
 set +e
 
 # syntax from http://stackoverflow.com/questions/23929235/multi-line-string-with-extra-space
 read -r -d '' APACHE_CONFIG_STR << EOF_APACHECONF
 # get rid of the warning at apache2 startup
 ServerName genomeBrowserMirror
@@ -561,31 +564,31 @@
 setMYCNF
 echo Deactivating MySQL strict mode
 sed -Ei '/^.(mysqld|server).$/a sql_mode='  $MYCNF
 }
 
 function mysqlAllowOldPasswords
 # mysql >= 8 does not allow the old passwords anymore. But our client is still compiled
 # with the old, non-SHA256 encryption. So we must deactivate this new feature.
 # We do not support MySQL anymore, so this function could be removed
 {
 echo2 'Checking for Mysql version >= 8 (not officially supported by our software)'
 
 MYSQLMAJ=`mysql -e 'SHOW VARIABLES LIKE "version";' -NB | cut -f2 | cut -d. -f1`
 setMYCNF
 if [ "$MYSQLMAJ" -ge 8 ] ; then
-    echo2 'Mysql >= 8 found, checking if default-authentication allows native passwords'
+    echo2 'Mysql/MariaDB >= 8 found, checking if default-authentication allows native passwords'
     if grep -q default-authentication $MYCNF; then
         echo2 "default-authentication already set in $MYCNF"
     else
 	echo2 Changing $MYCNF to allow native passwords and restarting Mysql
 	echo '[mysqld]' >> $MYCNF
         echo 'default-authentication-plugin=mysql_native_password' >> $MYCNF
 	stopMysql
 	startMysql
     fi
 fi
 }
 
 
 # oracle's mysql install e.g. on redhat distros does not secure mysql by default, so do this now
 # this is copied from Oracle's original script, on centos /usr/bin/mysql_secure_installation
@@ -944,50 +947,45 @@
            rm -f $APACHEDIR/ext/configOk.flag 
        fi
 
        # directory with .pid files has to be writeable
        chmod a+w $APACHEDIR/ext/logs
        # directory with .socket has to be writeable
        chmod a+w $APACHEDIR/ext
 
        touch $APACHEDIR/ext/src/allBuildOk.flag
 
    fi
 
    # configure apache and mysql 
    if [ ! -f $APACHEDIR/ext/configOk.flag ]; then
        cd $APACHEDIR/ext
-       echo2 Creating mysql config in $APACHEDIR/ext/my.cnf
+       echo2 Creating MariaDb config in $APACHEDIR/ext/my.cnf
        # avoid any write-protection issues
        if [ -f $APACHEDIR/ext/my.cnf ]; then
            chmod u+w $APACHEDIR/ext/my.cnf 
        fi
        echo '[mysqld]' > my.cnf
        echo "datadir = $APACHEDIR/mysqlData" >> my.cnf
        echo "default-storage-engine = myisam" >> my.cnf
        echo "default-tmp-storage-engine = myisam" >> my.cnf
        echo "skip-innodb" >> my.cnf
        echo "skip-networking" >> my.cnf
        echo "socket = $APACHEDIR/ext/mysql.socket" >> my.cnf
        echo '[client]' >> my.cnf
        echo "socket = $APACHEDIR/ext/mysql.socket" >> my.cnf
 
-       # configure mysql
-       #echo2 Creating Mysql system databases
-       #mkdir -p $MYSQLDIR
-       #scripts/mysql_install_db --datadir=$MYSQLDIR
-       #SET_MYSQL_ROOT=1 # not needed with skip-networking
        cd $APACHEDIR
        # download minimal mysql db
        downloadFile $MYSQLDBURL | tar xz
        chown -R $MYSQLUSER:$MYSQLUSER $MYSQLDIR
 
        # configure apache
        echo2 Configuring Apache via files $APACHECONFDIR/httpd.conf and $APACHECONF
        echo "$APACHE_CONFIG_STR" > $APACHECONF
        # include browser config from apache config
        echo2 Appending browser config include line to $APACHECONFDIR/httpd.conf
        echo Include conf/001-browser.conf >> $APACHECONFDIR/httpd.conf
        # no need for document root, note BSD specific sed option -i
        # $SEDINPLACE 's/^DocumentRoot/#DocumentRoot/' $APACHECONFDIR/httpd.conf
        # server root provided on command line, note BSD sed -i option
        $SEDINPLACE 's/^ServerRoot/#ServerRoot/' $APACHECONFDIR/httpd.conf
@@ -1007,127 +1005,126 @@
        echo2 Creating $APACHEDIR/browserStartup.sh
 
        downloadFile $STARTSCRIPTURL > $APACHEDIR/browserStartup.sh
        chmod a+x $APACHEDIR/browserStartup.sh
 
        # allowing any user to write to this directory, so any user can execute browserStartup.sh
        chmod -R a+w $APACHEDIR/ext
        # only mysql does not tolerate world-writable conf files
        chmod a-w $APACHEDIR/ext/my.cnf
 
        # development machine + mysql only reachable from localhost = empty root pwd
        # secureMysql - not needed
        touch $APACHEDIR/ext/configOk.flag 
    fi
 
-   echo2 Running $APACHEDIR/browserStartup.sh to start mysql and apache
+   echo2 Running $APACHEDIR/browserStartup.sh to start MariaDB and apache
    $APACHEDIR/browserStartup.sh
-   echo2 Waiting for mysql to start
+   echo2 Waiting for MariaDB to start
    sleep 5
 }
 
 # function for Debian-specific installation of mysql and apache
 function installDebian ()
 {
     # update repos
     if [ ! -f /tmp/browserSetup.aptGetUpdateDone ]; then
        echo2 Running apt-get update
-       apt-get update
-       touch /tmp/browserSetup.aptGetUpdateDone
+       apt-get update $APTERR && touch /tmp/browserSetup.aptGetUpdateDone
     fi
 
     # the new tzdata package comes up interactive questions, suppress these
     export DEBIAN_FRONTEND=noninteractive
 
     echo2 Installing ghostscript and imagemagick
     waitKey
     # ghostscript for PDF export
     # imagemagick for the session gallery
     # r-base-core for the gtex tracks
     # python-mysqldb for hgGeneGraph
-    apt-get --no-install-recommends --assume-yes install ghostscript imagemagick wget rsync r-base-core curl gsfonts
+    apt-get $APTERR --no-install-recommends --assume-yes install ghostscript imagemagick wget rsync r-base-core curl gsfonts
     # python-mysqldb has been removed in almost all distros as of 2021
+    # There is no need to install Python2 anymore. Remove the following?
     if apt-cache policy python-mysqldb | grep "Candidate: .none." > /dev/null; then 
 	    echo2 The package python-mysqldb is not available anymore. Working around it
 	    echo2 by installing python2 and MySQL-python with pip2
 	    if apt-cache policy python2 | grep "Candidate: .none." > /dev/null; then 
                # Ubuntu >= 21 does not have python2 anymore - hgGeneGraph has been ported, so not an issue anymore
    	       echo2 Python2 package is not available either for this distro, so not installing Python2 at all.
 	    else
                # workaround for Ubuntu 16-20 - keeping this section for a few years, just in case
-               apt-get install --assume-yes python2 libmysqlclient-dev python2-dev wget gcc
+               apt-get install $APTERR --assume-yes python2 libmysqlclient-dev python2-dev wget gcc
     	       curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py
     	       python2 /tmp/get-pip.py
                if [ -f /usr/include/mysql/my_config.h ]; then
                    echo my_config.h found
                else
                    wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -P /usr/include/mysql/
                fi
                pip2 install MySQL-python
 	    fi
     else
 	    apt-get --assume-yes install python-mysqldb
     fi
 
     if [ ! -f $APACHECONF ]; then
         echo2
         echo2 Now installing Apache2.
         echo2 "Apache's default config /etc/apache2/sites-enable/000-default will be"
         echo2 "deactivated. A new configuration $APACHECONF will be added and activated."
         echo2 The apache modules include, cgid and authz_core will be activated.
         waitKey
 
         # apache and mysql are absolutely required
         # ghostscript is required for PDF output
-        apt-get --assume-yes install apache2 ghostscript
+        apt-get $APTERR --assume-yes install apache2 ghostscript
     
         # gmt is not required. install fails if /etc/apt/sources.list does not contain
         # a 'universe' repository mirror. Can be safely commented out. Only used
         # for world maps of alleles on the dbSNP page.
-        # apt-get install gmt
+        # apt-get $APTERR install gmt
         
         # activate required apache2 modules
         a2enmod include # we need SSI and CGIs
         a2enmod cgid
         a2enmod authz_core # see $APACHECONF why this is necessary
         #a2dismod deflate # allows to partial page rendering in firefox during page load
         
         # download the apache config for the browser and restart apache
         if [ ! -f $APACHECONF ]; then
           echo2 Creating $APACHECONF
           echo "$APACHE_CONFIG_STR" > $APACHECONF
           a2ensite 001-browser
           a2dissite 000-default
           service apache2 restart
         fi
     fi
 
     if [[ ! -f /usr/sbin/mysqld ]]; then
         echo2
         echo2 Now installing the Mysql server. 
         echo2 The root password will be set to a random string and will be written
         echo2 to the file /root/.my.cnf so root does not have to provide a password on
         echo2 the command line.
         waitKey
         moveAwayMyCnf
 
         # do not prompt in apt-get, will set an empty mysql root password
         export DEBIAN_FRONTEND=noninteractive
 	# Debian / Ubuntu 20 defaults to Mysql 8 and Mysql 8 does not allow rsync of myisam anymore
 	# -> we require mariaDb now
-        # apt-get --assume-yes install mysql-server
-        apt-get --assume-yes install mariadb-server
+        apt-get $APTERR --assume-yes install mariadb-server
 
         mysqlStrictModeOff
         startMysql
         # flag so script will set mysql root password later to a random value
         SET_MYSQL_ROOT=1
     fi
 
 }
 
 # download apache mysql libpng openssl into the current dir
 # and build them into $APACHEDIR/ext
 function buildApacheMysqlOpensslLibpng () 
 {
 echo2
 echo2 Now building cmake, openssl, pcre, apache and mysql into $APACHEDIR/ext
@@ -1467,93 +1464,95 @@
       echo2 Creating symlink /usr/local/apache/htdocs to /Library/WebServer/Documents
       sudo ln -s /Library/WebServer/Documents/ /usr/local/apache/htdocs 
    fi
 
    # switch on CGIs in Apple's Apache and restart it
    sudo sed -i '' -E 's/^\s*#(LoadModule cgid_module)/\1/; s/^\s*#(LoadModule cgi_module)/\1/' /etc/apache2/httpd.conf
    sudo /usr/sbin/apachectl restart
 }
 
 # install gcc, make etc so we can build the tree on linux
 function setupBuildLinux ()
 {
    echo2 Installing required linux packages from repositories: Git, GCC, G++, Mysql-client-libs, uuid, etc
    waitKey
    if [[ "$DIST" == "debian" ]]; then
-      apt-get install make git gcc g++ libpng-dev libmysqlclient-dev uuid-dev libfreetype-dev
+      apt-get --assume-yes $APTERR install make git gcc g++ libpng-dev libmysqlclient-dev uuid-dev libfreetype-dev libbz2-dev
    elif [[ "$DIST" == "redhat" ]]; then
       yum install -y git vim gcc gcc-c++ make libpng-devel libuuid-devel freetype-devel
    else 
       echo Error: Cannot identify linux distribution
       exit 100
    fi
 }
 
 # set this machine for browser development: install required tools, clone the tree, build it
 function buildTree () 
 {
    if [[ "$DIST" == "OSX" ]]; then
        setupBuildOsx
    else
        setupBuildLinux
    fi
 
    if [ ! -e ~/kent ]; then
       echo2 Cloning kent repo into ~/kent using git with --depth=1
       waitKey
       cd ~
       git clone https://github.com/ucscGenomeBrowser/kent.git --depth=1
    fi
 
    echo2 Now building CGIs from ~/kent to /usr/local/apache/cgi-bin 
-   echo2 Installing JS/HTML/CSS to /usr/local/apache/htdocs
+   echo2 Copying JS/HTML/CSS to /usr/local/apache/htdocs
    waitKey
    cd ~/kent/src
    make -j8 cgi-alpha
+   make -j8 htdocs
 }
 
 # main function, installs the browser on Redhat/Debian and potentially even on OSX
 function installBrowser () 
 {
     if [ -f $COMPLETEFLAG ]; then
         echo2 error: the file $COMPLETEFLAG exists. It seems that you have installed the browser already.
         echo2 If you want to reset the Apache directory, you can run '"rm -rf /usr/local/apache"' and 
         echo2 then run this script again.
         exit 100
     fi
 
     echo '--------------------------------'
     echo UCSC Genome Browser installation
     echo '--------------------------------'
-    echo Detected OS: $OS/$DIST, Version $VERNUM, Release: $VER
+    echo CPU type: $MACH, detected OS: $OS/$DIST, Version: $VERNUM, Release: $VER
     echo 
     echo This script will go through three steps:
     echo "1 - setup apache and mysql, open port 80, deactivate SELinux"
     echo "2 - copy CGI binaries into $CGIBINDIR, html files into $HTDOCDIR"
     echo "3 - optional: download genome assembly databases into mysql and /gbdb"
     echo
-    echo This script will now install and configure Mysql and Apache if they are not yet installed. 
+    echo This script will now install and configure MariaDB and Apache if they are not yet installed. 
     echo "Your distribution's package manager will be used for this."
-    echo If Mysql is not installed yet, it will be installed, secured and a root password defined.
+    echo If MariaDB is not installed yet, it will be installed, secured and a root password defined.
+    echo The MariaDB root password will be written into root\'s \~/.my.cnf
     echo
     echo This script will also deactivate SELinux if active and open port 80/http.
     waitKey
 
     # -----  OS - SPECIFIC part -----
     if [ ! -f $COMPLETEFLAG ]; then
        if [[ "$DIST" == "OSX" ]]; then
-          #installOsx
+          #installOsx <- not used anymore, but maybe one day
  	  # on OSX, install clang, brew, kent and build the CGIs from scratch
           buildTree
        elif [[ "$DIST" == "debian" ]]; then
           installDebian
        elif [[ "$DIST" == "redhat" ]]; then
           installRedhat
        fi
     fi
     # OS-specific mysql/apache installers can SET_MYSQL_ROOT to 1 to request that the root
     # mysql user password be changed
 
     # ---- END OS-SPECIFIC part -----
 
     mysqlAllowOldPasswords
 
@@ -1602,99 +1601,102 @@
     # CGI installation
     # -------------------
     echo2
     echo2 Creating $CGIBINDIR and $HTDOCDIR and downloading contents from UCSC
     waitKey
     
     # create apache directories: HTML files, CGIs, temporary and custom track files
     mkdir -p $HTDOCDIR $CGIBINDIR $TRASHDIR $TRASHDIR/customTrash
     
     # the CGIs create links to images in /trash which need to be accessible from htdocs
     cd $HTDOCDIR
     if [ ! -e $TRASHDIR ]; then
         ln -fs $TRASHDIR
     fi
     
-    # write the sample hg.conf ti the cgi-bin directory
+    # write the sample hg.conf to the cgi-bin directory
     echo2 Creating Genome Browser config file $CGIBINDIR/hg.conf
     echo "$HG_CONF_STR" > $CGIBINDIR/hg.conf
     
     # hg.conf tweaks
     # redhat distros have the same default socket location set in mysql as
     # in our binaries. To allow mysql to connect, we have to remove the socket path.
     # Also change the psxy path to the correct path for redhat, /usr/bin/
     if [ "$DIST" == "redhat" ]; then
        echo2 Adapting mysql socket locations in $APACHEDIR/cgi-bin/hg.conf
        sed -i "/socket=/s/^/#/" $CGIBINDIR/hg.conf
        sed -i "/^hgc\./s/.usr.lib.gmt.bin/\/usr\/bin/" $CGIBINDIR/hg.conf
     elif [ "$DIST" == "OSX" ]; then
        # in OSX adapt the sockets
        # note that the sed -i syntax is different from linux
        echo2 Adapting mysql socket locations in $CGIBINDIR/hg.conf
-       #sockFile=$APACHEDIR/ext/mysql.socket
        sockFile=`mysql -NBe 'show variables like "socket"' | cut -f2`
        $SEDINPLACE "s|^#?socket=.*|socket=$sockFile|" $CGIBINDIR/hg.conf
        $SEDINPLACE "s|^#?customTracks.socket.*|customTracks.socket=$sockFile|" $CGIBINDIR/hg.conf
        $SEDINPLACE "s|^#?db.socket.*|db.socket=$sockFile|" $CGIBINDIR/hg.conf
        $SEDINPLACE "s|^#?central.socket.*|central.socket=$sockFile|" $CGIBINDIR/hg.conf
     fi
     # check if UCSC or genome-euro MySQL server is closer
     echo comparing latency: genome.ucsc.edu Vs. genome-euro.ucsc.edu
     eurospeed=$( (time -p (for i in `seq 10`; do curl -sSI genome-euro.ucsc.edu > /dev/null; done )) 2>&1 | grep real | cut -d' ' -f2 )
     ucscspeed=$( (time -p (for i in `seq 10`; do curl -sSI genome.ucsc.edu > /dev/null; done )) 2>&1 | grep real | cut -d' ' -f2 )
     if [[ $(awk '{if ($1 <= $2) print 1;}' <<< "$eurospeed $ucscspeed") -eq 1 ]]; then
        echo genome-euro seems to be closer
        echo modifying hg.conf to pull data from genome-euro instead of genome
        sed -i s/slow-db.host=genome-mysql.soe.ucsc.edu/slow-db.host=genome-euro-mysql.soe.ucsc.edu/ $CGIBINDIR/hg.conf
        sed -i "s#gbdbLoc2=http://hgdownload.soe.ucsc.edu/gbdb/#gbdbLoc2=http://hgdownload-euro.soe.ucsc.edu/gbdb/#" $CGIBINDIR/hg.conf
        HGDOWNLOAD=hgdownload-euro.soe.ucsc.edu
     else
        echo genome.ucsc.edu seems to be closer
        echo not modifying $CGIBINDIR/hg.conf
     fi
 
     # download the CGIs
     if [[ "$OS" == "OSX" ]]; then
         #setupCgiOsx
         echo2 Running on OSX, assuming that CGIs are already built into /usr/local/apache/cgi-bin
+    elif [[ "$MACH" == "aarch64" ]]; then
+        echo2 Running on an ARM CPU: need to build CGIs and htdocs locally from source
+        buildTree
     else
         # don't download RNAplot, it's a 32bit binary that won't work anywhere anymore but at UCSC
         # this means that hgGene cannot show RNA structures but that's not a big issue
         $RSYNC -avzP --exclude=RNAplot $HGDOWNLOAD::cgi-bin/ $CGIBINDIR/
         # now add the binaries for dot and RNAplot 
         $RSYNC -avzP $HGDOWNLOAD::genome/admin/exe/external.x86_64/RNAplot $CGIBINDIR/
         $RSYNC -avzP $HGDOWNLOAD::genome/admin/exe/external.x86_64/loader/dot_static $CGIBINDIR/loader/
     fi
 
     # download the html docs, exclude some big files on OSX
     # try to minimize storage for OSX, mostly laptops
-    if [ "$OS" == "OSX" ]; then
+    if [ "$OS" == "OSX" -o "$MACH" == "aarch64" ]; then
             #$RSYNC --delete -azP --exclude=training --exclude=ENCODE --exclude=encode --exclude=rosenbloom.pdf --exclude=pubs*.pdf --exclude=*.{bb,bam,bai,bw,gz,2bit} --exclude=goldenpath $HGDOWNLOAD::htdocs/ $HTDOCDIR/
             echo2 Not syncing htdocs folder, assuming that these were built from source.
             echo2 PDF and other large files only present at UCSC will be missing from htdocs.
             waitKey
     else
             rm -rf $APACHEDIR/htdocs/goldenpath
             $RSYNC -avzP --exclude ENCODE/**.pdf $HGDOWNLOAD::htdocs/ $HTDOCDIR/
     fi
     
     # assign all files just downloaded to a valid user. 
     # This also allows apache to write into the trash dir
     if [ "$OS" == "OSX" ]; then
         echo2 OSX: Not chowning /usr/local/apache subdirectories
     else
         chown -R $APACHEUSER:$APACHEUSER $CGIBINDIR $HTDOCDIR $TRASHDIR
+    fi
     
     touch $COMPLETEFLAG
 
     echo2 Install complete. You should now be able to point your web browser to this machine
     echo2 and test your UCSC Genome Browser mirror. It will be too slow for practical use.
     echo2
     echo2 Notice that this mirror is still configured to use Mysql and data files loaded
     echo2 through the internet from UCSC. From most locations on the world, this is very slow.
     echo2 It also requires an open outgoing TCP port 3306 for Mysql to genome-mysql.soe.ucsc.edu/genome-euro-mysql.soe.ucsc.edu,
     echo2 and open TCP port 80 to hgdownload.soe.ucsc.edu/hgdownload-euro.soe.ucsc.edu.
     echo2
     echo2 To finish the installation, you need to download genome data to the local
     echo2 disk. To download a genome assembly and all its files now, call this script again with
     echo2 the parameters 'download "<assemblyName1> <assemblyName2> ..."', e.g. '"'bash $0 mirror mm10 hg19'"'
     echo2 
@@ -1962,30 +1964,33 @@
     echo2 - to genome-mysql.soe.ucsc.edu, port 3306, to load MySQL tables
     echo2 - to hgdownload.soe.ucsc.edu, port 80, to download non-MySQL data files
     echo2 - or the above two servers European counterparts:
     echo2   genome-euro-mysql.soe.ucsc.edu and hgdownload-euro.soe.ucsc.edu
     echo2
     showMyAddress
     goOnline
 }
 
 function checkDownloadUdr () 
 # download the faster downloader udr that is compatible with rsync and change the global variable RSYNC
 {
     if [[ "$OS" == "OSX" ]]; then 
         return
     fi
+    if [[ "$MACH" == "aarch64" ]]; then 
+        return
+    fi
 
     RSYNC="/usr/local/bin/udr rsync"
 
     # Download my own statically compiled udr binary
     if [[ ! -f /usr/local/bin/udr ]]; then
       echo2 'Downloading download-tool udr (UDP-based rsync with multiple streams) to /usr/local/bin/udr'
       waitKey
       downloadFile $UDRURL > /usr/local/bin/udr
       chmod a+x /usr/local/bin/udr
     fi
 }
 
 function cleanTrash () 
 {
     echo2 Removing files older than one day in $TRASHDIR, not running on $TRASHDIR/ct
@@ -2139,30 +2144,31 @@
       echo On-the-fly mode activated: data is loaded from UCSC when not present locally.
       echo Use the parameter -o to switch to offline mode.
       exit 0
       ;;
     \?)
       echo "Invalid option: -$OPTARG" >&2
       ;;
   esac
 done
 # reset the $1, etc variables after getopts
 shift $(($OPTIND - 1))
 
 # detect the OS version, linux distribution
 unameStr=`uname`
 DIST=none
+MACH=`uname -m`
 
 if [[ "$unameStr" == MINGW32_NT* ]] ; then
     echo Sorry Windows/CYGWIN is not supported
     exit 100
 fi
 
 # set a few very basic variables we need to function
 if [[ "$unameStr" == Darwin* ]]; then
     OS=OSX
     DIST=OSX
     VER=`sw_vers -productVersion`
     APACHECONFDIR=$APACHEDIR/ext/conf # only used by the OSX-spec part
     APACHECONF=$APACHECONFDIR/001-browser.conf
     APACHEUSER=_www # predefined by Apple
     MYSQLDIR=$APACHEDIR/mysqlData
@@ -2210,36 +2216,30 @@
 
 if [ "$DIST" == "none" ]; then
     echo Sorry, unable to detect your linux distribution. 
     echo Currently only Debian and Redhat-style distributions are supported.
     exit 100
 fi
 
 lastArg=${*: -1:1}
 if [[ "$#" -gt "1" && ( "${2:0:1}" == "-" ) || ( "${lastArg:0:1}" == "-" )  ]]; then
   echo "Error: The options have to be specified before the command, not after it."
   echo
   echo "$HELP_STR"
   exit 100
 fi
 
-UNAMEM=`uname -m`
-if [[ ! "$UNAMEM" == *_64 && ! "$OS" == "OSX" ]]; then
-  echo "Sorry, the Genome Browser requires a 64bit linux or OSX."
-  exit 100
-fi
-
 if [[ "$EUID" == "0" ]]; then
   if [[ "$OS" == "OSX" ]]; then
      echo "On OSX, this script must not be run with sudo, so we can install brew."
      echo "sudo -H $0"
      exit 100
   fi
 else
   if [[ "$OS" != "OSX" ]]; then
      echo "On Linux, this script must be run as root or with sudo like below, so we can run apt/yum:"
      echo "sudo -H $0"
      exit 100
   fi
 fi
 
 if [ "${1:-}" == "install" ]; then