File:  [NetBSD Developer Wiki] / wikisrc / ports / evbarm / install_using_sysinst.mdwn
Revision 1.8: download - view: text, annotated - select for diffs
Mon Nov 19 21:36:09 2018 UTC (5 years ago) by leot
Branches: MAIN
CVS tags: HEAD
Use programlisting template, improve formatting and use `#' for commands that
should be probably invoked as root.

    1: [[!meta title="NetBSD/evbarm install via sysinst(8) on a SATA hard disk, USB stick or (u)SD card"]]
    2: 
    3: In this document we will see step by step how to install NetBSD/evbarm on an
    4: external media (SATA hard disk, USB stick or (u)SD card) using
    5: [[!template id=man name="sysinst" section="8"]].
    6: 
    7: As practical example a BananaPI and a SATA hard disk will be used.
    8: However, the following instructions can be probably easily applied
    9: on other SoCs and medias with little adjustments.
   10: 
   11: 
   12: # Populating (u)SD card with `armv7.img`
   13: 
   14: - Download or build `armv7.img`, e.g.:
   15: 
   16: [[!template id=programlisting text="""
   17: $ ftp http://cdn.NetBSD.org/pub/NetBSD/NetBSD-8.0/evbarm-earmv7hf/binary/gzimg/armv7.img.gz
   18: $ gunzip armv7.img.gz
   19: """]]
   20: 
   21: - Write the image to (u)SD card:
   22: 
   23: [[!template id=programlisting text="""
   24: # dd if=armv7.img of=/dev/rsd0d bs=1m conv=sync
   25: """]]
   26: 
   27: - Write u-boot to (u)SD card. `u-boot` images are provided by
   28: `sysutils/u-boot-<boardname>` packages, for example for Allwinner SoC:
   29: 
   30: [[!template id=programlisting text="""
   31: # dd if=/usr/pkg/share/u-boot/<boardname>/u-boot-sunxi-with-spl.bin of=/dev/rld0d bs=1k seek=8 conv=sync
   32: """]]
   33: 
   34: *TODOleot*: Adjust/provide u-boot incantantions to boot on a BPI
   35: 
   36: 
   37: # Installing via sysinst(8)
   38: 
   39: *TODOleot*: Document all sysinst(8) "screenshot"!
   40: 
   41: Now that the SD card is populated with `armv7.img` we can login as `root` (by
   42: default the password is empty) and run `sysinst`:
   43: 
   44: [[!template id=programlisting text="""
   45: # sysinst
   46: """]]
   47: 
   48: The first menu is about the system type (Respberry PI or Other), we select the
   49: latter ("Other"):
   50: 
   51: [[!template id=programlisting text="""
   52: 
   53: 
   54: 
   55: 
   56: 
   57: 
   58: 
   59: 
   60: 
   61: 
   62:                     +-------------------------------------+
   63:                     | What kind of system do you have?    |
   64:                     |                                     |
   65:                     | a: Raspberry PI                     |
   66:                     |>b: Other                            |
   67:                     +-------------------------------------+
   68: 
   69: 
   70: 
   71: 
   72: 
   73: 
   74: 
   75: 
   76: 
   77: 
   78: """]]
   79: 
   80: We want to install NetBSD/evbarm on the hard disk so let's select
   81: "Install NetBSD to hard disk":
   82: 
   83: [[!template id=programlisting text="""
   84: 
   85:  NetBSD/evbarm 8.0
   86: 
   87:  This menu-driven tool is designed to help you install NetBSD to a hard disk,
   88:  or upgrade an existing NetBSD system, with a minimum of work.
   89:  In the following menus type the reference letter (a, b, c, ...) to select an
   90:  item, or type CTRL+N/CTRL+P to select the next/previous item.
   91:  The arrow keys and Page-up/Page-down may also work.
   92:  Activate the current selection from the menu by typing the enter key.
   93: 
   94:  If you booted from a floppy, you may now remove the disk.
   95:  Thank you for using NetBSD!
   96:                +-----------------------------------------------+
   97:                | NetBSD-8.0 Install System                     |
   98:                |                                               |
   99:                |>a: Install NetBSD to hard disk                |
  100:                | b: Upgrade NetBSD on a hard disk              |
  101:                | c: Re-install sets or install additional sets |
  102:                | d: Reboot the computer                        |
  103:                | e: Utility menu                               |
  104:                | f: Config menu                                |
  105:                | x: Exit Install System                        |
  106:                +-----------------------------------------------+
  107: 
  108: 
  109: 
  110: """]]
  111: 
  112: Before proceeding with the installation, if the hard disk had any important data
  113: it is better to stop and doing a backup before proceeding. If it is empty and/or
  114: we can safetely remove its data we can proceed:
  115: 
  116: [[!template id=programlisting text="""
  117: 
  118:  You have chosen to install NetBSD on your hard disk.  This will change
  119:  information on your hard disk.  You should have made a full backup before
  120:  this procedure!  This procedure will do the following things:
  121:          a) Partition your disk
  122:          b) Create new BSD file systems
  123:          c) Load and install distribution sets
  124:          d) Some initial system configuration
  125: 
  126:  (After you enter the partition information but before your disk is changed,
  127:  you will have the opportunity to quit this procedure.)
  128: 
  129:  Shall we continue?
  130:                                +---------------+
  131:                                | yes or no?    |
  132:                                |               |
  133:                                | a: No         |
  134:                                |>b: Yes        |
  135:                                +---------------+
  136: 
  137: 
  138: 
  139: 
  140: 
  141: 
  142: 
  143: """]]
  144: 
  145: Now we can see all the available disks. The hard disk attached via SATA is a
  146: 120GB SSD recognized as `wd0`:
  147: 
  148: [[!template id=programlisting text="""
  149: 
  150:  On which disk do you want to install NetBSD?
  151: 
  152: 
  153:                      +-----------------------------------+
  154:                      | Available disks                   |
  155:                      |                                   |
  156:                      |>a: wd0 (112G, SanDisk SDSSDA120G) |
  157:                      | b: Extended partitioning          |
  158:                      | x: Exit                           |
  159:                      +-----------------------------------+
  160: 
  161: 
  162: 
  163: 
  164: 
  165: 
  166: 
  167: 
  168: 
  169: 
  170: 
  171: 
  172: 
  173: 
  174: 
  175: """]]
  176: 
  177: We now need to edit MBR partition table. We will create two MBR partitions: the
  178: first one a FAT32 for `/boot` and the other for NetBSD. We select "Edit the MBR
  179: partition table":
  180: 
  181: [[!template id=programlisting text="""
  182: 
  183:  We are now going to install NetBSD on the disk wd0.
  184: 
  185:  NetBSD requires a single partition in the disk's MBR partition table, this is
  186:  split further by the NetBSD disklabel.  NetBSD can also access file systems
  187:  in other MBR partitions.
  188: 
  189:  If you select 'Use the entire disk' then the previous contents of the disk
  190:  will be overwritten and a single MBR partition used to cover the entire disk.
  191:  If you want to install more than one operating system then edit the MBR
  192:  partition table and create a partition for NetBSD.
  193: 
  194:  A few hundred MB is enough for a basic installation, but you should allow
  195:  extra for additional software and user files.
  196:  Allow at least 5GB if you want to build NetBSD itself.
  197:                       +---------------------------------+
  198:                       | Which would you like to do?     |
  199:                       |                                 |
  200:                       |>a: Edit the MBR partition table |
  201:                       | b: Use the entire disk          |
  202:                       +---------------------------------+
  203: 
  204: 
  205: 
  206: 
  207: 
  208: """]]
  209: 
  210: First we select the second entry ("b"), set the "type:" to "NetBSD":
  211: 
  212: [[!template id=programlisting text="""
  213: 
  214:  The Current MBR partition table is shown below.
  215:  Flgs: a => Active partition, I => Install here.
  216:  Select the partition you wish to change:
  217: 
  218:     Total disk size 114473 MB.
  219:                +-----------------------------------------------------------+
  220:     Start( MB) |>a:       type: unused                                     |
  221:     ---------- | b:      start: 0 MB                                       |
  222:  a:            | c:       size: 0 MB                                       |
  223: >b:            | d:        end: 0 MB                                       |
  224:  c:            | e:     active: No                                         |
  225:  d:          +-----------------------------------+                         |
  226:  e: Change in| a: Don't change                   |linders/MB)              |
  227:  x: Partition| b: Delete partition               |                         |
  228:              |>c: NetBSD                         |-------------------------+
  229:              | d: Extended partition, LBA        |
  230:              | e: FreeBSD/386BSD                 |
  231:              | f: OpenBSD                        |
  232:              | g: Linux native                   |
  233:              | h: Linux swap                     |
  234:              | i: DOS FAT12                      |
  235:              | <: page up, >: page down          |
  236:              +-----------------------------------+
  237: 
  238: 
  239: """]]
  240: 
  241: We reserve for the NetBSD MBR partition all the end of the disk,
  242: starting at 92MB (1MB that will be empty and 91MB that will be for
  243: the FAT32), we also select to make it active ("active: Yes") and
  244: we will use it to install NetBSD ("install: Yes"):
  245: 
  246: [[!template id=programlisting text="""
  247: 
  248:  The Current MBR partition table is shown below.
  249:  Flgs: a => Active partition, I => Install here.
  250:  Select the partition you wish to change:
  251: 
  252:     Total disk size 114473 MB.
  253:                +-----------------------------------------------------------+
  254:     Start( MB) | a:       type: NetBSD                                     |
  255:     ---------- | b:      start: 92 MB                                      |
  256:  a:            | c:       size: 114381 MB                                  |
  257: >b:            | d:        end: 114473 MB                                  |
  258:  c:            | e:     active: Yes                                        |
  259:  d:            | f:    install: Yes                                        |
  260:  e: Change inpu| g: Change input units (sectors/cylinders/MB)              |
  261:  x: Partition t|>x: Partition OK                                           |
  262:                +-----------------------------------------------------------+
  263: 
  264: 
  265: 
  266: 
  267: 
  268: 
  269: 
  270: 
  271: 
  272: 
  273: """]]
  274: 
  275: We now select the first partition ("a") and create a "Windows FAT32", starting
  276: at 1MB and ending at 92MB before the "NetBSD" partition. We also make it active
  277: ("active: Yes"):
  278: 
  279: [[!template id=programlisting text="""
  280: 
  281:  The Current MBR partition table is shown below.
  282:  Flgs: a => Active partition, I => Install here.
  283:  Select the partition you wish to change:
  284: 
  285:     Total disk size 114473 MB.
  286:                +-----------------------------------------------------------+
  287:     Start( MB) | a:       type: Windows FAT32                              |
  288:     ---------- | b:      start: 1 MB                                       |
  289: >a:            | c:       size: 91 MB                                      |
  290:  b:         92 | d:        end: 92 MB                                      |
  291:  c:            | e:     active: Yes                                        |
  292:  d:            | f:    install: No                                         |
  293:  e: Change inpu| g: Change input units (sectors/cylinders/MB)              |
  294:  x: Partition t|>x: Partition OK                                           |
  295:                +-----------------------------------------------------------+
  296: 
  297: 
  298: 
  299: 
  300: 
  301: 
  302: 
  303: 
  304: 
  305: 
  306: """]]
  307: 
  308: Here the final MBR partition table:
  309: 
  310: [[!template id=programlisting text="""
  311: 
  312:  The Current MBR partition table is shown below.
  313:  Flgs: a => Active partition, I => Install here.
  314:  Select the partition you wish to change:
  315: 
  316:     Total disk size 114473 MB.
  317: 
  318:     Start( MB)  Size( MB) Flg Kind
  319:     ---------- ---------- --- ----------------
  320: >a:          1         91 a   Windows FAT32
  321:  b:         92     114381   I NetBSD
  322:  c:                           unused
  323:  d:                           unused
  324:  e: Change input units (sectors/cylinders/MB)
  325:  x: Partition table OK
  326: 
  327: 
  328: 
  329: 
  330: 
  331: 
  332: 
  333: 
  334: 
  335: 
  336: 
  337: """]]
  338: 
  339: Now that the MBR partition table is written we can proceed to set
  340: sizes of NetBSD partitions:
  341: 
  342: [[!template id=programlisting text="""
  343: 
  344:  NetBSD uses a BSD disklabel to carve up the NetBSD portion of the disk into
  345:  multiple BSD partitions.  You must now set up your BSD disklabel.
  346: 
  347:  You can use a simple editor to set the sizes of the NetBSD partitions, or
  348:  keep the existing partition sizes and contents.
  349: 
  350:  You will then be given the opportunity to change any of the disklabel fields.
  351: 
  352:  The NetBSD part of your disk is 114381 Megabytes.  A full installation
  353:  requires at least 288 Megabytes without X and at least 348 Megabytes if the X
  354:  sets are included.
  355:                      +-----------------------------------+
  356:                      | Choose your installation          |
  357:                      |                                   |
  358:                      |>a: Set sizes of NetBSD partitions |
  359:                      | b: Use existing partition sizes   |
  360:                      +-----------------------------------+
  361: 
  362: 
  363: 
  364: 
  365: 
  366: 
  367: 
  368: 
  369: """]]
  370: 
  371: We set the swap size to 4G and we reserve the rest of the space for "/":
  372: 
  373: [[!template id=programlisting text="""
  374: 
  375:  You can now change the sizes for the system partitions.  The default is to
  376:  allocate all the space to the root file system.  However, you may wish to
  377:  have separate /usr (additional system files), /var (log files etc) or /home
  378:  (users' home directories) file systems.
  379: 
  380:  Free space will be added to the partition marked with a '+'.
  381: 
  382:         MB         Cylinders   Sectors   Filesystem
  383:     a:   2208(110284)      4488   4523904 + /
  384:     b:   4096              8323   8389584   swap
  385:     c:      0                 0         0   /tmp (mfs)
  386:     d:      0                 0         0   /usr
  387:     e:      0                 0         0   /var
  388:     f:      0                 0         0   /home
  389:     g: Add a user defined partition
  390:     h: Change input units (sectors/cylinders/MB)
  391:    >x: Accept partition sizes.  Free space 108076 MB, 13 free partitions.
  392: 
  393: 
  394: 
  395: 
  396: 
  397: 
  398: 
  399: 
  400: """]]
  401: 
  402: The summary of the current BSD disklabel is:
  403: 
  404: [[!template id=programlisting text="""
  405: 
  406:  We now have your BSD disklabel partitions as:
  407:  This is your last chance to change them.
  408: 
  409:     Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
  410:     --------- --------- --------- ---------- ----- ----- -----------
  411: >a:        92    110375    110284 FFSv1      Yes   Yes   /
  412:  b:    110376    114472      4096 swap
  413:  c:         0    114472    114473 Whole disk
  414:  d:         0         0         0 unused
  415:  e:         1        91        91 Boot partition
  416:  f:         0         0         0 unused
  417:  g: Show all unused partitions
  418:  h: Change input units (sectors/cylinders/MB)
  419:  x: Partition sizes ok
  420: 
  421: 
  422: 
  423: 
  424: 
  425: 
  426: 
  427: 
  428: 
  429: 
  430: 
  431: """]]
  432: 
  433: We can adjust the disklabel, for example we can use FFSv2 for "/"
  434: and for the disklabel "e" set its mount point to "/boot" in order
  435: that an `/etc/fstab` entry will be populated (please note
  436: that "/boot" will not be automatically mounted by default):
  437: 
  438: [[!template id=programlisting text="""
  439: 
  440:  We now have your BSD disklabel partitions as:
  441:  This is your last chance to change them.
  442: 
  443:     Start  MB   End  MB  Size  MB FS type    Newfs Mount Mount point
  444:     --------- --------- --------- ---------- ----- ----- -----------
  445:  a:        92    110375    110284 FFSv2      Yes   Yes   /
  446:  b:    110376    114472      4096 swap
  447:  c:         0    114472    114473 Whole disk
  448:  d:         0         0         0 unused
  449:  e:         1        91        91 Boot partition             /boot
  450:  f:         0         0         0 unused
  451:  g: Show all unused partitions
  452:  h: Change input units (sectors/cylinders/MB)
  453: >x: Partition sizes ok
  454: 
  455: 
  456: 
  457: 
  458: 
  459: 
  460: 
  461: 
  462: 
  463: 
  464: 
  465: """]]
  466: 
  467: We have finally ready to proceed with
  468: [[!template id=man name="sysinst" section="8"]] as usual and install
  469: the installation sets.  If you choose to install via FTP/HTTP please
  470: note that the "Binary set directory" needs to be adjusted from
  471: `/evbarm/binary/sets` to `/evbarm-earmv7hf/binary/sets` (it's
  472: missing an `-earmv7hf' due different evbarm-s):
  473: 
  474: [[!template id=programlisting text="""
  475: 
  476:  The following are the http site, directory, user, and password that will be
  477:  used.  If "user" is "ftp", then the password is not needed.
  478: 
  479:  a: Host                      ftp.NetBSD.org
  480:  b: Base directory            pub/NetBSD/NetBSD-8.0
  481: >c: Binary set directory      /evbarm-earmv7hf/binary/sets
  482:  d: Source set directory      /source/sets
  483:  e: User                      ftp
  484:  f: Password
  485:  g: Proxy
  486:  h: Transfer directory        /usr/INSTALL
  487:  i: Delete after install      No
  488:  j: Configure network
  489:  k: Exit
  490:  x: Get Distribution
  491: 
  492: 
  493: 
  494: 
  495: 
  496: 
  497: 
  498: 
  499: 
  500: 
  501: """]]
  502: 
  503: The installation will proceed as usual and for more information
  504: please give a look to
  505: [The NetBSD Guide](https://www.netbsd.org/docs/guide/en/chap-exinst.html#exinst-choose-media).
  506: 
  507: *TODOleot*: add information how to populate `/boot` and prepare `boot.cmd`,
  508: `boot.scr`.
  509: 
  510: [[!template id=programlisting text="""
  511: # mount /dev/wd0e /mnt
  512: # cp -r /boot/* /mnt/
  513: """]]
  514: 
  515: 
  516: # References
  517: 
  518: *TODOleot*: add a reference to the instructions shared via PR port-evbarm/50806.

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