Skip to content

ravikiranbvn/Exploring-Linux-RPI4

Repository files navigation

Exploring-Linux-RPI4

Minimal workspace for:

  • Raspberry Pi kernel (submodule)
  • Out-of-tree kernel modules
  • Cross-compilation workflow

Structure

.
├── kernel/           # RPi Linux (submodule)
├── kernel_headers/   # Exported headers (userspace only)
├── modules/          # Custom modules
├── build_kernel.sh
└── build_module.sh

Update Kernel

git submodule sync
git submodule update --init --remote kernel

Prepare Kernel (REQUIRED for modules)

cd kernel
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_prepare

Build Module

./build_module.sh <module_name> build

Key Rule

  • Use kernel/ → for module builds
  • Do NOT use kernel_headers/ for modules

(Optional) Full Kernel Build

./build_kernel.sh build

Fix: Detached HEAD in submodule

cd kernel
git checkout -B rpi-6.12.y origin/rpi-6.12.y

Toolchain

sudo apt install gcc-aarch64-linux-gnu

References

Build and copy kernel:

Kernel modules inspired from:

Pinout reference:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors