Skip to content

Instantly share code, notes, and snippets.

@takumin
Last active August 21, 2021 20:01
Show Gist options
  • Save takumin/0cb9d079778ce7997e5b675ccb566caa to your computer and use it in GitHub Desktop.
Save takumin/0cb9d079778ce7997e5b675ccb566caa to your computer and use it in GitHub Desktop.
buildroot qemu-system-aarch64 external toolchain

Requirements

How to Running

 $ sudo apt install qemu-system-arm
 $ make O=/tmp/build BR2_DEFCONFIG=/tmp/qemu_aarch64_virt_defconfig defconfig
 $ make O=/tmp/build
 $ /tmp/build/images/start-qemu.sh
# Architecture
BR2_aarch64=y
BR2_cortex_a53=y
# System
BR2_INIT_SYSTEMD=y
BR2_SYSTEM_DHCP="eth0"
BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
BR2_TARGET_GENERIC_PASSWD_SHA512=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
BR2_TARGET_ROOTFS_TAR=n
# Image
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
# Extended Attributes
BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES=y
# Linux headers same as kernel, a 5.10 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.60"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
# Mirrors
BR2_KERNEL_MIRROR="https://ftp.jaist.ac.jp/pub/Linux/kernel.org"
BR2_GNU_MIRROR="https://ftp.jaist.ac.jp/pub/GNU"
BR2_CPAN_MIRROR="https://ftp.jaist.ac.jp/pub/CPAN"
# Toolchain
BR2_TOOLCHAIN=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y
BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/gcc-aarch64-none-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-none-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-none-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_GCC_10=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_20=y
BR2_TOOLCHAIN_EXTERNAL_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP_STRONG=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment