1*aafbe895Sstspdnl $OpenBSD: install,v 1.20 2022/03/02 09:35:24 stsp Exp $ 24abbccccSjasperOpenBSDInstallPrelude 34abbccccSjasper 44abbccccSjasperOpenBSDInstallPart2 54abbccccSjasper 64abbccccSjasperOpenBSDInstallPart3(,"octcf0 for internal CompactFlash storage.") 74abbccccSjasperdnl sd0 for USB storage, or wd0 for internal hard disk storage attached to the SATA port 84abbccccSjasper 94abbccccSjasperOpenBSDInstallPart4 104abbccccSjasper 114abbccccSjasperOpenBSDInstallMBRPart1 124abbccccSjasper 134abbccccSjasperdnl OpenBSDInstallMBRPart2 144abbccccSjasper The fdisk(8) utility will be invoked to let you edit your MBR 154abbccccSjasper partitioning. The current MBR partitions defined will be 164abbccccSjasper displayed and you will be allowed to modify them, and add new 174abbccccSjasper partitions. 184abbccccSjasper 19fcb85712Sjasper The setup will need two partitions, one 'OpenBSD' for the 20fcb85712Sjasper OpenBSD/MACHINE installation, and one 'MSDOS' for the 21fcb85712Sjasper U-Boot scripts/bootloader. 22fcb85712Sjasper 23fcb85712Sjasper If you use the whole disk option, the install script 24fcb85712Sjasper will create a small 'MSDOS' partition and use the rest of 25fcb85712Sjasper the disk for the OpenBSD installation. 26fcb85712Sjasper 27fcb85712Sjasper After your OpenBSD MBR partition has been set up, the real 28fcb85712Sjasper partition setup can follow. 294abbccccSjasper 304abbccccSjasperOpenBSDInstallPart5({:- 314abbccccSjasper U-Boot partitions defined on the disk will usually show up as 324abbccccSjasper partition 'i', 'j' and so on.-:}) 334abbccccSjasper 344abbccccSjasperdnl OpenBSDInstallPart6({:-CD-ROM, -:}) 354abbccccSjasperOpenBSDInstallPart6 364abbccccSjasper 374abbccccSjasperOpenBSDURLInstall 384abbccccSjasper 394abbccccSjasperdnl OpenBSDCDROMInstall 404abbccccSjasper 414abbccccSjasperOpenBSDNFSInstall 424abbccccSjasper 434abbccccSjasperOpenBSDDISKInstall({:-"octcfN" or -:},,{:-, Linux (ext2) or MS-DOS-:}) 444abbccccSjasper 454abbccccSjasperOpenBSDCommonInstall 464abbccccSjasper 474abbccccSjasperOpenBSDInstallWrapup 484abbccccSjasper 493381f042SvisaU-Boot has to be configured to load the OpenBSD/octeon bootloader. 508339ebb1Sjasper 518339ebb1SjasperFrom the U-Boot commandline, make a copy of the current ${bootcmd} so you can 528339ebb1Sjasperrestore it later if needed: 538339ebb1Sjasper 54e3fa0bb6Smatthieu # setenv old_bootcmd "${bootcmd}" 558339ebb1Sjasper 568339ebb1Sjasper${bootcmd} is run by U-Boot when ${autoload} is enabled. Now create a new 573381f042Svisa${bootcmd} which will load an ELF file called 'boot' from the first active FAT 5883e24286Svisapartition on the first CF card. The FAT partition has been created by the 5983e24286Svisainstaller. 608339ebb1Sjasper 613381f042Svisa # setenv bootcmd 'fatload ide 0:1 ${loadaddr} boot;bootoctlinux rootdev=octcf0' 628339ebb1Sjasper # setenv bootdelay 5 638339ebb1Sjasper # saveenv 648339ebb1Sjasper Saving Environment to Flash... 658339ebb1Sjasper Un-Protected 1 sectors 668339ebb1Sjasper Erasing Flash... 678339ebb1Sjasper . done 688339ebb1Sjasper Erased 1 sectors 698339ebb1Sjasper Writing to Flash... .done 708339ebb1Sjasper Protected 1 sectors 718339ebb1Sjasper # 728339ebb1Sjasper 7383e24286SvisaIf you have installed onto SD/MMC, SATA or USB, use the following 7483e24286Svisabootcmd instead: 758339ebb1Sjasper 763381f042Svisa fatload <bootdev> 0 ${loadaddr} boot; bootoctlinux rootdev=sd0 7783e24286Svisa 7883e24286SvisaReplace ``<bootdev>'' with ``mmc'', ``sata'' or ``usb'' as appropriate. 7983e24286Svisa 8083e24286SvisaFor stable root disk selection, you can use the root disk's 8183e24286Svisadisklabel(8) UID (DUID) as the value of the rootdev parameter. 827a9a4463Sstsp 83d73defe7SvisaOn multi-core systems, the numcores parameter enables the secondary CPUs. 84d73defe7SvisaUse the total number of cores on your system as the value of the parameter. 857a9a4463Sstsp 863381f042Svisa fatload usb 0 ${loadaddr} boot; bootoctlinux rootdev=sd0 numcores=2 877a9a4463Sstsp 887a9a4463SstspOn the EdgeRouter Lite, bootcmd may also reset the USB controller for 897a9a4463Sstspmore reliable USB device detection: 907a9a4463Sstsp 913381f042Svisa usb reset; fatload usb 0 ${loadaddr} boot; bootoctlinux rootdev=sd0 numcores=2 924abbccccSjasper 93*aafbe895SstspOn some models, such as ER-6p, unattended boot from a USB disk will fail 94*aafbe895Sstspif U-Boot attempts to verify the MD5 checksum of the file loaded by fatload: 95*aafbe895Sstsp 96*aafbe895Sstsp reading vmlinux.64.md5 97*aafbe895Sstsp 33 bytes read in 303 ms (0 Bytes/s) 98*aafbe895Sstsp md5 checksum error. 99*aafbe895Sstsp Octeon ubnt_e300(ram)# 100*aafbe895Sstsp 101*aafbe895SstspAt this point, the 'bootoctlinux' command can be used to boot manually. 102*aafbe895Sstsp 103*aafbe895SstspThe file 'vmlinux.64.md5' can be renamed from the running OpenBSD system. 104*aafbe895SstspIn case of ER-6p, the file 'vmlinux.64.md5' resides on a FAT partition 105*aafbe895Sstspof the internal MMC, which is accessible from OpenBSD via /dev/sd1i: 106*aafbe895Sstsp 107*aafbe895Sstsp # mount /dev/sd1i /mnt 108*aafbe895Sstsp # mv /mnt/vmlinux.64.md5 /mnt/vmlinux.64.md5.unused 109*aafbe895Sstsp # reboot 110*aafbe895Sstsp 111*aafbe895SstspUnattended boot should now succeed, even though U-Boot will warn: 112*aafbe895Sstsp 113*aafbe895Sstsp reading vmlinux.64.md5 114*aafbe895Sstsp ** Unable to read file vmlinux.64.md5 ** 115*aafbe895Sstsp 1164abbccccSjasperOpenBSDCongratulations 1172f2506daSjmc 1182f2506daSjmcOpenBSDUnattendedInstallation 119