Annotation of wikisrc/ports/sandpoint/instlinkstation.mdwn, revision 1.5

1.1       mspo        1: Introduction
                      2: ============
                      3: 
                      4: <table>
                      5: <tbody>
                      6: <tr class="odd">
1.2       phx         7: <td align="left"><p>This document describes in depth how to prepare your Buffalo LinkStation for installing NetBSD/sandpoint. In this example we use a LinkStation HD-HLAN, which is the same board as a classic KuroBox. The software installation instructions are valid for the whole LinkStation/KuroBox family:</p>
1.1       mspo        8: <ul>
                      9: <li>LinkStation HD-HLAN (LS1/PPC)</li>
                     10: <li>LinkStation HD-HGLAN (Gigabit ethernet)</li>
                     11: <li>TeraStation HD-HTGL</li>
                     12: <li>TeraStation Pro TS-TGL</li>
                     13: <li>KuroBox classic (HD-HLAN board)</li>
                     14: <li>KuroBox HG (HD-HGLAN board)</li>
                     15: <li>KuroBox/T4 (TS-TGL board)</li>
                     16: </ul></td>
1.3       phx        17: <td align="left"><img src="http://www.netbsd.org/images/ports/sandpoint/ls1_front.jpg" alt="HD-HLAN front view" /></td>
1.1       mspo       18: </tr>
                     19: </tbody>
                     20: </table>
                     21: 
                     22: Accessing the serial interface
                     23: ==============================
                     24: 
                     25: We need a serial console to get access to the firmware. That includes
                     26: soldering a four pin header onto the board and building (or buying) a
                     27: serial adapter from the LinkStation's TTL levels to RS232 levels.
                     28: 
                     29: Disassemble the HD-HLAN
                     30: -----------------------
                     31: 
                     32: Unfortunately the LinkStation was not meant to be opened by customers,
                     33: so Buffalo didn't make it easy. On the top and bottom of the case there
                     34: is a small tab besides the grey frame, which you have to press down
                     35: (e.g. with a screwdriver) to be able to move the frame to the front. On
                     36: the photo below the location is marked red.
                     37: 
1.4       phx        38: <img src="//www.netbsd.org/images/ports/sandpoint/kuro_top.jpg" alt="KuroBox with tab marked" /></td>
                     39: 
1.1       mspo       40: After a few millimeters the grey piece snaps free and comes up. You need
                     41: quite some force to do that, because the shiny front bezel is secured by
                     42: two hidden screws (one in the top and another in the bottom of the
                     43: bezel). With enough force and skill you may be able to tear the screws
                     44: out of the case (fortunately the screws are small). They remain in the
                     45: shiny bezel. You may want to shorten the screws with a file now.
                     46: 
1.4       phx        47: <img src="//www.netbsd.org/images/ports/sandpoint/ls1_opened.jpg" alt="HD-HLAN half opened" /></td>
                     48: 
1.1       mspo       49: Before the case can be opened you have to remove a screw hidden under a
                     50: sticker, below the fan (marked on the right side of the picture). Then
                     51: press the four tabs on the top and bottom to remove the upper half of
                     52: the case. Remove another four screws to be able to lift the board.
                     53: 
                     54: Locate the serial header
                     55: ------------------------
                     56: 
                     57: Look out for a 4-pin header, called `J1`, which is usually unpopulated.
                     58: The pin assignments are:
                     59: 
                     60: <table>
                     61: <tbody>
                     62: <tr class="odd">
                     63: <td align="left"><table>
                     64: <tbody>
                     65: <tr class="odd">
                     66: <td align="left"><strong>Pin number</strong></td>
                     67: <td align="left"><strong>Function</strong></td>
                     68: </tr>
                     69: <tr class="even">
                     70: <td align="left">1</td>
                     71: <td align="left">TXD</td>
                     72: </tr>
                     73: <tr class="odd">
                     74: <td align="left">2</td>
                     75: <td align="left">RXD</td>
                     76: </tr>
                     77: <tr class="even">
                     78: <td align="left">3</td>
                     79: <td align="left">3.3V</td>
                     80: </tr>
                     81: <tr class="odd">
                     82: <td align="left">4</td>
                     83: <td align="left">GND</td>
                     84: </tr>
                     85: </tbody>
                     86: </table></td>
