Go to file
Takumi Sueda d7da4a6e44 Update linux-brain: update keyboard driver & maximize brightness 2022-12-08 01:02:34 +09:00
.github/workflows G5300 -> A7200 2022-11-23 01:23:39 +09:00
boot4u@3f916a0cf7 Brainux for x1 2021-12-07 23:01:31 +09:00
brainlilo@0ef73cdeb4 Update BrainLILO: support 1G 2022-11-23 00:14:58 +09:00
cache Add APT cache 2020-10-27 19:52:59 +09:00
image G5300 -> A7200 2022-11-23 01:23:39 +09:00
linux-brain@60e1cb92ee Update linux-brain: update keyboard driver & maximize brightness 2022-12-08 01:02:34 +09:00
nkbin_maker@4a97a4e807 bring back nkbin_maker 2022-01-25 05:32:19 +09:00
os-brainux Fix sudoers 2022-11-23 23:28:22 +09:00
tools Brainux for x1 2021-12-07 23:01:31 +09:00
u-boot-brain@783749833d Update u-boot-brain: unify 2G, update env 2022-11-23 00:12:11 +09:00
.clang-format Add .clang-format 2020-10-26 04:20:30 +09:00
.gitchangelog.rc Generate changelog 2021-03-22 22:55:05 +09:00
.gitignore Update misc 2021-03-22 22:41:50 +09:00
.gitmodules .gitmodules: align URLs to "https ... .git" 2022-05-14 21:14:19 +09:00
LICENSE Add files 2020-09-28 00:49:26 +09:00
Makefile Pre-install BrainLILO / enable G2 build 2022-05-10 00:51:47 +09:00
README.md README.md: add python3-pip and libyaml to dependency 2022-01-14 00:29:32 +09:00
r3build.toml Add files 2020-09-28 00:49:26 +09:00

README.md

buildbrain

This repository includes:

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

Confirmed environments

  • Debian 10 (buster) amd64
  • Debian 11 (bullseye) amd64

Getting Started

  1. Install dependencies.

    $ sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf libssl-dev bc lzop qemu-user-static debootstrap kpartx libyaml-dev python3-pyelftools
    
  2. Clone this repository with recursive clone enabled.

    $ git clone --recursive git@github.com:brain-hackers/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 U-Boot

  1. Run make udefconfig-sh* to generate .config.

    • For Sx1: make udefconfig-sh1
    • For Sx6: make udefconfig-sh6
    • For x1: make udefconfig-h1
  2. Run make ubuild to build whole repository and generate u-boot.sb or u-boot.bin.

    • i.MX283 loads a packed U-Boot executable called u-boot.sb.

Inject U-Boot into i.MX283 in recovery mode

  1. Follow Build U-Boot procedure to make U-Boot binary.

  2. Run make uuu

Build and make NK.bin

  1. Follow Build U-Boot procedure to make U-Boot binary.

  2. Run make nkbin-maker.

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

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

Build and deploy boot4u

  1. Run make boot4u

  2. Create index.din and copy AppMain.bin

    • mkdir /path/to/your/sd/1st/partition/App/boot4u
    • touch /path/to/your/sd/1st/partition/App/boot4u/index.din
    • cp boot4u/AppMain.bin /path/to/your/sd/1st/partition/App/boot4u/

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 11 (bullseye)

  1. Run make ldefconfig lbuild.

  2. Run APT cache in background (mandatory): make aptcache.

  3. Run make brainux.

  4. Run make image/sd.img

  5. Confirm that image/sd.img is built and burn it to an SD card.

Known issues

If you using gcc 10 for host compiler, make ubuild may fail.
To complete build, open /u-boot-brain/scripts/dtc/dtc-lexer.lex.c or /u-boot-brain/scripts/dtc/dtc-parser.tab.c then comment out YYLTYPE yylloc;

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.