NetBSD

source: https://wiki.pine64.org/index.php?title=PINE_A64
download: http://www.invisible.ca/arm
Relevant links:
Pine A64 Software Release

Additional software

Third-party software is available from pkgsrc.

Fetching pkgsrc from CVS

cd /usr \
&& cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2020Q3 -P pkgsrc

or

ftp ftp://ftp.NetBSD.org/pub/pkgsrc/stable/pkgsrc.tar.gz \
&& tar -xzf pkgsrc.tar.gz -C /usr

Bootstrap

The bootstrap installs a bmake tool. Use this bmake when building via pkgsrc. For examples in this guide, use bmake instead of make.

cd /usr/pkgsrc/bootstrap \
&& ./bootstrap
Info

To bootstrap in unprivileged mode pass –unprivileged flag to bootstrap.

Installing packages from source

cd /usr/pkgsrc/www/nginx
make install

Installing binary packages

In the directory from the last section, there is a subdirectory called All/, which contains all the binary packages that are available for the platform, excluding those that may not be distributed via FTP or CDROM (depending on which medium you are using).

To install packages directly from an FTP or HTTP server, run the following commands in a Bourne-compatible shell (be sure to su to root first):

PATH="/usr/pkg/sbin:$PATH"

PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"
PKG_PATH="$PKG_PATH/NetBSD/`uname -p`/`uname -r|cut -f '1 2' -d.|cut -f 1 -d_`/All"
export PATH PKG_PATH

Instead of URLs, you can also use local paths, for example if you are installing from a set of CDROMs, DVDs or an NFS-mounted repository. If you want to install packages from multiple sources, you can separate them by a semicolon in PKG_PATH.

After these preparations, installing a package is very easy:

pkg_add htop vim git bash

Note that any prerequisite packages needed to run the package in question will be installed, too, assuming they are present where you install from.

Adding packages might install vulnerable packages. Thus you should run pkg_admin audit regularly, especially after installing new packages, and verify that the vulnerabilities are acceptable for your configuration.

After you’ve installed packages, be sure to have /usr/pkg/bin and /usr/pkg/sbin in your PATH so you can actually start the just installed program.

Create a user

useradd -m -s /usr/pkg/bin/bash -G wheel david
/home/david/.profile
. ~/.bashrc
/home/david/.bashrc
...
PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"
PKG_PATH="${PKG_PATH}/NetBSD/`uname -p`/`uname -r|cut -f '1 2' -d.|cut -f 1 -d_`/All"
TERM=xterm-color
export PKG_PATH TERM

Notes

Configure CVS

By default, CVS doesn’t do things like most people would expect it to do. But there is a way to convince CVS, by creating a file called .cvsrc in your home directory and saving the following lines to it. This file will save you lots of headache and some bug reports, so we strongly recommend it. You can find an explanation of this file in the CVS documentation.

~/.cvsrc
# recommended CVS configuration file from the pkgsrc guide
cvs -q
checkout -P
update -dP
diff -upN
rdiff -u
release -d