Annotation of wikisrc/ports/evbarm/install_using_sysinst.mdwn, revision 1.7

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

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