1dnl $OpenBSD: prep,v 1.12 2021/02/18 16:18:04 visa Exp $ 2By default MACHINE systems are shipped with a Linux (or proprietary) system 3installed on the CompactFlash card or USB drive. 4 5First connect your computer via serial port to the device (you may need to use 6a Cisco serial cable depending on your hardware) with a command such as 7"cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device). Now apply 8power to the device and start it. 9 10Unless you have removed or changed the Linux installation it will be booted 11automatically. If you are quick you can interrupt booting (while still in 12U-Boot) with ^C. 13 14OpenBSD/MACHINE uses serial speed 115200. If this speed is not the default 15on the device, you should adjust it by setting the baudrate U-Boot environment 16variable (you also need to reconnect to the serial port using the new speed): 17 18 # setenv baudrate 115200 19 20There are several ways to load an OpenBSD/MACHINE kernel (or ramdisk), 21over TFTP, from the internal CompactFlash or USB storage. 22 23Booting from a CF card or USB: 24 25 To use the miniroot image you will need another machine to plug the 26 SD card in to. Any machine type will do, as long as it supports SD card 27 storage devices. Under OpenBSD, it will appear as a ``sd'' device, for 28 example sd1. 29 30 Use the dd(1) utility to copy the miniroot to the hard drive. 31 The command would likely be, under OpenBSD: 32 33 dd if=miniroot{:--:}OSrev.img of=/dev/rsd1c 34 35 On the EdgeRouter Lite, some USB storage devices are not detected 36 immediately after power on: 37 38 USB: (port 0) scanning bus for devices... 39 USB device not responding, giving up (status=0) 40 1 USB Devices found 41 scanning bus for storage devices... 42 No device found. Not initialized? 43 44 In such cases, manually resetting the usb controller may help: 45 46 Octeon ubnt_e100# usb reset 47 48 Now load the ramdisk kernel using either of the following commands depending 49 on the medium used. For USB: 50 51 Octeon ubnt_e100# fatload usb 0 $loadaddr bsd.rd 52 53 For Compact Flash use: 54 55 # fatload ide 0:1 ${loadaddr} bsd.rd 56 57Booting over the network: 58 59 For TFTP you will first need to set up a TFTP server as described in 60 diskless(8). Assuming tftpd(8) chroots into /tftpboot, copy bsd.rd into that 61 directory. 62 63 Power on your OpenBSD/MACHINE device and from the U-Boot prompt set up 64 networking. In this example it is assumed you have a DHCP server in your 65 network: 66 67 # dhcp 68 69 If you don't have a DHCP server, you need to set the ipaddr U-Boot environment 70 variable: 71 72 # setenv ipaddr <static ip address> 73 74 Now set the IP address of your TFTP server: 75 76 # setenv serverip <server ip> 77 78 The ramdisk kernel needs to be loaded into memory. If you use "0" as the 79 address, the default address location will be used by U-Boot: 80 81 # tftpboot 0 bsd.rd 82 Using octeth0 device 83 TFTP from server 192.168.178.30; our IP address is 192.168.178.89 84 Filename 'bsd.rd'. 85 Load address: 0x9f00000 86 Loading: ######################### 87 done 88 Bytes transferred = 7191474 (6dbbb2 hex), 8617 Kbytes/sec 89 90Booting the installation kernel 91 92 Now the kernel can be booted from the default memory location, with no 93 arguments provided: 94 95 # bootoctlinux 96