Skip to end of metadata
Go to start of metadata

This chapter guides through the tasks which have to be done to create a user compiled kernel and root filesystem within a Linux system as mentioned in page "Board bring-up overview for TEI0022". It should be done in the following three sections:

  • Toolchain setup
  • Kernel generation
  • Root filesystem generation

The section "Toolchain setup" describes preparing steps which are necessary for kernel generation, while the section "Kernel generation" handles the creation of the kernel, and the section "Root filesystem generation" shows the creation of the root filesystem.

Preparation

This guide leads through the toolchain setup task.

  • Create a new folder in a known existing folder via mkdir toolchain
  • Download the toolchain from linaro for the appropriate architecture and version via e.g. wget http://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz
  • Decompress the tar-archiv via tar -xvf gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz
  • Set the CROSS_COMPILE variable to cross-compile the source code via export CROSS_COMPILE=$PWD/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

Kernel generation

This guide leads through the kernel generation task.

  • Create a new folder in a known existing folder via mkdir software
  • Change into the new folder via cd software
  • Clone the git repository via git clone https://github.com/altera-opensource/linux-socfpga.git
  • Change into the new folder via cd linux-socfpga
  • Select one of the tags and check it out via git checkout rel_socfpga-4.14.130-ltsi_21.10.01_pr
  • Load the default configuration for the kernel via make ARCH=arm socfpga_defconfig
  • Install packages for kernel configuration via sudo apt-get install libncurses5-dev
  • Open the kernel configuration dialogue via make ARCH=arm menuconfig
  • Configure the kernel in this window:
    • General Setup → Disable Automatically append version information to the version string
    • Enable the block layer → Support for large (2TB+) block devices and files
  • Generate the kernel via make ARCH=arm LOCALVERSION= zImage
  • After compilation, which can last a longer time, the kernel should be in folder arch/arm/boot

This zImage file is important to create the SD card for booting.

Root filesystem generation

This guide leads through the rootfile system generation.

  • Create a new folder in a known existing folder via mkdir rootfs
  • Change into the new folder via cd rootfs
  • Clone the git repository via git clone https://github.com/buildroot/buildroot
  • Change into the new folder via cd buildroot
  • Look into the branch overview inside the repository via git branch -a
  • Select one of the branches and check it out via git checkout <selection>
  • Open the buildroot configuration dialogue via make nconfig
  • Configure the buildroot in this window:
    • Target options → Target Architecture → ARM (little endian)
    • Target options → Target Architecture Variant → cortex-A9
    • Target options → Target ABI → EABI
    • Target options → Enable NEON SIMD extension support
    • Target options → Floating point strategy → NEON
    • Toolchain → Toolchain type → Buildroot toolchain
    • System Configuration → System hostname → <Select a name>
    • System Configuration → System banner → <Select a system banner>
    • System Configuration → Init System → BusyBox
    • System Configuration → /dev management → Dynamic using devtmpfs only
    • System Configuration → Enable root login with password
    • System Configuration → Root password → root
    • System Configuration →Enable Run a getty (login prompt) after boot
    • Filesystem images → Enable tar the root filesystem
  • Save the configuration via F6 → Enter → Enter
  • Exit the configuration menu via F9
  • Configure BusyBox if desired via make busybox-menuconfig
  • Generate the root filesystem via make all
  • After compilation, which can can last a longer time, the root filesystem (rootfs.tar) should be in folder buildroot/output/images/

This root filesystem is important to create the SD card for booting.

  • No labels