1.3       phx        87: <td align="left"><img src="http://www.netbsd.org/images/ports/sandpoint/ls1_ser_pins.jpg" alt="Header pin assignments" /></td>
1.1       mspo       88: </tr>
                     89: </tbody>
                     90: </table>
                     91: 
                     92: Solder the missing header and enable write access
                     93: -------------------------------------------------
                     94: 
                     95: I would suggest to solder the 4-pin header on the back side of the PCB,
                     96: because it is better accessible when opening the case. It is advisable
                     97: to use an angled header to avoid problems closing the case. You also
                     98: have to bridge `R76`, which is unoccupied. This is needed to enable
                     99: write-access for the serial console. You may want to mark pin 1 of the
                    100: header, before installing the board again.
                    101: 
                    102: <table>
                    103: <tbody>
                    104: <tr class="odd">
1.3       phx       105: <td align="left"><img src="http://www.netbsd.org/images/ports/sandpoint/ls1_ser_header.jpg" alt="Soldered header" /></td>
                    106: <td align="left"><img src="http://www.netbsd.org/images/ports/sandpoint/ls1_R76.jpg" alt="Bridging R76" /></td>
1.1       mspo      107: </tr>
                    108: </tbody>
                    109: </table>
                    110: 
                    111: Connect a serial cable
                    112: ----------------------
                    113: 
                    114: The serial port on LinkStation and KuroBox devices is using 3.3V TTL
                    115: levels, which have to be converted into regular RS232 levels by a level
                    116: shifter circuit. If you are not anxious using a soldering iron you find
                    117: detailed instructions how to build such a converter here:
                    118: 
