2.8 KiB
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
-
Install dependencies.
$ sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi
-
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
- If you've cloned it without
-
Install uuu.
- Follow the instruction and build
uuu
executable. - Put
uuu
where the PATH executable points to.
- Follow the instruction and build
Build and inject U-Boot
-
Run
make udefconfig-sh*
to generate.config
.- For Sx1:
make udefconfig-sh1
- For Sx6:
make udefconfig-sh6
- For Sx1:
-
Run
make ubuild
to build whole repository and generateu-boot.sb
.- i.MX283 loads a packed U-Boot executable called
u-boot.sb
.
- i.MX283 loads a packed U-Boot executable called
-
To inject the executable into i.MX283 in recovery mode, run
make uuu
.
Build and make NK.bin
-
Run
make udefconfig
to generate.config
. -
Run
make ubuild
to build whole repository and generateu-boot.bin
. -
To make
nk.bin
, runmake nkbin
.- nkbin_maker packs
u-boot.bin
intonk.bin
.
- nkbin_maker packs
Build Linux
-
Run
make ldefconfig
to generate.config
. -
Run
make lbuild
to generatezImage
. -
Confirm that
linux-brain/arch/arm/boot/zImage
exists.
Bootstrap Debian 10 (buster)
-
Partition an SD card into two partitions.
- 1st: FAT32 (vfat), about 100MB
- 2st: ext4, fill the remaining area
-
Build and copy the Linux kernel.
- Run
make ldefconfig lbuild
. - Copy
/linux-brain/arch/arm/boot/zImage
and/linux-brain/arch/arm/boot/dts/imx28-evk.dtb
into the 1st partition.
- Run
-
Run APT cache in background (mandatory):
make aptcache
. -
Run
make debian
. -
Copy all contents in
./debian
into the 2nd partition.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
-
Run
make setup-dev
to prepare a Python venv to watch code changes. Namely;- Python 3 venv in
env
- r3build command in the env
- Python 3 venv in
-
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.