Half automating an OpenBSD 4.7 install

May 2010


Table of Contents

Installing the OS

We want to somewhat automate an OpenBSD 4.7 install, so we can set up an identical box quickly.

  1. Boot from PXE

    ???

    Press CtrlP here

  2. Start the install

    probing: pc0 com0 com1 pci pxe![2.1] mem[639K 511M a20=on]
    disk: hd0+*
    net: mac 00:00:24:cb:a0:dc, ip 10.0.12.10, server 129.125.36.117
    >> OpenBSD/i386 PXEBOOT 2.03
    switching console to com0ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ
    com0: 57600 baud
    booting tftp:tftpboot/images/openbsd/4.7/bsd.rd: 5864788+916112 [52+221040+208132]=0x6e0600
    entry point at 0x200120

    <snip some hardware and copyright info>
    wd0 at pciide0 channel 0 drive 0: <SILICONSYSTEMS INC 4GB>
    wd0: 1-sector PIO, LBA, 4029MB, 8251488 sectors
    wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
    <snip some more hardware and copyright info>
    PXE boot MAC address 00:00:24:cb:a0:dc, interface vr0
    root on rd0a swap on rd0b dump on rd0b
    WARNING: NVRAM century is 19 but RTC year is 2010
    erase ^?, werase ^W, kill ^U, intr ^C, status ^T

    Welcome to the OpenBSD/i386 4.7 installation program.
    (I)nstall, (U)pgrade or (S)hell? I
    At any prompt except password prompts you can escape to a shell by
    typing '!'. Default answers are shown in []'s and are selected by
    pressing RETURN.  You can exit this program at any time by pressing
    Control-C, but this can leave your system in an inconsistent state.

    Terminal type? [vt220]
    System hostname? (short form, e.g. 'foo') spinazie2

    Available network interfaces are: vr0 vr1 vr2 vr3 vlan0.
    Which one do you wish to configure? (or 'done') [vr0]
    IPv4 address for vr0? (or 'dhcp' or 'none') [dhcp]
    Issuing hostname-associated DHCP request for vr0.
    DHCPDISCOVER on vr0 to 255.255.255.255 port 67 interval 2
    DHCPOFFER from 10.0.43.1 (00:00:24:ca:65:d6)
    DHCPREQUEST on vr0 to 255.255.255.255 port 67
    DHCPACK from 10.0.43.1 (00:00:24:ca:65:d6)
    bound to 10.0.43.10 -- renewal in 1800 seconds.
    IPv6 address for vr0? (or 'rtsol' or 'none') [none]
    Available network interfaces are: vr0 vr1 vr2 vr3 vlan0.
    Which one do you wish to configure? (or 'done') [done]
    Using DNS domainname intranet
    Using DNS nameservers at 10.0.43.1 129.125.51.200 129.125.4.6
    Do you want to do any manual network configuration? [no]

    Password for root account? (will not echo)
    Password for root account? (again)
    Start sshd(8) by default? [yes]
    Start ntpd(8) by default? [no] yes
    NTP server? (hostname or 'default') [default] ntp0.rug.nl
    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') [57600]
    Setup a user? (enter a lower-case loginname, or 'no') [no]
    What timezone are you in? ('?' for list) [Europe/Amsterdam]

  3. Repartition the disk

    Available disks are: wd0.
    Which one is the root disk? (or 'done') [wd0]
    Disk: wd0       geometry: 1023/128/63 [8251488 Sectors]
    Offset: 0       Signature: 0xAA55
               Starting         Ending         LBA Info:
    #: id      C   H   S -      C   H   S [       start:        size ]
    -------------------------------------------------------------------------------
    0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
    1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
    2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
    *3: A6      0   1   1 -   1023  31  63 [          63:     8251425 ] OpenBSD
    Use (W)hole disk, use the (O)penBSD area, or (E)dit the MBR? [OpenBSD] W
    Setting OpenBSD MBR partition to whole wd0...done.
    The auto-allocated layout for wd0 is:
    #                size           offset  fstype [fsize bsize  cpg]
     a:           899.6M               63  4.2BSD   2048 16384    1 # /
     b:           256.0M          1842443    swap
     c:          4029.0M                0  unused
     d:          2453.8M          2366731  4.2BSD   2048 16384    1 # /usr
     e:           418.7M          7392019  4.2BSD   2048 16384    1 # /home
    Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] A
    /dev/rwd0a: 899.6MB in 1842380 sectors of 512 bytes
    5 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
    newfs: reduced number of fragments per cylinder group from 53584 to 53368 to enlarge last cylinder group
    /dev/rwd0e: 418.7MB in 857452 sectors of 512 bytes
    5 cylinder groups of 104.23MB, 6671 blocks, 13440 inodes each
    /dev/rwd0d: 2453.8MB in 5025288 sectors of 512 bytes
    13 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
    /dev/wd0a on /mnt type ffs (rw, asynchronous, local)
    /dev/wd0e on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid)
    /dev/wd0d on /mnt/usr type ffs (rw, asynchronous, local, nodev)

  4. Install some software

    Let's install the sets!
    Location of sets? (disk ftp http or 'done') [ftp]
    HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none]
    Server? (hostname, list#, 'done' or '?') [mirrors.nic.funet.fi] ftp.fr.openbsd.org
    Server directory? [pub/OpenBSD/4.7/i386]
    Login? [anonymous]

    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] etc47.tgz     [X] game47.tgz    [ ] xfont47.tgz
    [X] bsd.rd        [X] misc47.tgz    [ ] xbase47.tgz   [ ] xserv47.tgz
    [ ] bsd.mp        [X] comp47.tgz    [ ] xetc47.tgz
    [X] base47.tgz    [X] man47.tgz     [ ] xshare47.tgz
    Set name(s)? (or 'abort' or 'done') [done] -game47.tgz
    [X] bsd           [X] etc47.tgz     [ ] game47.tgz    [ ] xfont47.tgz
    [X] bsd.rd        [X] misc47.tgz    [ ] xbase47.tgz   [ ] xserv47.tgz
    [ ] bsd.mp        [X] comp47.tgz    [ ] xetc47.tgz
    [X] base47.tgz    [X] man47.tgz     [ ] xshare47.tgz
    Set name(s)? (or 'abort' or 'done') [done] done
    bsd          100% |*************************************|  7404 KB    00:11
    bsd.rd       100% |*************************************|  6147 KB    00:09
    base47.tgz   100% |*************************************| 49365 KB    02:03
    etc47.tgz    100% |*************************************|   510 KB    00:01
    misc47.tgz   100% |*************************************|   356 KB    00:00
    comp47.tgz   100% |*************************************| 90468 KB    03:07
    man47.tgz    100% |*************************************|  9240 KB    00:35
    Location of sets? (disk ftp http or 'done') [done] done
    Saving configuration files...done.
    Generating initial host.random file...done.
    Making all device nodes...done.

    CONGRATULATIONS! Your OpenBSD install has been successfully completed!
    To boot the new system, enter 'reboot' at the command prompt.
    When you login to your new system the first time, please read your mail
    using the 'mail' command.