1.4       phx       119: -   [Serial adapter for 3.3V TTL](http://www.netbsd.org/ports/sandpoint/ttl2rs232.html)
1.1       mspo      120: 
                    121: Make sure that the layout of the plug fits to the pinout of the
                    122: LinkStation's serial header, as shown above.
                    123: 
                    124: Another option is to buy such a converter. There are solutions for a
                    125: standard RS232 interface and for an USB interface. Look out for:
                    126: 
                    127: -   RS232 level shifter / breakout board (MAX3232 based)
                    128: -   USB to TLL serial level shifter / breakout board (FT232 based)
                    129: 
                    130: Now you can connect with any terminal program to the LinkStation's
1.2       phx       131: serial console. The easiest approach may be to use NetBSD's `tip(1)` command
1.1       mspo      132: to make a direct console connection at 57600bps.
                    133: 
                    134:     # tip -57600 console
                    135: 
                    136: Note that when using a serial connection via USB you may have to make an
                    137: entry for `/dev/ttyU0` in `/etc/remote`.
                    138: 
                    139: Replace the firmware with U-Boot
                    140: ================================
                    141: 
                    142: The LinkStations run with a proprietary firmware, which doesn't give you
                    143: any control about the boot process. So our next step is to replace it
                    144: with [U-Boot](http://www.denx.de/wiki/U-Boot/).
                    145: 
                    146: Getting root access
                    147: -------------------
                    148: 
                    149: We need root access on the vendor's Linux installation to be able to
                    150: flash a new firmware. Without the original disk it will become much more
                    151: difficult. You would either have to find a way to install the system
                    152: onto a new disk with the help of a second machine, or use the JTAG port
                    153: to flash the new firmware directly into the chip (in the last case you
1.4       phx       154: can skip all sections until
                    155: [the section called &#8220;First installation&#8221;](#install) ).
1.1       mspo      156: 
                    157: For the KuroBox you can skip this section. The root password is known to
                    158: be `kuro`. Also telnet access is enabled. The default IP of the KuroBox
                    159: is `192.168.11.150`.
                    160: 
                    161: Make a new user over the LinkStation's web interface. We can use it to
                    162: log in over the serial port.
                    163: 
1.4       phx       164: <img src="//www.netbsd.org/images/ports/sandpoint/ls1_new_user.jpg" alt="Add a new user on the GUI" /></td>
                    165: 
1.1       mspo      166: Log in into the new account and create a CGI file under `/www` which
                    167: makes `/etc/passwd` writeable for all users.
                    168: 
1.4       phx       169: <pre>
                    170: BUFFALO INC. Link Station series HD-HLAN (HIDETADA)
1.1       mspo      171: 
1.4       phx       172: BUFFALO login: <strong>Besucher</strong>
                    173: Password: 
                    174: Linux (none) 2.4.17_mvl21-sandpoint #990 2004xxxx 13:39:00 JST ppc unknown
                    175: Besucher@BUFFALO:~$ <strong>mkdir /www/cgi-bin3</strong>
                    176: Besucher@BUFFALO:~$ <strong>vi /www/cgi-bin3/exploit.cgi</strong>
                    177: </pre>
1.1       mspo      178: 
                    179: `exploit.cgi` should look like this:
                    180: 
                    181:     #!/bin/sh
                    182:     chmod 666 /etc/passwd
                    183: 
                    184: Then enter the URL `http://mylinkstation/cgi-bin3/exploit.cgi` into your
                    185: browser. When all went well, `/etc/passwd` is writeable now. Edit it
1.4       phx       186: with **vi** and copy your user password (`/Jg58Gq9427qY` in this example)
1.1       mspo      187: over the current root password. Now you can log in with the same
                    188: password into the root account.
                    189: 
                    190:     root:dwqa1LabM8BgA:0:0:root:/root:/bin/bash
                    191:     bin:*:1:1:bin:/bin:
                    192:     daemon:*:2:2:daemon:/usr/sbin:
                    193:     sys:*:3:3:sys:/dev:
                    194:     adm:*:4:4:adm:/var/adm:
                    195:     sync:*:6:8:sync:/bin:/bin/sync
                    196:     shutdown:*:7:9:shutdown:/sbin:/sbin/shutdown
                    197:     halt:*:8:10:halt:/sbin:/sbin/halt
                    198:     operator:*:12:0:operator:/root:
                    199:     ftp:*:15:14:ftp:/usr/sbin:/bin/false
                    200:     nobody:*:99:99:nobody:/home:/bin/sh
                    201:     Besucher:/Jg58Gq9427qY:101:1000::/home:/bin/bash
                    202: 
                    203: The CGI exploit, which I described above, probably does not work with
                    204: all Linkstation firmware releases. It may fail with versions after 1.45.
                    205: I was able to do it with 1.47 though. An alternative to this method
                    206: would be to connect the hard disk to a second machine, which can mount
                    207: the Linux file system, and replace the root password there.
                    208: 
                    209: Flashing U-Boot
                    210: ---------------
                    211: 
                    212: To transfer the new firmware onto the LinkStation we first have to
                    213: configure FTP access (already enabled for KuroBox). Enable the server
                    214: and allow write access for registered users to the shared folders (e.g.
                    215: `share`).
                    216: 
1.4       phx       217: <img src="//www.netbsd.org/images/ports/sandpoint/ls1_ftp_enable.jpg" alt="Enable FTP access with the GUI" /></td>
                    218: 
1.1       mspo      219: Get an appropriate U-Boot firmware image from
1.5     ! phx       220: <http://www.genbako.com/u-boot_loader/> (URL is obsolete, use copies below):
1.1       mspo      221: 
1.4       phx       222: -   [LinkStation HD-HLAN or KuroBox classic](http://www.netbsd.org/~phx/LinkStation/u-boot-hd.flash.bin)
                    223: -   [LinkStation HD-HGLAN or KuroBox HG](http://www.netbsd.org/~phx/LinkStation/u-boot-hg.flash.bin)
1.1       mspo      224: 
                    225: Transfer the firmware into the `share` folder on the LinkStation.
                    226: 
1.4       phx       227: <pre>
                    228: $ <strong>ftp mylinkstation</strong>
                    229: Connected to 192.168.0.9.
                    230: 220 BUFFALO FTP server ready
                    231: Name (192.168.0.9:user): <strong>Besucher</strong>
                    232: 331 Password required for Besucher.
                    233: Password: 
                    234: 230 User Besucher logged in.
                    235: Remote system type is UNIX.
                    236: Using binary mode to transfer files.
                    237: ftp> <strong>cd share</strong>
                    238: 250 CWD command successful.
                    239: ftp> <strong>put u-boot-hd.flash.bin</strong>
                    240: local: u-boot-hd.flash.bin remote: u-boot-hd.flash.bin
                    241: 229 Entering Extended Passive Mode (|||1045|)
                    242: 150 Opening BINARY mode data connection for u-boot-hd.flash.bin
                    243: 100% |***********************************|   170 KiB    6.07 MiB/s    00:00
                    244: ETA
                    245: 226 Transfer complete.
                    246: 174640 bytes sent in 00:00 (4.86 MiB/s)
                    247: ftp> <strong>quit</strong>
                    248: </pre>
1.1       mspo      249: 
                    250: The next step is dangerous. Any fault, like a wrong firmware or an
                    251: interrupted flashing process, will turn your LinkStation into a brick.
                    252: 
                    253: The boot loader firmware can be accessed from Linux through `/dev/fl2`.
1.4       phx       254: There is no **dd** so we will use **cat**. Log in as root on the serial
1.1       mspo      255: console, go to the shared folder where we uploaded the new firmware and
                    256: flash it.
                    257: 
1.4       phx       258: <pre>
                    259: root@BUFFALO:~# <strong>cd /mnt/share</strong>
                    260: root@BUFFALO:/mnt/share# <strong>ls -l</strong>
                    261: total 176
                    262: -rw-rw-rw-    1 Besucher hdusers    174640 May 13 15:43 u-boot-hd.flash.bin
                    263: root@BUFFALO:/mnt/share# <strong>cat u-boot-hd.flash.bin > /dev/fl2</strong>
                    264: </pre>
1.1       mspo      265: 
                    266: The Diag and Disk Full LEDs will flash red during this process. This is
                    267: normal. After a few seconds the LEDs are off again and the prompt
                    268: returns. To make sure the process was successful, you should reread the
                    269: firmware from the flash and compare it with the original. Therefore you
                    270: have to download the new image, as this Linux installation also got no
1.4       phx       271: **cmp**.
1.1       mspo      272: 
1.4       phx       273: <pre>
                    274: root@BUFFALO:/mnt/share# <strong>cat /dev/fl2 > /mnt/share/newfl2</strong>
                    275: </pre>
1.1       mspo      276: 
                    277: Here the downloaded image differs at character 174641. But that is ok,
                    278: because the firmware is only 174640 bytes large and we downloaded the
                    279: whole flash contents.
                    280: 
1.4       phx       281: <pre>
                    282: $ <strong>cmp -l newfl2 u-boot-hd.flash.bin</strong>
                    283: cmp: EOF on u-boot-hd.flash.bin: char 174641, line 891
                    284: </pre>
1.1       mspo      285: 
                    286: Reboot your LinkStation and cross fingers. When all went well, the
                    287: following lines will appear on your serial console:
                    288: 
                    289:     U-Boot 1.1.4 LiSt 2.1.0 (Sep 21 2006 - 00:22:56) LinkStation / KuroBox
                    290: 
                    291:     CPU:   MPC8245 Revision 1.4 at 196.608 MHz: 16 kB I-Cache 16 kB D-Cache
                    292:     DRAM:  64 MB
                    293:     FLASH:  4 MB
                    294:     *** Warning - bad CRC, using default environment
                    295: 
                    296:             00  0b  1317  0985  0200  ff
                    297:             00  0c  1095  0680  0101  ff
                    298:             00  0e  1033  0035  0c03  ff
                    299:             00  0e  1033  0035  0c03  ff
                    300:             00  0e  1033  00e0  0c03  ff
                    301:     Net:   COMET#0
                    302: 
                    303: This precompiled U-Boot defaults to the `netcat` console. So we have to
                    304: wait about 20 seconds before an error is printed and the console returns
                    305: to serial.
                    306: 
                    307:     next_cons_choice: Unexpected code: 0x33
                    308:     stdin :   serial
                    309:     stdout:   serial
                    310:     stderr:   serial
                    311:     IDE:   Bus 0: OK 
                    312:       Device 0: Model: SAMSUNG SP1604N Firm: TM100-30 Ser#: S013J20XC0xxxx
                    313:                 Type: Hard Disk
                    314:                 Supports 48-bit addressing
                    315:                 Capacity: 152627.8 MB = 149.0 GB (312581808 x 512)
                    316:     Boot in 08 seconds ('s' to stop)...
                    317: 
1.5     ! phx       318: Here you should press **s** to stop booting and change some environment
1.1       mspo      319: variables to make U-Boot default to serial.
                    320: 
1.4       phx       321: <pre>
                    322: =&gt; <strong>run ser</strong>
                    323: =&gt; <strong>setenv bootcmd</strong>
                    324: =&gt; <strong>setenv bootdelay -1</strong>
                    325: =&gt; <strong>saveenv</strong>
                    326: </pre>
1.1       mspo      327: 
1.4       phx       328: Enter **reset** to reboot into interactive mode with serial console. At
1.1       mspo      329: this point we no longer need the original Linux installation and we are
1.2       phx       330: ready for NetBSD.
1.1       mspo      331: 
1.5     ! phx       332: <a name="install"></a>
1.1       mspo      333: First installation
                    334: ==================
                    335: 
                    336: The altboot bootloader
                    337: ----------------------
                    338: 
                    339: The `altboot(8)` program functions as a bridge between the U-Boot
1.2       phx       340: firmware and the NetBSD kernel startup environment. NAS firmware often
1.1       mspo      341: provides no means to boot a kernel from disk or from the network and
                    342: doesn't initialize all hardware correctly. We will also use it to pass a
                    343: bootinfo list to the kernel.
                    344: 
                    345: The `altboot` boot loader has to be loaded and started using U-Boot. For
                    346: the first installation we have to load it over the network with TFTP
1.4       phx       347: protocol, using the command **tftpboot**. Later we can put `altboot` into
1.1       mspo      348: the flash memory and copy it from there.
                    349: 
                    350: When not already done, enable TFTP on your working system in
                    351: `/etc/inetd.conf` and restart `inetd`. Then copy `altboot.bin` from the
                    352: sandpoint distribution into `/tftpboot`. On the LinkStation we have to
                    353: tell U-Boot its client address and the `tftpd` server address. Our
                    354: working system's server address is `192.168.0.5` in this example, and
                    355: the LinkStation is at `192.168.0.102`.
                    356: 
1.4       phx       357: <pre>
                    358: =&gt; <strong>setenv ipaddr 192.168.0.102</strong>
                    359: =&gt; <strong>setenv serverip 192.168.0.5</strong>
                    360: =&gt; <strong>saveenv</strong>
                    361: Saving Environment to Flash...
                    362: Un-Protected 1 sectors
                    363: Erasing Flash...
                    364: Flash erase: first = 54 @ 0xfff60000
                    365:              last  = 54 @ 0xfff60000
                    366: Flash erase: Done
                    367: Erased 1 sectors
                    368: Writing to Flash... done
                    369: Protected 1 sectors
                    370: </pre>
1.1       mspo      371: 
                    372: Load `altboot.bin` into memory. The binary is relocated at 0x1000000, so
                    373: type:
                    374: 
1.4       phx       375: <pre>
                    376: =&gt; <strong>tftpboot 1000000 altboot.bin</strong>
                    377: Using COMET#0 device
                    378: TFTP from server 192.168.0.5; our IP address is 192.168.0.102
                    379: Filename 'altboot.bin'.
                    380: Load address: 0x1000000
                    381: Loading: ##############
                    382: done
                    383: Bytes transferred = 70844 (114bc hex)
                    384: </pre>
1.1       mspo      385: 
                    386: Boot the INSTALL kernel with altboot
                    387: ------------------------------------
                    388: 
                    389: Now you can use `altboot` to launch the `netbsd-INSTALL_KURO` kernel for
1.2       phx       390: installing NetBSD. It is important to take `netbsd-INSTALL_KURO` instead of
1.1       mspo      391: `netbsd-INSTALL`, because LinkStation and KuroBox systems have the UARTs
                    392: swapped, i.e. they are using the second UART for the serial console. You
                    393: may choose to load the installation kernel with TFTP or from NFS. TFTP
1.4       phx       394: was described above and for NFS there is a documentation at
                    395: [The Network File System](http://www.NetBSD.org/docs/guide/en/chap-net-services.html#chap-net-services-nfs).
1.1       mspo      396: But in both cases you have to set up a DHCP server, which is explained
                    397: in the [DHCP Howto](http://www.NetBSD.org/docs/network/dhcp.html). An
                    398: appropriate `dhcpd.conf` entry could look like this:
                    399: 
                    400:             host linkstation {
                    401:                     hardware ethernet 00:07:40:xx:xx:xx;
                    402:                     fixed-address 192.168.0.102;
                    403:                     next-server 192.168.0.5;
                    404:                     option root-path "/export/linkstation/root";
                    405:             }
                    406: 
                    407: The `root-path` option is only needed when using NFS and should match
                    408: your exported NFS directory. Uncompress `netbsd-INSTALL_KURO.gz` from
1.2       phx       409: the NetBSD/sandpoint distribution and copy it into the NFS or TFTP
1.1       mspo      410: directory. Then start the DHCP, NFS or TFTP server and boot the
                    411: installation kernel from the firmware either with
                    412: 
1.4       phx       413: <pre>
                    414: =&gt; <strong>go 1000000 tftp:netbsd-INSTALL_KURO</strong>
                    415: </pre>
1.1       mspo      416: 
                    417: or from NFS:
                    418: 
1.4       phx       419: <pre>
                    420: =&gt; <strong>go 1000000 nfs:netbsd-INSTALL_KURO</strong>
                    421: </pre>
1.1       mspo      422: 
                    423: Our bootloader configures the hardware, determines the IP address, loads
                    424: the kernel via network and launches it:
                    425: 
                    426:     ## Starting application at 0x01000000 ...
                    427: 
                    428:     >> NetBSD/sandpoint altboot, revision 1.5 (Fri Feb 18 23:21:15 CET 2011)
                    429:     >> KuroBox, cpu 195 MHz, bus 97 MHz, 64MB SDRAM
                    430:     channel 0 present
                    431:     wd0: <SAMSUNG SP1604N> DMA LBA LBA48 152627 MB
                    432:     wd0: no disklabel
                    433:     MAC address 00:07:40:xx:xx:xx
                    434:     100Mbps-FDX
                    435:     loading "netbsd-INSTALL_KURO" 5142988+110988=0x502f98
                    436:     entry=0x00090000, ssym=0x00592b58, esym=0x00592f98
                    437:     ksyms: Symbol table not found
                    438:     ksyms: String table not found
                    439:     ksyms: Perhaps the kernel is stripped?
                    440:     Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
                    441:         2006, 2007, 2008, 2009, 2010, 2011
                    442:         The NetBSD Foundation, Inc.  All rights reserved.
                    443:     Copyright (c) 1982, 1986, 1989, 1991, 1993
                    444:         The Regents of the University of California.  All rights reserved.
                    445: 
                    446:     NetBSD 5.99.45 (INSTALL_KURO) #0: Thu Feb 10 11:36:46 UTC 2011
                    447:         builds@b6.netbsd.org:/home/builds/ab/HEAD/sandpoint/201102100300Z-obj/home/builds/ab/HEAD/src/sys/arch/sandpoint/compile/INSTALL_KURO
                    448:     total memory = 65536 KB
                    449:     avail memory = 57984 KB
                    450:     OpenPIC Version 1.2: Supports 1 CPUs and 26 interrupt sources.
                    451:     mainbus0 (root)
                    452:     cpu0 at mainbus0: 8245 (Revision 0.4), ID 0 (primary)
                    453:     cpu0: HID0 0x90c000<DOZE,DPM,ICE,DCE>, powersave: 1
                    454:     eumb0 at mainbus0
                    455:     com0 at eumb0 unit 1: ns16550a, working fifo
                    456:     com0: console
                    457:     ociic0 at eumb0
                    458:     iic0 at ociic0: I2C bus
                    459:     rs5c372rtc0 at iic0 addr 0x32: RICOH RS5C372[AB] Real-time Clock
                    460:     satmgr0 at eumb0 unit 0: button manager (kurobox)
                    461:     pci0 at mainbus0 bus 0
                    462:     pchb0 at pci0 dev 0 function 0
                    463:     pchb0: vendor 0x1057 product 0x0006 (rev. 0x14)
                    464:     tlp0 at pci0 dev 11 function 0: ADMtek AN985 Ethernet, pass 1.1
                    465:     tlp0: interrupting at irq 16
                    466:     tlp0: Ethernet address 00:07:40:xx:xx:xx
                    467:     ukphy0 at tlp0 phy 1: OUI 0x00e092, model 0x0001, rev. 1
                    468:     ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
                    469:     cmdide0 at pci0 dev 12 function 0: Silicon Image 0680 (rev. 0x02)
                    470:     cmdide0: primary channel wired to native-PCI mode
                    471:     cmdide0: using irq 17 for native-PCI interrupt
                    472:     atabus0 at cmdide0 channel 0
                    473:     cmdide0: secondary channel wired to native-PCI mode
                    474:     atabus1 at cmdide0 channel 1
                    475:     ohci0 at pci0 dev 14 function 0: vendor 0x1033 product 0x0035 (rev. 0x43)
                    476:     ohci0: interrupting at irq 19
                    477:     ohci0: OHCI version 1.0
                    478:     usb0 at ohci0: USB revision 1.0
                    479:     ohci1 at pci0 dev 14 function 1: vendor 0x1033 product 0x0035 (rev. 0x43)
                    480:     ohci1: interrupting at irq 19
                    481:     ohci1: OHCI version 1.0
                    482:     usb1 at ohci1: USB revision 1.0
                    483:     ehci0 at pci0 dev 14 function 2: vendor 0x1033 product 0x00e0 (rev. 0x04)
                    484:     ehci0: interrupting at irq 19
                    485:     ehci0: companion controllers, 3 ports each: ohci0 ohci1
                    486:     usb2 at ehci0: USB revision 2.0
                    487:     biomask 8000038 netmask 8000038 ttymask 8000038
                    488:     uhub0 at usb0: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    489:     uhub1 at usb1: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    490:     uhub2 at usb2: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
                    491:     wd0 at atabus0 drive 0: <SAMSUNG SP1604N>
                    492:     wd0: 149 GB, 310101 cyl, 16 head, 63 sec, 512 bytes/sect x 312581808 sectors
                    493:     boot device: tlp0
                    494:     root on md0a dumps on md0b
                    495:     root file system type: ffs
                    496:     erase ^H, werase ^W, kill ^U, intr ^C, status ^T
                    497:     Terminal type? [vt100]
                    498: 
1.2       phx       499: Just follow the usual procedure to install a NetBSD system.
1.1       mspo      500: 
1.4       phx       501: <img src="//www.netbsd.org/images/ports/sandpoint/install_window.jpg" alt="Sandpoint installation window" /></td>
                    502: 
1.1       mspo      503: Post installation steps
                    504: =======================
                    505: 
                    506: After a successful installation you want to make the system boot
                    507: standalone when switched on, without the need for a serial console. So
                    508: you have to modify the `bootcmd` in U-Boot's environment and write the
                    509: `altboot.bin` binary to the Flash ROM.
                    510: 
                    511: On the LinkStation and KuroBox the last 128K or the Flash ROM are known
                    512: to be unused, so we can put `altboot` there. Load `altboot.bin` into
                    513: memory at `0x1000000` again, as explained above, and execute the
                    514: following commands to write it to Flash ROM:
                    515: 
1.4       phx       516: <pre>
                    517: =&gt; <strong>protect off fffe0000 +20000</strong>
                    518: Un-Protected 9 sectors
                    519: =&gt; <strong>erase fffe0000 +20000</strong>
                    520: 
                    521: Flash erase: first = 62 @ 0xfffe0000
                    522:              last  = 70 @ 0xffffe000
                    523: Flash erase: Done
                    524: Erased 9 sectors
                    525: =&gt; <strong>mw.b 1000000 ff 20000</strong>
                    526: =&gt; <strong>tftp 1000000 altboot.bin</strong>
                    527: Using COMET#0 device
                    528: TFTP from server 192.168.0.5; our IP address is 192.168.0.102
                    529: Filename 'altboot.bin'.
                    530: Load address: 0x1000000
                    531: Loading: ##############
                    532: done
                    533: Bytes transferred = 70844 (114bc hex)
                    534: =&gt; <strong>cp.b 1000000 fffe0000 20000</strong>
                    535: Copy to Flash... done
                    536: =&gt; <strong>cmp.b 1000000 fffe0000 20000</strong>
                    537: Total of 131072 bytes were the same
                    538: =&gt; <strong>protect on fffe0000 +20000</strong>
                    539: Protected 9 sectors
                    540: =&gt; <strong>reset</strong>
                    541: </pre>
1.1       mspo      542: 
                    543: Finally adapt the `bootcmd` environment string to autoboot `altboot` and
                    544: start the `netbsd` kernel (which is the default name) from `wd0` on each
                    545: reboot:
                    546: 
1.4       phx       547: <pre>
                    548: =&gt; <strong>setenv bootcmd cp.b fffe0000 1000000 20000\; go 1000000 wd0:netbsd</strong>
                    549: =&gt; <strong>setenv bootdelay 3</strong>
                    550: =&gt; <strong>saveenv</strong>
                    551: </pre>
1.1       mspo      552: 
1.4       phx       553: The `\` is important for **setenv** not to misinterpret the `;` as the end
1.1       mspo      554: of the command.
                    555: 
1.2       phx       556: Have fun with your mini NetBSD server!

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