继之前在win11安装好wsl2之后,开始搭建aarch64工作环境,方便进行aarch64版本的Linux和ATF等代码调试。
Preutils tools
Gcc
sudo apt-get install gcc
Gcc-aarch64-linux-gnu
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
Dependency packages
To install the essential packages followed, create a .sh bash file, write these apt commands to the file. Then, just run the bash. for example:
touch dependency-install.sh
chmod a+x dependency-install.sh
./dependency-install.sh
sudo apt-get install -y android-tools-adb
sudo apt-get install -y android-tools-fastboot
sudo apt-get install -y autoconf
sudo apt-get install -y automake
sudo apt-get install -y bc
sudo apt-get install -y bison
sudo apt-get install -y build-essential
sudo apt-get install -y cscope
sudo apt-get install -y curl
sudo apt-get install -y device-tree-compiler
sudo apt-get install -y expect
sudo apt-get install -y flex
sudo apt-get install -y ftp-upload
sudo apt-get install -y gdisk
sudo apt-get install -y iasl
sudo apt-get install -y libattr1-dev
sudo apt-get install -y libc6:i386
sudo apt-get install -y libcap-dev
sudo apt-get install -y libcap-ng-dev
sudo apt-get install -y libfdt-dev
sudo apt-get install -y libftdi-dev
sudo apt-get install -y libglib2.0-dev
sudo apt-get install -y libhidapi-dev
sudo apt-get install -y libncurses5-dev
sudo apt-get install -y libpixman-1-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libstdc++6:i386
sudo apt-get install -y libtool
sudo apt-get install -y libz1:i386
sudo apt-get install -y make
sudo apt-get install -y mtools
sudo apt-get install -y netcat
sudo apt-get install -y ninja-build
sudo apt-get install -y python-crypto
sudo apt-get install -y python-serial
sudo apt-get install -y python-wand
sudo apt-get install -y unzip
sudo apt-get install -y uuid-dev
sudo apt-get install -y xdg-utils
sudo apt-get install -y xterm
sudo apt-get install -y xz-utils
sudo apt-get install -y zlib1g-dev
special dependency
For some special packages, it can’t be installed by apt. instead, manually.
slirp
# not forget to set gitlab ssh key
git clone https://gitlab.freedesktop.org/slirp/libslirp.git
cd libslirp
sudo apt-get install meson
meson build
sudo ninja -C build install
# check it
ldconfig -p |grep slirp
gdb
sudo apt install gdb-multiarch
qemu
get source code. Here, I got version 7.2.0
wget https://download.qemu.org/qemu-7.2.0.tar.xz
tar -xvJf qemu-7.2.0.tar.xz
configure
./configure --target-list=aarch64-softmmu --enable-fdt --disable-kvm --disable-xen --enable-virtfs --enable-slirp
build
make -j64
Q&A
exchange apt source
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32