You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

This chapter guides through the tasks which have to be done to create a user compiled kernel within a Linux system as mentioned in page "Board bring-up overview for TEI0022". It should be done in the following two 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 appropirate 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-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-sodfpga.git
  • Change into the new folder via cd linux-socfpga
  • Look into the tags inside the repository via git tag -l rel*
  • Select one of the tags and check it out via git checkout rel_socfpga-<selection>
  • 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 according its needs or close the kernel configuration if no configuration should be done.
  • Generate the kernel via make ARCH=arm LOCALVERSION= zImage
  • If the previous command does not work, try to use this one: make ARCH=arm CROSS-COMPILE=arm-linux-gnueabihf LOCALVERSION= zImage
  • After compilation, which can 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/




  • No labels