Skip to content

quic-parihar/fastrpc-image

 
 

Repository files navigation

fastrpc-image

Docker image for building the FastRPC, Linux kernel and related components.

This project provides a Docker-based environment tailored for building the FastRPC, Linux kernel and associated binaries. It ensures consistency across development environments, especially when engineers use different versions of Ubuntu, Python, and other tools.

🚀 Features

  • Build the Linux kernel and FastRPC binaries
  • Package boot.img, efi.bin, and dtb.bin
  • Validate DeviceTree bindings and sources
  • Includes ukify and mkbootimg tools
  • Handy shell aliases for streamlined Docker usage

🐳 Docker Installation

Follow the official Docker installation guide for Ubuntu:

👉 https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

Add User to Docker Group

sudo usermod -aG docker $USER
newgrp docker

Restart your terminal or log out and back in. Verify with:

id

🔧 Build the Docker Image

Clone this repository and build the Docker image:

git clone git@github.com:qualcomm-linux/fastrpc-image.git
cd fastrpc-image
docker build -t fastrpc-image .

🛠️ Setup Aliases

Add the following to your .bashrc or shell config:

alias fastrpc-image-run='docker run -it --rm --user $(id -u):$(id -g) --workdir="$PWD" -v "$(dirname $PWD)":"$(dirname $PWD)" fastrpc-image'
alias fmake='fastrpc-image-run make'

🧪 Usage Examples

Build Kernel

fmake defconfig
fmake -j$(nproc)

Validate DeviceTree Bindings

fmake DT_CHECKER_FLAGS=-m dt_binding_check
fmake DT_CHECKER_FLAGS=-m DT_SCHEMA_FILES=soc/qcom/qcom,smem.yaml dt_binding_check

Build and Validate DTB

fmake defconfig
fmake qcom/qcs6490-rb3gen2.dtb CHECK_DTBS=1

🧩 Build FastRPC using fastrpc-image

git clone https://github.com/qualcomm/fastrpc/
cd fastrpc
fastrpc-image-run ./gitcompile --host=aarch64-linux-gnu

🧩 Copy fastrpc binary and fastrpc test binary

  mkdir -p fastrpc_dir/usr/lib
  mkdir -p fastrpc_dir/usr/bin
  cp -rf src/.libs/libadsp_default_listener.so* fastrpc_dir/usr/lib/
  cp -rf src/.libs/libadsprpc.so* fastrpc_dir/usr/lib/
  cp -rf src/.libs/libcdsp_default_listener.so* fastrpc_dir/usr/lib/
  cp -rf src/.libs/libcdsprpc.so* fastrpc_dir/usr/lib/
  cp -rf src/.libs/libsdsp_default_listener.so* fastrpc_dir/usr/lib/
  cp -rf src/.libs/libsdsprpc.so* fastrpc_dir/usr/lib/
  cp -rf src/adsprpcd src/cdsprpcd src/sdsprpcd fastrpc_dir/usr/bin/

  # Copy fastrpc test binary
  cp -rf test/fastrpc_test fastrpc_dir/usr/bin
  cp -rf test/linux/* fastrpc_dir/usr/bin
  cp -rf test/v75/* fastrpc_dir/usr/bin

  cd fastrpc_dir
  find . | cpio -o -H newc | gzip -9 > ../fastrpc.cpio.gz
  cd ..
  
  cat fastrpc.cpio.gz > artifacts/ramdisk.gz

🧬 Add DSP Firmware into Ramdisk

git clone https://github.com/linux-msm/hexagon-dsp-binaries.git
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

mkdir -p firmware_dir/usr/lib/dsp/{adsp,cdsp,cdsp1,gdsp0,gdsp1}
mkdir -p firmware_dir/lib/firmware/qcom/sa8775p

cp hexagon-dsp-binaries/... firmware_dir/usr/lib/dsp/...
cp linux-firmware/qcom/sa8775p/* firmware_dir/lib/firmware/qcom/sa8775p/

cd firmware_dir
find . | cpio -o -H newc | gzip -9 > ../firmware.cpio.gz
cd ..
cat firmware.cpio.gz fastrpc.cpio.gz > artifacts/ramdisk.gz

📦 Package DLKMs into Ramdisk

(cd kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)

🧰 Generate Boot Binaries with ukify

fmake-image-run generate_boot_bins.sh efi --ramdisk artifacts/ramdisk.gz \
  --systemd-boot artifacts/systemd/usr/lib/systemd/boot/efi/systemd-bootaa64.efi \
  --stub artifacts/systemd/usr/lib/systemd/boot/efi/linuxaa64.efi.stub \
  --linux arch/arm64/boot/Image \
  --cmdline "${CMDLINE}" \
  --output images

fmake-image-run generate_boot_bins.sh dtb --input kobj/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dtb \
  --output images

📦 Generate boot.img with mkbootimg

fmake-image-run mkbootimg \
  --header_version 2 \
  --kernel kobj/arch/arm64/boot/Image.gz \
  --dtb kobj/arch/arm64/boot/dts/qcom/sm8550-mtp.dtb \
  --cmdline "${CMDLINE}" \
  --ramdisk artifacts/ramdisk.gz \
  --base 0x80000000 \
  --pagesize 2048 \
  --output images/boot.img

⚡ Flash Binaries to Device

fastboot flash efi images/efi.bin
fastboot flash dtb_a images/dtb.bin
fastboot reboot

⚡ Flash boot.img to Device

fastboot flash boot images/boot.img

📜 License

This project is licensed under the https://spdx.org/licenses/BSD-3-Clause-Clear.html. See the https://github.com/qualcomm-linux/fastrpc-image/blob/main/LICENSE file for details.


---

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 52.2%
  • Dockerfile 47.8%