mirror of
https://github.com/brain-hackers/buildbrain
synced 2026-03-28 16:51:09 +09:00
2.6 KiB
2.6 KiB
Objective
This repository contains anything necessary to build an SD card image file of Brainux - a Debian-based Linux distribution for a series of e-dictionary "Brain" series sold by SHARP, a Japanese manufacturer - and now I'm going to add the root AGENTS.md for automated development.
Explore the repository to generate appropriate AGENTS.md that will help CC for future runs. AGENTS.md should contain project memory and instructions for CC.
Hints and instructions about the repo's structure
- Knowledge useful to understand the inside of SHARP Brain and its hacking scene will be contained in /docs/knowledge.
- The definition of GitHub Actions workflow (/.github/workflows/build.yml) will be useful to understand how it enters into the build procedure.
- The repo contains some submodules. File search or string search at the repo's root is not recommended.
- Linux (linux-brain)
- U-Boot (u-boot-brain)
- BrainLILO (chain-boot tool specially made for specific older models)
- boot4u (chain-boot tool specially made for specific newer models)
- buildroot (to build an alternative lightweight rootfs, instead of the default Debian)
- nkbin_maker (converter to turn U-Boot's ELF into an nk.bin that Windows CE's EBOOT bootloader understands)
My typical usage of buildbrain on the development of Brainux
Develop Linux kernel
cdinto linux-brain- Checkout an appropriate branch
- The default branch is
brain. When I edit the code, I make another branch frombrain.
- Edit the code
cd ..and go up into buildbrainmake lclean ldefconfig lbuildto start a clean build
- Run
make lmenuconfigto edit the .config (which is not a suitable way for coding agents due to TUI)
- Copy the resulting kernel
/linux-brain/arch/arm/boot/zImageand/linux-brain/arch/arm/boot/dts/imx28-pw*.dtbinto an SD card and run it on a real machine - Continue try-and-error loop; make another change to the code,
make lbuild, and run it cd linux-brainand commit the change
- Commit message must comply the kernel's convention; watch surrounding files and commits to infer the format
- File a PR and ask review
- Merge it
Develop U-Boot
It is mostly the same as Linux kernel.
Update Brainux's configuration script and file
- Checkout an appropriate branch
- Edit scripts and files in os-brainux
- Run
make brainuxto build the root filesystem
- ... or run
make image/sd.imgto create a complete SD image
- Copy the root filesystem to an SD card's second partition or write the entire image to an SD card
- Repeat 3 and 4
- Commit the change, file a PR, ask a review, and merge it