Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [NetBSD Port-ARM] Minimal netbsd for Raspbery Pi 3 B+

Awesome, thanks! 

On Tue, Aug 7, 2018 at 3:57 PM <maya%netbsd.org@localhost> wrote:
On Mon, Aug 06, 2018 at 02:06:50PM +0100, austin aigbe wrote:
> Hello,
> I am working on a 4G/LTE base-station project and I am experimenting with
> netbsd + rust lang. Most of the OS images I have come across are quite
> large (> 100 MB).
> I need something less than 100MB.
> How can I cross-compile the most basic and minimal netbsd image for my
> project that can be less than 100MB?
> I need my basic arm netbsd to support the following tcp, udp (for GTP) and
> sctp (for S1AP) networking.

If you want to minimize to the extreme, you only need /rescue, which is
a single static binary, with lots of hard links for different programs.

You can adjust the contents of it in src/rescue/list* to add/remove a
few things. Might need some experimentation to get right. The build
isn't super friendly for adjustments though from trying now.

Cross building is the default if you use build.sh.

Grab the netbsd source code e.g. from the git mirror:
./build.sh -U -u -j20 -m evbarmv7hf -O ~/arm release

This will build the entire bloated release. But also give you cross
tools in ~/arm/tooldir.*/.

You can run this on a non-NetBSD machine, too.

SCTP is pretty new, the userland stuff is only available in -current,
and you will also need to manually enable this in the kernel config for
your machine.

As for preparing the image, I'd be tempted to modify just the FFS part
of an existing RPI image. The build, however, uses makefs.
something like (this is on netbsd):
vndconfig vnd0 rpi.img
disklabel -I -i vnd0
# edit disklabel for chosen size
resize the partition with FFS
newfs -O2 /dev/rvnd0b # assuming "b" is your FFS partition
mount /dev/vnd0b
# Then populate it with what you want, only.
umount /dev/vnd0b

You don't need to do the adjustments on an ARM machine.

Home | Main Index | Thread Index | Old Index