Custom OpenBSD Install for embedded NTP server on Soekris boxes PXE Boot using the 'bsd.rd' kernel image ---------------------------------------- Connect to via a Null-Modem cable to the Serial Port on the Soekris box. Set your terminal settings to 19200, 8N1. When you see the screen below, you'll have 5 seconds to press Ctrl-P: --- Screen Shot --- comBIOS ver. 1.28 20050529 Copyright (C) 2000-2005 Soekris Engineering. net4801 0128 Mbyte Memory CPU Geode 266 Mhz Pri Sla CF 1GB LBA Xlt 1022-32-63 1030 Mbyte Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int ------------------------------------------------------------------- 0:00:0 1078 0001 06000000 0107 0280 00 00 00 00000000 00000000 0:06:0 100B 0020 02000000 0107 0290 00 3F 00 0000E101 A0000000 10 0:07:0 100B 0020 02000000 0107 0290 00 3F 00 0000E201 A0001000 10 0:08:0 100B 0020 02000000 0107 0290 00 3F 00 0000E301 A0002000 10 0:18:2 100B 0502 01018001 0005 0280 00 00 00 00000000 00000000 0:19:0 0E11 A0F8 0C031008 0117 0280 08 38 00 A0003000 00000000 11 5 Seconds to automatic boot. Press Ctrl-P for entering Monitor. --- END Screen Shot --- Once you've hit Ctrl-P, you'll be at the comBIOS prompt. (>) Type 'boot F0', then press Enter. When you see: timeout in 30 seconds (intranet2:/tftpboot/etc/boot.conf) press Ctrl to stop Press Enter several times, then the work 'help' and press Enter. When you see the 'boot>' prompt waiting, type the boot command with the appropriate tftp path to the OpenBSD ramdisk install kernel (e.g.: 'boot openbsd44/bsd.rd') and press Enter. This will allow for an OpenBSD install. When the kernel finishes booting you will get the following prompt, start there: (I)nstall, (U)pgrade or (S)hell? i Welcome to the OpenBSD/i386 4.4 install program. This program will help you install OpenBSD. At any prompt except password prompts you can escape to shell by typing '!'. Default answers are shown in []'s and are selected by pressing RETURN. At any time you can exit this program by pressing Control-C, but exiting during an install can leave your system in an inconsistent state. Terminal type? [vt220] kbd(8) mapping? ('L' for list) [none] IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this program can cause SIGNIFICANT data loss. It is often helpful to have the installation notes handy. For complex disk configurations, relevant disk hardware manuals and a calculator are useful. Proceed with install? [no] yes Cool! Let's get to it. You will now initialize the disk(s) that OpenBSD will use. To enable all available security features you should configure the disk(s) to allow the creation of separate filesystems for /, /tmp, /var, /usr, and /home. Available disks are: wd0. Which one is the root disk? (or 'done') [wd0] Do you want to use *all* of wd0 for OpenBSD? [no] yes Putting all of wd0 into an active OpenBSD MBR partition (type 'a6')...done. You will now create an OpenBSD disklabel inside the OpenBSD MBR partition. The disklabel defines how OpenBSD splits up the MBR partition into OpenBSD partitions in which filesystems and swap space are created. The offsets used in the disklabel are ABSOLUTE, i.e. relative to the start of the disk, NOT the start of the OpenBSD MBR partition. # Inside MBR partition 3: type A6 start ## size ####### Treating sectors ##-####### as the OpenBSD portion of the disk. You can use the 'b' command to change this. Initial label editor (enter '?' for help at any prompt) > D > a a offset: [#some_number#] size: [#some_number#] FS type: [4.2BSD] mount point: [none] / > q Write new label?: [y] No more disks to initialize. OpenBSD filesystems: wd0a / The next step *DESTROYS* all existing data on these partitions! Are you really sure that you're ready to proceed? [no] yes /dev/rwd0a: ####.#MB in ####### sectores of 512 bytes # cylinder groups of ###.##MB, ##### blockes, ##### inodes each /dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=[some timestamp here]) System hostname? (short form, e.g. 'foo') ntp Configure the network? [yes] Available interfaces are: ???0 ???0. Which one do you wish to initialize? (or 'done') [???0] ???0 Symbolic (host) name for ???0? [ntp] The media options for ???0 are currently media: Ethernet autoselect (100baseTX full-duplex) Do you want to change the media options? [no] IPv4 address for vr0? (or 'none' or 'dhcp') [dhcp] 172.16.42.3 Netmask? [255.255.255.0] 255.255.255.0 IPv6 address for ???0? (or 'rtsol' or 'none') [none] Available interfaces are: ???0. Which one do you want to initialize? (or 'done') [???0] done DNS domain name? (e.g. 'bar.com') [my.domain] jrwz.net DNS nameserver? (IP address or 'none') [none] 172.16.42.2 Use the nameserver now? [yes] Default IPv4 route? (IPv4 addresses, 'dhcp' or 'none') 172.16.42.1 add net default: gateway 172.16.42.1 Edit hosts with ed? [no] Do you want to do any manual network configuration? [no] Password for root account? (will not echo) Password for root account? (again) Let's install the sets! Location of sets? (disk ftp http or 'done') [disk] http HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] Display the list of known http servers? [no] Server? (IP address, hostname or 'done') archives.jrwz.net Server directory? [pub/OpenBSD/4.4/i386] pub/OpenBSD/4.4/i386custom/NTPserver Select sets by entering a set name, a file name pattern or 'all'. De-select sets by prepending a '-' to the set name, file name pattern or 'all'. Selected sets are labelled '[X]'. [X] bsd [X] base44.tgz [X] etc44.tgz Set name? (or 'done') [done] Ready to install sets? [yes] Getting bsd ... 100% |************************************************************| #### KB 00:02 Getting base44.tgz ... 100% |************************************************************| ##### KB 00:22 Getting etc44.tgz ... 100% |************************************************************| #### 00:00 Location of sets? (disk ftp http or 'done') [disk] done Start sshd(8) by default? [yes] no Start ntpd(8) by default? [no] Do you expect to run the X Window System? [no] Change the default console to com0? [no] yes Available speeds are: 9600 19200 38400 57600 115200. Which one should com0 use? (or 'done') [19200] Saving configuration files.../install[248]" /mnt/usr/bin/encrypt: not found /install[252]: /mnt/usr/sbin/pwd_mkdb: not found done. Generating initial host.random file.../install[257]: cd: /mnt/var/db - No such f ile or directory done. Makeing all device nodes...sh: MAKEDEV: No such file or directory sh: MAKEDEV: No such file or directory done. Installing boot block... boot: /mnt/boot proto: /usr/mdec/biosboot device: /dev/rwd0c /usr/mdec/biosboot: entry point 0 proto bootblock size 512 /mnt/boot is 3 blocks x 16384 bytes fs block shift 2; part offset ##; inode block ##, ofset #### using MBR partition 3: type 166 (0xa6) offset ## (0x##) done. CONGRATULATIONS! Your OpenBSD install has been successfully completed! To boot the new system, enter halt at the command prompt. Once the system has halted, reset the machine and boot from the disk. # /mnt/Nonvolatile/usr/libexec/post_install . . . CONGRATULATIONS! The post_install has been successfully completed! To boot the new system, enter halt at the command prompt. Once the system has halted, reset the machine and boot from the disk. # reboot After the reboot is complete and you've logged into the new system as root (no password yet), run a 'mount -uw /', then edit /etc/rc, changing the desired Service Configuration Environment Variables from "no" to "yes" (to enable NTPD, Cron, etc.). Once the edit is complete, run 'mount -ur /' and then reboot by running 'shutdown -r now'. When the system comes up, make sure all the services come up properly. When you're ready to go live, update the /etc files appropriately (hostname.*, hosts, myname, mygate, resolv.conf, etc.), and set the root password to the appropriate production password. Then do a 'shutdown -h now' and when finished, unplug the power. Next time the system is powered on, make sure it's plugged in to the network where it is to be deployed, and Voila!.