OpenSolaris (SPARC) disk labeling weirdness

Yesterday I tried to install build39 on a 220R. It's original disk was damaged so we replaced it with a 70G drive. I fired off the OpenSolaris installer which failed to install, since it wanted the drive to be formated. OK, no problem boot cdrom -s at the ok prompt and format from the root prompt. 8hours later the disk was formated and analyzed but the label was not written. Hence, no install!

And here comes the weird solution:

Find a Solaris 8 SPARC cdrom and boot cdrom -s at the ok prompt and format from the root prompt. You do not have to reformat the drive, just label it. Then start with the OpenSolaris (SPARC) CD#1 and you are all set.

Weird and inexplicable to me why something that is possible from the Solaris 8 format is not possible with format from OpenSolaris.

If anybody has an explanation, please please post it. I like it that it works. I do not like it that I do not know why it works.

Installing OpenBSD 3.9 on a Soekris 4801

There are many ways to install OpenBSD 3.9 on a Soekris 4801. One can refer to flashdist and OpenSoekris. This is an alternate method. Why? Because it can be done. Flashdist and OpenSoekris aim at smaller distributions (~ 32MB) while using my way you get a more complete OpenBSD installation.

  1. Setup a DHCP server

    I use the ISC DHCP server. The relevant part in the dhcpd.conf is:

    host foo {
            hardware ethernet 00:00:24:XX:YY:ZZ;
            fixed-address foo.bar.tee.gr;
            filename "pxeboot";
    }
    

    The above configuration presupposes that your DHCP server is going to be used as a TFTP server also.

  2. Stuff to do on the TFTP server

    Assume that the tftp root directory is /tftpboot. Place on /tftpboot the file
    pxeboot that is found on the OpenBSD distribution.

    Also, place on /tftpboot the install kernel, bsd.rd.

    Next, mkdir /tftpboot/etc. Create a file named /tftpboot/etc/boot.conf with the following contents:

    set tty com0
    stty com0 9600
    boot bsd.rd
    
    

    If your 4801 console is setup to a different baud rate, either change this here, or on your 4801’s console. Refer to the Soekris BIOS documentation on how to do this.

    If your inetd/xinetd makes use of /etc/hosts.{allow,deny} then take care to allow foo.bar.tee.gr to access the tftp server.

  3. Netboot your Soekris 4801

    According to the Soekris documentation on the Soekris BIOS prompt you should type:

    boot f0
    

  4. Install OpenBSD 3.9

    This procedure is best covered by the OpenBSD documentation.

    What you need to remember is that you are installing on a Compact Flash. Therefore you do not need a swap partition. But OpenBSD does not install unless you have a swap partition. So you can create a swap
    partition with size of 1 (yes one):

    
    Initial label editor (enter '?' for help at any prompt)
    > p
    device: /dev/rwd0c
    type: ESDI
    disk: TOSHIBA THNCF25
    label:
    bytes/sector: 512
    sectors/track: 32
    tracks/cylinder: 16
    sectors/cylinder: 512
    cylinders: 978
    total sectors: 500736
    free sectors: 0
    rpm: 3600
    
    16 partitions:
    #             size        offset  fstype [fsize bsize  cpg]
      a:        500703            32  4.2BSD   2048 16384  578
      b:             1        500735    swap
      c:        500704            32  unused      0     0
    > w
    > q
    

    When you need to select what sets to install, you select only:

            [X] bsd
            [ ] bsd.rd
            [ ] bsd.mp
            [X] base39.tgz
            [X] etc39.tgz
            [ ] misc39.tgz
            [ ] comp39.tgz
            [ ] man39.tgz
            [ ] game39.tgz
            [ ] xbase39.tgz
            [ ] xetc39.tgz
            [ ] xshare39.tgz
            [ ] xfont39.tgz
            [ ] xserv39.tgz
    Set name? (or 'done') [bsd.mp] done
    

    Halt the system

  5. Configure the System

    Boot in single user mode. Interrupt the OpenBSD boot procedure (not the Soekris BIOS one) and type boot -s. When the system boots, perform the next steps:

    mount -o rw /
    mkdir /mfs
    

    Modify /etc/rc to execute the following script:

    # add a line after the rm -f /fastboot entry in /etc/rc to execute this
    # script: /usr/local/sbin/setup_mfs.sh
    #
    # This preassumes that you have moved /var/log to /var/log.template
    # and /var/mail to /var/mail.template
    #
    # /tmp -> /mfs/var/tmp
    # /var/tmp -> /mfs/var/tmp
    # /var/log -> /mfs/var/log
    # /var/run -> /mfs/var/run
    # /var/mail -> /mfs/mail
    #
    echo mfs: mounting /mfs...
    mount_mfs -s 16384 /dev/wd0b /mfs
    mkdir -p /mfs/var/run
    mkdir -p /mfs/var/tmp
    chmod 1777 /mfs/var/tmp
    cp -Rp /var/log.template /mfs/var/log
    cp -Rp /var/spool/mqueue /mfs/mqueue
    cp -Rp /var/spool/clientmqueue /mfs/clientmqueue
    cp -Rp /var/mail.template /mfs/mail
    #
    # EOF
    

    Do not create the symbolic links yet!

    chmod +x /usr/local/sbin/setup_mfs.sh
    

    Edit /etc/mail/sendmail.cf and /etc/mail/submit.cf and change the entries for clientmqueue and mqueue to point at /mfs/{clientmqueue,mqueue}

    Create all the symbolic links discussed above and reboot.

    After the first reboot, edit /etc/fstab to mount / as read-only:

    /dev/wd0a / ffs ro,noatime 1 1
    

    On a 256MB Compact Flash df -h shows:

    # df -h
    Filesystem     Size    Used   Avail Capacity  Mounted on
    /dev/wd0a      240M    136M   91.8M    60%    /
    mfs:28643      7.8M    112K    7.3M     1%    /mfs
    

