Step 3 : Compile Bare-Linux

  • In this program, you are going to learn

  • How to ?

Topics in this section,

  • Make sure current dir is $HOME

$ cd $HOME
  • Use below command to download the source code.

$ git clone git://git.buildroot.net/buildroot
  • Change the current directory to build as mentioned below.

$ cd buildroot
  • Now, list out the content of “board” directory to check if the bare-linux source code supports our required target.

test:board$ ls
aarch64-efi  armadeus  beagleboardx15   bsh         firefly      intel          mender       olpc        qemu           raspberrypi3-64      seeed               synopsys     uevm5432     zynqmp
acmesystems  arrow     beaglebone       canaan      freescale    khadas         microchip    openblocks  radxa          raspberrypi4         sheevaplug          technexion   versal
altera       aspeed    beagleboneai     chromebook  friendlyarm  kontron        minnowboard  orangepi    raspberrypi    raspberrypi4-64      sifive              technologic  visionfive
amarula      asus      beaglev          ci20        globalscale  lego           nexbox       pandaboard  raspberrypi0   raspberrypicm4io     sipeed              terasic      visionfive2
andes        atmel     beelink          cubietech   grinn        lemaker        nezha        pc          raspberrypi0w  raspberrypicm4io-64  solidrun            ti           wandboard
arcturus     avnet     boundarydevices  embest      hardkernel   librecomputer  octavo       pcengines   raspberrypi2   raspberrypizero2w    spike               toradex      warp7
arm          bananapi  broadcom         engicam     in-circuit   linksprite     olimex       pine64      raspberrypi3   roseapplepi          stmicroelectronics  udoo         zynq
  • We can see that our target “raspberrypi4-64” is supported by the bare-linux source code.

  • Now from the buildroot directory add the default configurations of raspberrypi4-64 in config file using the following command.

$ pwd
$HOME/buildroot
$ make raspberrypi4_64_defconfig
  • Run make command from buildroot directory to build the bare-linux

$ make
  • Once the build is done, the final target image will be present in the following directory.

$ cd $HOME/buildroot/output/images/
$ ls -l
test:images$ ls -l
total 142588
-rwxr-xr-x 1 test test     54707 Jan 29 23:13 bcm2711-rpi-4-b.dtb
-rw-r--r-- 1 test test  33554432 Jan 29 23:13 boot.vfat
-rw-r--r-- 1 test test       443 Jan 29 23:13 genimage.cfg
-rw-r--r-- 1 test test  23720448 Jan 29 23:13 Image
-rw-r--r-- 1 test test 125829120 Jan 29 23:13 rootfs.ext2
lrwxrwxrwx 1 test test        11 Jan 29 23:13 rootfs.ext4 -> rootfs.ext2
drwxr-xr-x 3 test test      4096 Jan 29 22:43 rpi-firmware
-rw-r--r-- 1 test test 159384064 Jan 29 23:13 sdcard.img

What is /.bashrc file?