Go to file
2020-10-27 20:14:29 +09:00
cache Add APT cache 2020-10-27 19:52:59 +09:00
linux-brain@19c30d3b37 Register transferred submodules 2020-10-12 06:34:50 +09:00
nkbin_maker@4a97a4e807 update nkbin_maker 2020-10-19 04:56:48 +09:00
tools Add APT cache 2020-10-27 19:52:59 +09:00
u-boot-brain@260d3d81a9 Update commit 2020-10-26 04:19:44 +09:00
.clang-format Add .clang-format 2020-10-26 04:20:30 +09:00
.gitignore Enable APT cache / describe how to debootstrap 2020-10-27 20:14:29 +09:00
.gitmodules add nkbin_maker 2020-10-18 15:27:28 +09:00
LICENSE Add files 2020-09-28 00:49:26 +09:00
Makefile Enable APT cache / describe how to debootstrap 2020-10-27 20:14:29 +09:00
r3build.toml Add files 2020-09-28 00:49:26 +09:00
README.md Enable APT cache / describe how to debootstrap 2020-10-27 20:14:29 +09:00

buildbrain

This repository includes:

  • linux-brain, u-boot-brain and nkbin_maker as submodules
  • Useful build targets in Makefile
  • r3build.toml to watch changes that occur in submodules

Confirmed environments

  • Debian 10 (buster) amd64

Getting Started

  1. Install dependencies.

    $ sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi
    
  2. Clone this repository with recursive clone enabled.

    $ git clone --recursive git@github.com:puhitaku/buildbrain.git
    
    • If you've cloned it without --recursive, run following command:
    $ git submodule update --init --recursive
    
  3. Install uuu.

    • Follow the instruction and build uuu executable.
    • Put uuu where the PATH executable points to.

Build and inject U-Boot

  1. Run make udefconfig to generate .config.

  2. Run make ubuild to build whole repository and generate u-boot.sb.

    • i.MX283 loads a packed U-Boot executable called u-boot.sb.
  3. To inject the executable into i.MX283 in recovery mode, run make uuu.

Build and make NK.bin

  1. Run make udefconfig to generate .config.

  2. Run make ubuild to build whole repository and generate u-boot.bin.

  3. To make nk.bin, run make nkbin.

    • nkbin_maker packs u-boot.bin into nk.bin.

Build Linux

  1. Run make ldefconfig to generate .config.

  2. Run make lbuild to generate zImage.

  3. Confirm that linux-brain/arch/arm/boot/zImage exists.

Bootstrap Debian Buster

  1. Partition an SD card into two partitions

    • 1st: FAT32 (vfat), about 100MB
    • 2st: ext4, fill remaining capacity
  2. Run APT cache in background: make aptcache

  3. Run make debian

  4. Copy all contents in ./debian into the 2nd partition in the card.

    • sudo cp -ar ./debian/* /path/to/your/sd/2nd/partition/
    • Please make sure that all attributes are preserved with -a flag

Watch changes in submodules & auto-build

  1. Run make setup-dev to prepare a Python venv to watch code changes. Namely;

    • Python 3 venv in env
    • r3build command in the env
  2. Run r3build. It'll detect the changes you make and builds the corresponding executable automatically.

What's r3build?

r3build is a smart file watcher that aims to provide hot-reloading feature like Web frontend development.