Wednesday, August 09, 2017

NetBSD source build and crosscompile notes

An update on my notes to compile NetBSD kernels and userland.

Build / update the tools:

-U : for unprivilged building
-u : to update
-m : to specify architecture

./ -U -u tools

To cross compile, this is would enough:
./ -U -m i386 -u tools
However, since I do want to build on the same computer and the build script would be confused, we add -T /usr/tools-${HOST_ARCH}-${TARGET_ARCH} and also separate the object dir with -O!

./ -U -m i386 -u -O /usr/obj-amd64-i386 -T /usr/tools-amd64-i386 tools

Then we build the kernel

./ -U kernel=CONFNAME

or for cross compilation:
./ -U -O /usr/obj-amd64-i386 -T /usr/tools-amd64-i386 -m i386 -u kernel=GENERIC

The modules:
./ -U -u modules installmodules=/

Now to build userland, including X11. I did not attempt to cross-build userland yet.

./ -U -x -u distribution

./ -U -x -u distribution install=/

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.