Download BusyBox, a utility that combines tiny versions of many common UNIX utilities into a single small executable: git clone git://busybox.net/busybox.git --branch=1_33_0 --depth=1
Extract the BusyBox source code to our development machine.
Step 4: Write Environment Setup Shell Script
Create a shell script (e.g., setup_env.sh) to set up the environment variables needed for cross-compilation. The script may look like
#! /bin/bash
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export INSTALL_MOD_PATH=/media/mohsin/root_fs
Make the script executable using chmod +x setup_env.sh.
Step 5: Prepare SD Card
Insert the SD card into our development machine.
Use tools like gparted or fdisk to create two partitions (I used fdisk):
Partition 1 (Boot): For example, /dev/sdc1
Partition 2 (Root File System): For example, /dev/sdc2
Step 6: Flash Firmware and Linux Kernel to SD Card
Copy the firmware files to the boot partition:
cp -r firmware/boot/* /media/mohsin/rpi_boot/
Copy the Linux kernel image (Image), device tree blob files (*.dtb), and overlays to the boot partition:
I would like to add into step 5 that the partition is named as rpi_boot and has a size of 32-48MB whereas for remaining part name it as root_fs. Also rpi_boot would be a FAT32 based filesystem and root_fs would be an ext3/ext4 filesystem.