Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 two three sections:

  • Toolchain setup
  • Kernel generation
  • Root filesystem generation

...

  • Create a new folder in a known existing folder via mkdir toolchain
  • Download the toolchain from linaro for the appropirate 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-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

...

  • 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 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
  • 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

...

  • 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 cloneclone 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.