Address review comments from puhitaku

- image/build_image.sh: fix IMG_NAME default to sd.img, SIZE_M to 3072
- image/build_image.sh: revert START2 to original form; remove all unnecessary inline comments
- Makefile: remove 'Mount proc and sys' comment; keep the 'Keep mounting commands AFTER' note
- Makefile: remove 'Copy qemu-arm-static' comment; simplify binfmt and mmap_min_addr comments
- Makefile: replace verbose Docker target comment blocks with clean targets per reviewer suggestion
- README.md: revert all unrelated changes; keep only the macOS environment line and Docker build section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mingyang Li
2026-06-06 10:33:00 -07:00
parent e085059fd5
commit bf54dfbf44
3 changed files with 34 additions and 83 deletions

View File

@@ -1,13 +1,12 @@
buildbrain
==========
Scripts for building [Brainux](https://brainux.org/), a custom Linux distribution for the [Sharp Brain](https://jp.sharp/edictionary/) series of electronic dictionaries.
This repository includes:
This meta-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
- 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
----------------------
@@ -16,40 +15,36 @@ Confirmed environments
- Debian 11 (bullseye) amd64
- macOS 26.5 (Tahoe) arm64-apple-darwin25.5.0 via Docker
**Typical Runtime**: 3 hrs is typical on a M2 Max MacBook Pro via Docker.
Getting Started
---------------
For Debian-based systems:
1. Install dependencies.
```sh
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
```
$ 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 recursively.
1. Clone this repository with recursive clone enabled.
```sh
git clone --recursive git@github.com:brain-hackers/buildbrain.git
```
$ git clone --recursive git@github.com:brain-hackers/buildbrain.git
```
- If you've cloned it without `--recursive`, run following command:
```sh
git submodule update --init --recursive
```
$ git submodule update --init --recursive
```
3. Install `uuu`.
1. Install uuu.
- Follow [the instruction](https://github.com/NXPmicro/mfgtools#linux) and build `uuu` executable.
- Put `uuu` where the PATH executable points to.
For macOS, see [Docker build](#docker-build) section below.
Build U-Boot
------------
-----------------------
1. Run `make udefconfig-sh*` to generate `.config`.
@@ -61,9 +56,9 @@ Build U-Boot
- 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.
1. Run `make uuu`
@@ -89,6 +84,7 @@ Build and deploy 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
-----------
@@ -98,6 +94,7 @@ Build Linux
1. Confirm that `linux-brain/arch/arm/boot/zImage` exists.
Build a Debian rootfs
---------------------
@@ -111,6 +108,7 @@ Build a Debian rootfs
1. Confirm that `image/sd.img` is built and burn it to an SD card.
Build a Buildroot rootfs
------------------------
@@ -118,11 +116,12 @@ Buildroot rootfs aims to be the most lightweight rootfs for experimental use. `m
If you want to customize the build of Buildroot, `cd` into `buildroot` and use the following targets:
- `make menuconfig` to change the configuration
- `make` to build the rootfs (`-j` option might give you extra speed)
- `make menuconfig` to change the configuration
- `make` to build the rootfs (`-j` option might give you extra speed)
`image/sd_buildroot.img` target expects presence of the tarball at `buildroot/output/images/rootfs.tar`. You'll have to `clean` and rebuild every time you change the Buildroot's config before making the SD image.
Docker build
------------
@@ -207,9 +206,9 @@ Other useful Docker recipes:
- `make docker-volume-create` to (re-)create the rootfs named volume
- `make docker-volume-rm` to delete the rootfs named volume and reclaim its disk space
Known issues
------------
Known issues
----------------------------------------
If you use GCC 10 for the 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;`
@@ -221,12 +220,10 @@ Watch changes in submodules & auto-build
- Python 3 venv in `env`
- r3build command in the env
2. Run `r3build`. It'll detect the changes you make and build the corresponding executable automatically.
1. Run `r3build`. It'll detect the changes you make and builds the corresponding executable automatically.
> [!NOTE] What's r3build?
> [r3build](https://github.com/puhitaku/r3build) is a smart file watcher that aims to provide hot-reloading feature like Web frontend development.
Disclaimer
----------
What's r3build?
---------------
This repository is not affiliated with Sharp Corporation. The content is provided "as is" without any warranties. Use at your own risk.
[r3build](https://github.com/puhitaku/r3build) is a smart file watcher that aims to provide hot-reloading feature like Web frontend development.