Compile Debian Image from Source Code

This document describes how to compile Debian image from source code.

1. Preparations

  • Ubuntu Linux environment (ubuntu-latest)
  • Additional disk space (e.g., 20GB root reserve, 1GB swap)
  • Internet access

2. Checkout code

git clone https://github.com/mixtile-rockchip/build.git
cd build

3. Checkout LFS

git lfs fetch && git lfs checkout

4. Install dependencies

  sudo apt-get update && sudo apt-get upgrade -y
  sudo apt-get install -y git ssh make gcc libssl-dev \
  liblz4-tool expect g++ patchelf chrpath gawk texinfo \
  chrpath diffstat software-properties-common bison flex \
  fakeroot cmake gcc-multilib g++-multilib unzip device-tree-compiler \
  libncurses-dev python3-pip python3-pyelftools bc make build-essential \
  libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl \
  llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev \
  liblzma-dev uuid-dev lzma-dev liblzma-dev libbluetooth-dev python-parted-doc \
  u-boot-tools sudo time rsync libmpc-dev bsdmainutils python2 xz-utils

5. Install ppa dependencies

sudo apt-get update && sudo apt-get install -y binfmt-support qemu-user-static live-build

6. Install debian_prepare

  sudo cp debian-rk3588.tar.gz /opt/ && sudo tar -xvf debian-rk3588.tar.gz -C /opt/ && \
  sudo apt-get update && sudo apt-get install -y xxd && \
  sudo chmod a+x debian_prepare.sh && sudo ./debian_prepare.sh

7. Install repo

  mkdir -p ~/.bin && \
  sudo curl https://storage.googleapis.com/git-repo-downloads/repo -o ~/.bin/repo && \
  sudo cp ~/.bin/repo /usr/bin/repo && sudo chmod a+x /usr/bin/repo

8. Download code

  repo init -u https://github.com/mixtile-rockchip/manifests.git -b master -m mixtile_core3588e_release.xml && \
  repo sync

9. Build image

  echo '20' > input.txt && \
  echo '5' >> input.txt && \
  sudo ./build.sh chip < input.txt && sudo rm input.txt && \
  sudo ./build.sh all

10. Build output

Directory: output/update/Image
.
├── boot.img -> ../../../kernel/boot.img
├── MiniLoaderAll.bin -> ../../../u-boot/rk3588_spl_loader_v1.13.112.bin
├── misc.img -> ../../firmware/misc.img
├── oem.img -> ../../firmware/oem.img
├── package-file
├── parameter.txt -> ../../../device/rockchip/.chips/rk3588/parameter.txt
├── recovery.img -> ../../../buildroot/output/rockchip_rk3588_recovery/images/recovery.img
├── rootfs.img -> ../../../debian/linaro-rootfs.img
├── uboot.img -> ../../../u-boot/uboot.img
├── update.img
├── update.raw.img
└── userdata.img -> ../../firmware/userdata.img

11. Upgrade Firmware

Refer this page Upgrade Firmware Using RAW Image to upgrade firmware

Was this article helpful?

Related Articles