TWiki
>
SystemOnChip Web
>
CentOSForZynqMP
(2019-07-24,
RalfSpiwoks
)
(raw view)
E
dit
A
ttach
P
DF
---+*Setup* In our example we are using a host PC running CERN CentOS 7 for x86_64 and a ZCU102 evaluation board with a Xilinx Zynq Ultrascale+ MPSoC (ZynqMP) or an ATLAS MUCTPI V1 with a Xilinx Zynq SoC (Zynq). The host PC and the ZynqMP or Zynq are connected in a private network. In this network the IP address of the host is 192.168.1.1 and the one of the ZynqMP or Zynq is 192.168.1.10 . In addition, the host PC is in the CERN public network and has full internet access. %BR% ---#*Create a CentOS/aarch64 or armv7hl root file system* Cross install a root file system from scratch using dnf for both aarch64 and armv7hl.%BR% In our case the filesystem will be located at =$ROOTFS_PATH=/home/ppapageo/NFS=. ---##*Install dnf* <sticky> %CODE{ lang="bash" }% sudo yum install dnf %ENDCODE% ---##*Install qemu* Get the qemu static executable. Qemu has to exist in the same directory in respect to the host and target filesystems. In our case we copy it to the =/usr/local/bin= the host and target root file system. <sticky> %CODE{ lang="bash" }% export ROOTFS_PATH=/your/target/path #aarch64 wget https://github.com/multiarch/qemu-user-static/releases/download/v4.0.0/qemu-aarch64-static chmod +x qemu-aarch64-static mkdir -p $ROOTFS_PATH/usr/local/bin cp -a qemu-aarch64-static $ROOTFS_PATH/usr/local/bin sudo cp -a qemu-aarch64-static /usr/local/bin #armv7hl wget https://github.com/multiarch/qemu-user-static/releases/download/v4.0.0/qemu-arm-static chmod +x qemu-arm-static mkdir -p $ROOTFS_PATH/usr/local/bin cp -a qemu-arm-static $ROOTFS_PATH/usr/local/bin sudo cp -a qemu-arm-static /usr/local/bin %ENDCODE% </sticky> We also need inform the binfmt_misc to use the static qemu: %CODE{ lang="bash" }% #aarch64 sudo vim /etc/binfmt.d/qemu-aarch64.conf ##clear the file and add the following line: :qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-aarch64-static: #armv7hl sudo vim /etc/binfmt.d/qemu-arm.conf ##clear the file and add the following line: :qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm-static: %ENDCODE% Restart and verify: %CODE{ lang="bash" }% sudo systemctl restart systemd-binfmt.service #aarch64 sudo cat /proc/sys/fs/binfmt_misc/qemu-aarch64 #armv7hl sudo cat /proc/sys/fs/binfmt_misc/qemu-arm %ENDCODE% ---##*Install the root file system* Download and run the mkrootfs python script. %BR% Add any extra packages in a file and pass it to the =--extra= option. (e.g. =extra_rpms.txt= ) %CODE{ lang="bash" }% git clone ssh://git@gitlab.cern.ch:7999/system-on-chip/centos-rootfs.git cd centos-rootfs #aarch64 sudo python mkrootfs.py --root=$ROOTFS_PATH --arch=aarch64 --extra=extra_rpms.txt #armv7hl sudo python mkrootfs.py --root=$ROOTFS_PATH --arch=armv7hl --extra=extra_rpms.txt %ENDCODE% _Special thanks to Matthias Wittgen, SLAC, who authored the original version of this script._ %BR% %BR% ---#*Boot the ZynqMP with the CentOS/aarch64 root file system* ---##*Boot the ZynqMP* _Make sure you have configured the network to [[CentOSForZynqMPMisc#NFSConf][accept NFS through the firewall]]._ %BR% Prepare the SD card (we are using [[GettingStartedWithYocto][yocto]] for the preparation of the boot files).%BR% In the uEnv.txt file on the SD card, add the nfs boot options in the bootargs; change the IP address and root filesystem path accordingly:%BR% <sticky> %CODE{ lang="bash" }% bootargs=earlycon clk_ignore_unused root=/dev/nfs rootfstype=nfs ip=192.168.1.10:::255.255.255.0:zcu102:eth0:on nfsroot=192.168.1.1:/home/ppapageo/NFS,nfsvers=3 rw rootwait %ENDCODE% </sticky> ---##*Set up an ntp server* In order for the clocks of the host PC and the ZynqMP to be synchronized, an ntp server and client setup is needed. We use a [[CentOSForZynqMPMisc#UseChrony][chrony daemon]]. ---##*Install additional packages using dnf* Additional packages can be installed with dnf from repositories specified in the .conf file. %BR% For example: %BR% <sticky> %CODE{ lang="bash" }% cd centos-rootfs #aarch64 dnf -y -c dnf.conf --forcearch=aarch64 \ --releasever=7 \ --repo=centos-base,centos-updates,centos-extras,arm64-epel \ --installroot=$ROOTFS_PATH \ install ${your_package} #armv7hl dnf -y -c dnf.conf --forcearch=armv7hl \ --releasever=7 \ --repo=centos-base,centos-updates,centos-extras,arm-epel \ --installroot=$ROOTFS_PATH \ install ${your_package} %ENDCODE% When running dnf update and some packages fail to install due to scriptlet failures try the same command with the option =--setopt=tsflags=noscripts= . %BR% %BR% #BuildGCC ---#*Build and install a specific version of GCC* CentOS usually comes with a version of gcc which might be outdated for other software that you may want to build. As an example, we are building gcc version 8.2 as required by ROOT and the ATLAS TDAQ software. <sticky> %CODE{ lang="bash" }% wget https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz tar -xJf gcc-8.2.0.tar.xz cd gcc-8.2.0 mkdir build cd build ../configure make -j $(($(nproc) + 1)) make install -j $(($(nproc) + 1)) %ENDCODE% %BR% %BR% #BuildRoot ---#*Download and compile ROOT* Install external dependencies: =cmake3 libX11-devel libXext-devel libXpm-devel libXft-devel redhat-lsb-core python-devel= <sticky> %CODE{ lang="bash" }% git clone https://github.com/root-project/root.git ${PREFIX}/ROOT %ENDCODE% <sticky> Install a newer version of GCC, e.g. GCC 8.2 (see above).%BR% Root tries to download some packages from the internet. If your board has not internet access (you can give access the board by following [[CentOSForZynqMPMisc#UseIpMasq][this guide]]), you will have to download them manually from the host side. The target urls are usually located at =${package}/src/${package}-stamp/${package}-urlinfo.txt/-gitinfo.txt=. In this case: %CODE{ lang="bash" }% export PREFIX=/root/installation/path wget http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/vdt-0.4.2.tar.gz -P ${PREFIX}/ROOT/build/VDT-prefix/src wget http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/openssl-1.0.2o.tar.gz -P ${PREFIX}/ROOT/build/builtins/openssl/OPENSSL-prefix/src wget http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/tbb2019_U1.tar.gz -P ${PREFIX}/ROOT/build/TBB-prefix/src %ENDCODE% Comment out the downloading section on the .cmake file: <sticky> %CODE{ lang="bash" }% cd ${PREFIX}/ROOT/build/interpreter/llvm/src/tools/cling/tools/plugins/clad/clad-prefix/tmp/ vi clad-gitclone.cmake git clone https://github.com/vgvassilev/clad.git ${PREFIX}/ROOT/build/interpreter/llvm/src/tools/cling/tools/plugins/clad/clad-prefix/src/clad %ENDCODE% Now on the ZynqMP side: <sticky> %CODE{ lang="bash" }% export CXX=/usr/local/bin/g++ export CC=/usr/local/bin/gcc export LIBRARY_PATH=/usr/lib64:${LIBRARY_PATH} #the libstdc++ of the locally built gcc is located here cd build cmake3 ../ make -j $(($(nproc) + 1)) %ENDCODE% Then you can source and use ROOT: <sticky> %CODE{ lang="bash" }% source ${PREFIX}/ROOT/build/bin/thisroot.sh %ENDCODE% %BR% %BR% ---#*Build ATLAS TDAQ* As an example of a more complex software we are building a [[BuildTDAQForZynqMP][subset of the ATLAS TDAQ software]]. The instructions of the process can give you a general idea on how the building can be achieved. For the actual software, access to the ATLAS TDAQ repositories will be required. %BR% %BR% ---#*Cross Compile with CentOS sysroot* CrossCompileWithCentOS %BR% %BR% ---#*Miscellaneous* Visit CentOSForZynqMPMisc for hints and tips concerning system administration.%BR% %BR% -- Main.PanagiotisPapageorgiou - 2019-05-17
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r30
<
r29
<
r28
<
r27
<
r26
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r30 - 2019-07-24
-
RalfSpiwoks
Log In
SystemOnChip
SystemOnChip Web
Create New Topic
Index
Search
Changes
Notifications
Statistics
Preferences
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Cern Search
TWiki Search
Google Search
SystemOnChip
All webs
Copyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback