.\"	$NetBSD: install,v 1.18 2021/12/05 19:43:30 nia Exp $
.\"
.\" Copyright (c) 2001-2020 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Ss2 Installation for Armv7 and AArch64 devices with U-Boot
.Bl -bullet -offset indent -compact
.It
Download or build armv7.img.gz (32-bit) or arm64.img.gz (64-bit).
.It
Decompress the .gz image, using
.Xr gunzip 1
on Unix.
.It
Write the image to disk:
.Bd -literal
# dd if=armv7.img of=/dev/rld0 bs=1m conv=sync progress=1
.Ed
.It
If you are using Microsoft Windows, you can use
.Lk https://www.netbsd.org/~martin/rawrite32/ "rawrite32"
to write SD card images, which can handle decompression too.
.It
To replace the vendor U-Boot bootloader with a "mainline" U-Boot,
obtain a board-specific image.
Bootloaders are provided by the
.Pa sysutils/u-boot-*
packages in
.Lk https://www.pkgsrc.org/ "pkgsrc" .
.Pp
If you're using pkgsrc on an UNIX-like operating system that isn't NetBSD,
you must bootstrap first (see the 
.Pa README
file in the root directory of pkgsrc).
.Pp
You can also extract the U-Boot image from u-boot-*.tgz archive in an
existing
.Lk https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/aarch64/9.0/All/ "NetBSD binary package set".
.Pp
Install the board-specific U-Boot to the SD card,
e.g. for Allwinner devices (PINE H64 in this case):
.Bd -literal
# dd if=/usr/pkg/share/u-boot/pine-h64/u-boot-sunxi-with-spl.bin of=/dev/rld0 bs=1k seek=8 conv=sync progress=1
.Ed
.Pp
Or a Rockchip device (e.g. RockPro64):
.Bd -literal
# dd if=/usr/pkg/share/u-boot/rockpro64/rksd_loader.img of=/dev/rld0 seek=64 conv=sync progress=1
.Ed
.El
.Ss2 Installing NetBSD/evbarm to a SATA hard disk
Some Arm boards offer a SATA interface, and you might want to install NetBSD
to a hard disk after you've got it running from an SD card.
You can do this using 
.Xr sysinst 8
from within NetBSD.
.Pp
There are instructions for using
.Lk https://wiki.netbsd.org/ports/evbarm/install_using_sysinst/ "sysinst on Arm"
on the NetBSD wiki.
The main difference from installing on other ports is that a FAT32
partition is required for /boot.
