Skip to content

scripts: add makeusr.sh for bitbake-free cmake+make of the user space#300

Open
daniel-rossier wants to merge 1 commit into
mainfrom
tools/makeusr-script
Open

scripts: add makeusr.sh for bitbake-free cmake+make of the user space#300
daniel-rossier wants to merge 1 commit into
mainfrom
tools/makeusr-script

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

What

Adds scripts/makeusr.sh, a standalone helper (on PATH after . env.sh) that
rebuilds a usr/ directory with plain cmake+make instead of invoking
bitbake — for a fast edit/build loop on the user-space apps.

Run it from so3/usr or linux/usr; it operates on $PWD and
auto-detects the context by the parent directory name:

Context Toolchain Extra Local deploy (build/deploy)
so3/usr musl (in-tree <cpu>-linux-musl.cmake) -DMICROPYTHON; honours .ib_last_arch (wipes build/ on arch switch) *.elf + out/*
linux/usr buildroot (toolchainfile.cmake) -DCMAKE_KERNEL_PATH; builds out-of-tree kernel modules hello + *.ko + SOO s3c-*deploy/root/

It faithfully reproduces the do_build / do_install_apps of the usr-so3
and usr-linux recipes (meta-usr), stopping at the local deploy
(build/deploy); pushing into the actual rootfs image still needs the bitbake
do_deploy (mount + sudo rsync).

Notes

  • The kernel-module build deliberately passes neither ARCH nor
    CROSS_COMPILE
    — the kernel Makefile is patched with
    ARCH ?= arm64 / CROSS_COMPILE ?= aarch64-none-linux-gnu-, so the
    compiler resolves from PATH, matching the toolchain the kernel was built
    with. Forcing CROSS_COMPILE from linux/rootfs/host/bin picks the
    userspace buildroot gcc and triggers a "compiler differs" warning.
  • Options: -a aarch64|arm, -t Debug|Release, -p <platform>, -m
    (micropython), -c (reconfigure), -M (skip modules), -C (clean),
    -j N, -h.

Test

Verified end-to-end in both contexts (bare-name invocation after . env.sh):

  • so3/usr → 21 *.elf in build/deploy/
  • linux/usr → apps + modtry.ko (aarch64) + s3c-* in build/deploy/root/

Add a standalone helper, on PATH after `. env.sh`, that rebuilds a usr/
directory with plain cmake+make instead of invoking bitbake. Run it from
so3/usr or linux/usr; it operates on $PWD and auto-detects the context:

  - so3/usr:   musl toolchain (in-tree <cpu>-linux-musl.cmake), honours
               .ib_last_arch (wipes build/ on arch switch), deploys
               *.elf + out/* into build/deploy/.
  - linux/usr: buildroot toolchain + CMAKE_KERNEL_PATH, also builds the
               out-of-tree kernel modules and deploys hello + *.ko + the
               SOO s3c-* apps into build/deploy/root/.

It faithfully reproduces the do_build/do_install_apps of the usr-so3 and
usr-linux recipes, stopping at the local deploy (build/deploy); pushing into
the rootfs image still needs the bitbake do_deploy. The kernel-module build
deliberately passes neither ARCH nor CROSS_COMPILE so the compiler resolves
from the kernel Makefile defaults / PATH, matching the toolchain the kernel
was built with.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant