top of page

Use External Toolchain in Build root (from Part 1) to generate Rootfs/Linux - Part 2

  • Writer: Anup Halarnkar
    Anup Halarnkar
  • Apr 6, 2023
  • 2 min read

Updated: Nov 12, 2024


Buildroot_Part2

For some months, we at WhileOne Techsoft Pvt. Ltd. have been helping our customer setup a system to validate the performance of their SoC platform. In this context, we had to bring up an aarch64 Linux based target image to run on their proprietary hardware SoC platform.


Part -1 of this series explains how to build an External Toolchain with BuildRoot.


Part -2 of this series explains how to build a Target Linux image and Rootfs in BuildRoot using the External Toolchain that we built in Part -1


Part -3 of this series explains how to integrate the generated External Toolchain binaries inside the Target Linux image using BuildRoot


In the following steps we shall configure the Buildroot to use the External Toolchain tarball(refer Part -1)to build the Kernel and Rootfs images and copy the extracted tarball binaries to the target under directory /usr


External Toolchain-Rootfs/Linux

We have to modify the configuration and then rebuild using clean option. This will delete all output folders and files. So, its very important to move the tarball to some other location outside the ‘buildroot’ folder. If not yet done, please do this before proceeding ahead


1. Start menuconfig

make menuconfig

We only modify a few options. Rest of the options will remain the same as was configured earlier in Part -1. Target Options and Build Options shall remain same. So no need to change them


2. Modifying Toolchain Options:


Modifying toolchain Options in BuildRoot

a. Select option ‘External Toolchain’

b. Modify option of Toolchain origin to ‘Toolchain to be downloaded and installed’

c. Update URL to ‘file:///path/to/sdk-tarball’ as shown below.



Toolchain URL

d. Modify External Toolchain GCC version to ’11.x’(We used GCC-11.x to cross-compile the external toolchain in Part -1)


GCC version and Kernel Headers

e. Modify External Toolchain kernel headers series to ‘5.4.x’(This was same configuration that we had kept for tarball earlier in Part -1)

f. Modify External Toolchain C library to ‘glibc/eglibc’

g. Disable ‘Toolchain has RPC support’(Please disable if it was not selected earlier during tarball generation)

h. Enable support for C++ and Fortran(This was enabled earlier for tarball configuration)


Setting other toolchain options


Toolchain

a. Modify Init system from ‘None’ to ‘BusyBox’


Configuring the Init System

b. Enable option ‘Use symlinks to /usr for /bin, /sbin and /lib

c. Modify default BusyBox shell from ‘None’ to ‘/bin/sh/’



System Configuration

7. Now, save and exit from menuconfig


8. Build with new configuration settings


make clean all

Building target Linux Image and Rootfs

9. Once the build is successful, the resulting images can be seen in the folder ‘output/images’


Resulting images in the output folder

Verify generated images

We were able to generate Rootfs and aarch64 Linux images by compiling with the External Toolchain that was earlier built in Part -1


Successful Linux image and Rootfs generation using external toolchain

[Check out Part -3 to know more on how to integrate the External Toolchain binaries inside the Target Linux Image]


A quote that has inspired me for a long time…

“Obstacles don’t have to stop you. If you run into a wall, don’t turn around and give up. Figure out how to climb it, go through it, or work around it.” — Michael Jordan

Comments


1st Floor, Kshitij Business Center, DG Dani Rd, opposite ILS College, Deccan Gymkhana, Pune, Maharashtra 411038

Subscribe to Our Newsletter

Thanks for submitting!

Follow Us On:

  • LinkedIn
  • Youtube

© 2024 by Whileone Techsoft Pvt Ltd.

bottom of page