Diff for /wikisrc/ports/evbarm/install_using_sysinst.mdwn between versions 1.2 and 1.11

version 1.2, 2018/11/19 14:03:19 version 1.11, 2018/11/19 22:00:10
Line 4  In this document we will see step by ste Line 4  In this document we will see step by ste
 external media (SATA hard disk, USB stick or (u)SD card) using  external media (SATA hard disk, USB stick or (u)SD card) using
 [[!template id=man name="sysinst" section="8"]].  [[!template id=man name="sysinst" section="8"]].
   
   As practical example a BananaPI and a SATA hard disk will be used.
   However, the following instructions can be probably easily applied
   on other SoCs and medias with little adjustments.
   
   
 # Populating (u)SD card with `armv7.img`  # Populating (u)SD card with `armv7.img`
   
 *TODOleot*: (mostly) copy-paste instructions from allwinner.mdwn  - Download or build `armv7.img`, e.g.:
   
 *TODOleot*: Adjust/provide u-boot incantantions to boot on a BPI  [[!template id=programlisting text="""
   $ ftp http://cdn.NetBSD.org/pub/NetBSD/NetBSD-8.0/evbarm-earmv7hf/binary/gzimg/armv7.img.gz
   $ gunzip armv7.img.gz
   """]]
   
   - Write the image to (u)SD card:
   
   [[!template id=programlisting text="""
   # dd if=armv7.img of=/dev/rsd0d bs=1m conv=sync
   """]]
   
   - Write u-boot to (u)SD card. `u-boot` images are provided by
   `sysutils/u-boot-<boardname>` packages, for example for Allwinner SoC:
   
   [[!template id=programlisting text="""
   # dd if=/usr/pkg/share/u-boot/&lt;boardname&gt;/u-boot-sunxi-with-spl.bin of=/dev/rld0d bs=1k seek=8 conv=sync
   """]]
   
   NetBSD/evbarm 8.0 does not automatically boot on the BananaPI.
   We can use the following commands to boot from the (u)SD cards in u-boot:
   
   [[!template id=programlisting text="""
   mmc dev 0
   setenv kernel netbsd-BPI.ub
   fatload mmc 0:1 82000000 $kernel
   bootm 82000000 root=ld0a console=fb
   """]]
   
   Or, to avoid typing them at every boot we can prepare an u-boot script via
   [[!template id=man name="mkubootimage" section="1"]].
   
   [[!template id=programlisting text="""
   $ cat boot.cmd
   mmc dev 0
   setenv kernel netbsd-BPI.ub
   fatload mmc 0:1 82000000 $kernel
   bootm 82000000 root=ld0a console=fb
   $ mkubootimage -A arm -n armv7 -T script boot.cmd boot.scr
   """]]
   
   ...and copy it on the populated (u)SD card:
   
   [[!template id=programlisting text="""
   # mount /dev/sd0e /mnt
   # cp /mnt/boot.scr /mnt/boot.scr.orig
   # cp boot.scr /mnt/
   """]]
   
   
 # Installing via sysinst(8)  # Installing via sysinst(8)
   
 *TODOleot*: Document all sysinst(8) "screenshot"!  Now that the SD card is populated with `armv7.img` we can login as `root` (by
   default the password is empty) and run `sysinst`:
   
 ````  [[!template id=programlisting text="""
 # sysinst  # sysinst
 ````  """]]
   
   The first menu is about the system type (Respberry PI or Other), we select the
   latter ("Other"):
   
 ````  [[!template id=programlisting text="""
   
   
   
Line 48  external media (SATA hard disk, USB stic Line 101  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  We want to install NetBSD/evbarm on the hard disk so let's select
   "Install NetBSD to hard disk":
   
   [[!template id=programlisting text="""
   
  NetBSD/evbarm 8.0   NetBSD/evbarm 8.0
   
Line 77  external media (SATA hard disk, USB stic Line 133  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   Before proceeding with the installation, if the hard disk had any important data
   it is better to stop and doing a backup before proceeding. If it is empty and/or
   we can safetely remove its data we can proceed:
   
 ````  [[!template id=programlisting text="""
   
  You have chosen to install NetBSD on your hard disk.  This will change   You have chosen to install NetBSD on your hard disk.  This will change
  information on your hard disk.  You should have made a full backup before   information on your hard disk.  You should have made a full backup before
Line 106  external media (SATA hard disk, USB stic Line 166  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  Now we can see all the available disks. The hard disk attached via SATA is a
   120GB SSD recognized as `wd0`:
   
   [[!template id=programlisting text="""
   
  On which disk do you want to install NetBSD?   On which disk do you want to install NetBSD?
   
Line 135  external media (SATA hard disk, USB stic Line 198  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   We now need to edit MBR partition table. We will create two MBR partitions: the
   first one a FAT32 for `/boot` and the other for NetBSD. We select "Edit the MBR
   partition table":
   
 ````  [[!template id=programlisting text="""
   
  We are now going to install NetBSD on the disk wd0.   We are now going to install NetBSD on the disk wd0.
   
Line 164  external media (SATA hard disk, USB stic Line 231  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  First we select the second entry ("b"), set the "type:" to "NetBSD":
   
   [[!template id=programlisting text="""
   
  The Current MBR partition table is shown below.   The Current MBR partition table is shown below.
  Flgs: a => Active partition, I => Install here.   Flgs: a => Active partition, I => Install here.
Line 189  external media (SATA hard disk, USB stic Line 258  external media (SATA hard disk, USB stic
              | g: Linux native                   |               | g: Linux native                   |
              | h: Linux swap                     |               | h: Linux swap                     |
              | i: DOS FAT12                      |               | i: DOS FAT12                      |
              | <: page up, >: page down          |               | &lt;: page up, &gt;: page down          |
              +-----------------------------------+               +-----------------------------------+
   
   
 ````  """]]
   
   We reserve for the NetBSD MBR partition all the end of the disk,
   starting at 92MB (1MB that will be empty and 91MB that will be for
   the FAT32), we also select to make it active ("active: Yes") and
   we will use it to install NetBSD ("install: Yes"):
   
 ````  [[!template id=programlisting text="""
   
  The Current MBR partition table is shown below.   The Current MBR partition table is shown below.
  Flgs: a => Active partition, I => Install here.   Flgs: a => Active partition, I => Install here.
Line 222  external media (SATA hard disk, USB stic Line 296  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  We now select the first partition ("a") and create a "Windows FAT32", starting
   at 1MB and ending at 92MB before the "NetBSD" partition. We also make it active
   ("active: Yes"):
   
   [[!template id=programlisting text="""
   
  The Current MBR partition table is shown below.   The Current MBR partition table is shown below.
  Flgs: a => Active partition, I => Install here.   Flgs: a => Active partition, I => Install here.
Line 251  external media (SATA hard disk, USB stic Line 329  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   Here the final MBR partition table:
   
 ````  [[!template id=programlisting text="""
   
  The Current MBR partition table is shown below.   The Current MBR partition table is shown below.
  Flgs: a => Active partition, I => Install here.   Flgs: a => Active partition, I => Install here.
Line 280  external media (SATA hard disk, USB stic Line 360  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   Now that the MBR partition table is written we can proceed to set
   sizes of NetBSD partitions:
   
 ````  [[!template id=programlisting text="""
   
  NetBSD uses a BSD disklabel to carve up the NetBSD portion of the disk into   NetBSD uses a BSD disklabel to carve up the NetBSD portion of the disk into
  multiple BSD partitions.  You must now set up your BSD disklabel.   multiple BSD partitions.  You must now set up your BSD disklabel.
Line 309  external media (SATA hard disk, USB stic Line 392  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  We set the swap size to 4G and we reserve the rest of the space for "/":
   
   [[!template id=programlisting text="""
   
  You can now change the sizes for the system partitions.  The default is to   You can now change the sizes for the system partitions.  The default is to
  allocate all the space to the root file system.  However, you may wish to   allocate all the space to the root file system.  However, you may wish to
Line 338  external media (SATA hard disk, USB stic Line 423  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   The summary of the current BSD disklabel is:
   
 ````  [[!template id=programlisting text="""
   
  We now have your BSD disklabel partitions as:   We now have your BSD disklabel partitions as:
  This is your last chance to change them.   This is your last chance to change them.
Line 367  external media (SATA hard disk, USB stic Line 454  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
 ````  We can adjust the disklabel, for example we can use FFSv2 for "/"
   and for the disklabel "e" set its mount point to "/boot" in order
   that an `/etc/fstab` entry will be populated (please note
   that "/boot" will not be automatically mounted by default):
   
   [[!template id=programlisting text="""
   
  We now have your BSD disklabel partitions as:   We now have your BSD disklabel partitions as:
  This is your last chance to change them.   This is your last chance to change them.
Line 396  external media (SATA hard disk, USB stic Line 488  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   We have finally ready to proceed with
   [[!template id=man name="sysinst" section="8"]] as usual and install
   the installation sets.  If you choose to install via FTP/HTTP please
   note that the "Binary set directory" needs to be adjusted from
   `/evbarm/binary/sets` to `/evbarm-earmv7hf/binary/sets` (it's
   missing an `-earmv7hf' due different evbarm-s):
   
 ````  [[!template id=programlisting text="""
   
  The following are the http site, directory, user, and password that will be   The following are the http site, directory, user, and password that will be
  used.  If "user" is "ftp", then the password is not needed.   used.  If "user" is "ftp", then the password is not needed.
Line 425  external media (SATA hard disk, USB stic Line 524  external media (SATA hard disk, USB stic
   
   
   
 ````  """]]
   
   The installation will proceed as usual and for more information
   please give a look to
   [The NetBSD Guide](https://www.netbsd.org/docs/guide/en/chap-exinst.html#exinst-choose-media).
   
   When the installation is completed, back to the shell we can populate
   `/boot` partition of the hard disk ("wd0e") by just copying all
   files of the `/boot` partition of the (u)SD card (`armv7.img`):
   
 ````  [[!template id=programlisting text="""
 # mount /dev/wd0e /mnt  # mount /dev/wd0e /mnt
 # cp -r /boot/* /mnt/  # cp -r /boot/* /mnt/
 ````  # umount /mnt
   """]]
   
 *TODOleot*: add a reference to The NetBSD Guide for further steps of the  Finally we can prepare a u-boot script (`boot.scr`) to load the kernel from the
 installation.   SATA hard disk and boot it:
   
 *TODOleot*: add information how to populate `/boot` and prepare `boot.cmd`,  [[!template id=programlisting text="""
 `boot.scr`.  $ cat boot.cmd
   scsi scan
   scsi dev 0
   setenv kernel netbsd-BPI.ub
   fatload scsi 0:1 82000000 $kernel
   bootm 82000000 root=wd0a console=fb
   $ mkubootimage -A arm -n armv7 -T script boot.cmd boot.scr
   """]]
   
   ...and copy them to the (u)SD `/boot`:
   
   [[!template id=programlisting text="""
   # cp boot.scr /boot
   """]]
   
   Please remember that in the early boot phase, u-boot and `boot.scr`
   are loaded from the (u)SD card and it loads the kernel present in
   the `/boot` partition of the hard disk.
   
   
 # References  # References

Removed from v.1.2  
changed lines
  Added in v.1.11


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb