Skip to content

This repo provides custom python script that builds Rootfs for the cross compile environment using Raspberry OS Image

License

Notifications You must be signed in to change notification settings

abhiTronix/rpi_rootfs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom RootFS for Raspberry PI using Raspbian OS image file

⚠️ Important Note: This repository is a modified fork from kclyu/rpi_rootfs for building custom rootfs (sysroot) using a Raspbian OS image file that is compatible with https://github.com/abhiTronix/raspberry-pi-cross-compilers toolchains only. Thereby, offers no guarantee that it will work with any other toolchain.

A. Prerequisites

sudo apt update && sudo apt dist-upgrade
sudo apt-get install build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync rsync

B. Clone this Forked Repository:

git clone https://github.com/abhiTronix/rpi_rootfs.git

C. Making RootFS with Raspbian OS image file

Note 💡: Download the lite-image file from Raspberry PI download page and if possible, use the img file after unzipping the img.zip file after the download is complete.

cd ~/rpi_rootfs
sudo chmod +x ./build_rootfs.sh

# To build rootfs
./build_rootfs.sh create ./2021-MM-DD-raspios-buster-armhf.img

D. Bonus

PI.cmake

It is a CMAKE_TOOLCHAIN_FILE definition file for cmake used when cross compile using cmake:

⚠️ Remember to change toolchain path and compiled rootfs path in PI.cmake before running cmake!!!

⚠️ Always keep provided CMakeLists.txt file with PI.cmake!!!

cd  cmake_source_distribution_root_path
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/rpi_rootfs/PI.cmake  -DCMAKE_BUILD_TYPE=Debug ..

sysroot-relativelinks.py

A python script that takes a sysroot directory and turn all the abolute symlinks and turn them into relative ones such that the sysroot is usable within another system.

sysroot-relativelinks.py path_to_sysroot_directory

About

This repo provides custom python script that builds Rootfs for the cross compile environment using Raspberry OS Image

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 48.3%
  • Shell 40.8%
  • CMake 10.0%
  • C++ 0.9%