Comments, flames and improvements are welcome.

P.S. What about the PC Engines WRAP?

Some notes on DragonFlyBSD 1.x

* Version 1.4 of DragonFly was made available on January 7, 2006. Information below is about older versions.

  • Sample cvsupfile for DragonFlyBSD sources:
    *default host=cvsup.dragonflybsd.org
    *default base=/usr
    *default prefix=/usr
    *default release=cvs tag=DragonFly_Preview
    *default delete use-rel-suffix
    *default compress
    
    cvs-root
    cvs-src
    
  • Sample cvsupfile for DragonFlyBSD pkgsrc:
    *default release=cvs tag=.
    *default delete use-rel-suffix
    *default umask=022
    *default host=cvsup.us.NetBSD.org
    *default base=/usr
    *default prefix=/usr
    *default compress
    
    netbsd-pkgsrc
    

    Do not forget to:

    # cd /usr/pkgsrc/bootstrap
    # ./bootstrap
    # cp -i work/mk.conf.example /etc/mk.conf
    
  • Simple update procedure, but it is best that you read /usr/src/UPDATING first:
    # make buildworld buildkernel installkernel installworld upgrade && \
    newaliases && reboot
    
  • Note on using ftp-proxy(8) on DFLY (Information current for at least 1.3-Preview as built at 2005/06/15):

    DFLY’s inetd listens on all network interfaces and cannot be instructed to bind on one (as does OpenBSD’s inetd). So while the manual says that your /etc/inetd.conf entry should be:

    127.0.0.1:8021 stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy

    instead for DFLY it should be:

    ftp-proxy stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy

    and you should use /etc/hosts.allow to wrap/control access to ftp-proxy. You must allow access to ftp-proxy from the networks that you expect to use it. This is somewhat different than what you expect if you have used OpenBSD/pf/ftp-proxy where the redirection is done on 127.0.0.1. So while the manual instructs:

    rdr pass on $int_if proto tcp from any to any port 21 -> 127.0.0.1 port 8021

    you should use:

    rdr pass on $int_if proto tcp from any to any port 21 -> $int_if port 8021
  • I cannot install DragonFlyBSD from the install CD. It fails with:
    ad0: READ command timeout tag=0 serv=0 - resetting
    ata0: resetting devices ..
    

    or something similar. Why?

    *** Information current with at least 1.2.0-RELEASE ISO image ***

    Well, some of the newer motherboards cannot fallback at PIO mode if DMA fails. Have no fear, you can still install DFLY. At the boot selection prompt, select option 6 which starts the loader prompt. While there type the following three commands and you are OK:

    > set hw.ata.ata_dma=0
    > set hw.ata.atapi_dma=0
    > boot
    

    Voila!

    PS: You may need to put these values to /boot/loader.conf.local:

    	
    hw.ata.ata_dma=0
    hw.ata.atapi_dma=0
    

    man loader.conf and man ata for syntax and more

  • Perl: If you have Perl installed from pkgsrc and you have made a copy or a symbolic link so as to have /usr/bin/perl be the same as /usr/pkg/bin/perl , after runnning make upgrade you have to remake the link in /usr/bin (or recopy /usr/pkg/bin/perl there).