Saturday May 17, 2008

Video playback (with codecs) is an absolute must to make OpenSolaris a workable alternative to Ubuntu for my home machine

What follows is a very quick guide to compiling MPlayer v1.0rc2 on OpenSolaris

Fetch gcc, gmake and gawk to allow us to compile MPlayer with minimum fuss; we also pull SUNWxorg-headers to allow us to compile the Xv video-out plugin (I also have FSWxorg-headers installed; if things don't work out, you may want to add that to the end of the list). As IPSgawk is in the Blastwave IPS repository, we add that also:

$ pfexec pkg set-authority -O http://blastwave.network.com:10000/ Blastwave
$ pfexec pkg install SUNWgcc SUNWgmake IPSgawk SUNWxorg-headers

Compiling MPlayer is now very straightforward, the only special thing we need to do is promote /opt/csw/gnu in our PATH during compile time. This is because various parts of the build fail with the standard Solaris awk, so we override with GNU awk:

$ echo $PATH
/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin
$ export PATH=/usr/gnu/bin:/opt/csw/gnu:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin
$ wget http://www8.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
$ tar jxf MPlayer-1.0rc2.tar.bz2 && cd MPlayer-1.0rc2
$ ./configure
$ gmake

Key points to watch out for are the list of enabled audio and video plugins upon configure completing (you almost certainly want Xv)

If all went well, you should be able to run MPlayer with a simple ./mplayer -vo xv /path/to/video

In the meantime, I'm looking into the best way to get MPlayer packages available via one of the standard IPS repositories

Wednesday Sep 05, 2007

I recently had a customer contact the Solutions Centre requesting a procedure to grow a Solaris Volume Manager (previously known as Solstice DiskSuite) RAID1 mirror using an old, unwanted volume.

In order to answer the customer's question authoritatively I turned to Sun's extensive 'Global Labs', where I booked a suitable host and installed the same version of Solaris as the customer. In this circumstance the global lab I picked was actually in the same building as me, but the procedure was done remotely using the lab tools. For all intents and purposes, the system could very well have been in the global lab in Singapore.

With Solaris installed I quickly duplicated the customer's configuration. He was using two disks in his mirror, giving him good redundancy:

d10 (RAID 1 mirror, 20GB; mounted on /export/home)
|- d11 (c1t0d0s0, 20GB)
\- d12 (c2t0d0s0, 20GB)

d20 (RAID 1 mirror, 30GB; mounted on /export/backup)
|- d21 (c1t0d0s1, 30GB)
\- d22 (c2t0d0s1, 30GB)

In this example, the customer is now using a remote host for backup, so the d20 metadevice is no longer being used. He wanted to grow d10 by the capacity of d20.

The following simple steps achieve this with 0% downtime. It is not even necessary to unmount the volume that is being grown:

  1. Take a backup of /export/home. Verify this backup.

  2. Unmount d20:
  3. # umount /export/backup

  4. Remove all references to the d20 mirror and all sub-mirrors with metaclear. In this step the -r flag indicates that d20, d21 and d22 will be removed:
  5. # metaclear -r d20

  6. Attach the slices previously used in the d20 mirror to each of the d10 sub-mirrors:
  7. # metattach d11 c1t0d0s1
    # metattach d12 c2t0d0s1

  8. Tell d10 that the sub-mirrors have changed and that the size of the metadevice has changed:
  9. # metattach d10

  10. Finally, we need to use growfs to grow the UFS filesystem that lives on the d10 metadevice:
  11. # growfs -M /export/home /dev/md/rdsk/d10

Hopefully this simple six-step procedure will be of use to those new to Volume Manager.

Sunday Jul 08, 2007

This is the info I've either been told or figured out while playing around with a couple of Sun Ray DTUs at home. It's possible it might not be 100% accurate, or I may have failed to include some behind-the-scenes operations that are not normally seen by the end-user (me). Hopefully it will still be some help.

The following steps are performed as part of a Sun Ray DTU (desk top unit) boot-up:

  1. POST

  2. Firmware verify

  3. DHCP

  4. Connect to server

During the DHCP stage the DTU expects all of the regular information (IP address, netmask, gateway, etc.), but in addition to this it needs some vendor-specific information. The vendor-specific tags tell the DTU which IP address to contact to check for new firmware, where the Sun Ray services are running, and which host to use for logging.

On Solaris, the standard utadm, dhcpconfig and dhtadm commands are used to manage the DHCP service. However, if you're trying to do interesting things without Solaris you'll quickly hit problems as it is very unlikely your DHCP server will understand the Sun Ray-specific options.

Linux systems often use the ISC dhcpd, which can be taught about these tags by adding the following to your dhcpd.conf file (from the standard Linux sample dhcpd.conf):

option space SunRay;
option SunRay.AuthSrvr code 21 = ip-address;
option SunRay.AuthSrvr IPADDRESSHERE;
option SunRay.FWSrvr code 31 = ip-address;
option SunRay.FWSrvr IPADDRESSHERE;
option SunRay.NewTVer code 23 = text;
option SunRay.NewTVer "3.0_51,REV=2004.11.10.16.18";
option SunRay.Intf code 33 = text;
option SunRay.Intf "INTERFACENAMEHERE";
option SunRay.LogHost code 24 = ip-address;
option SunRay.LogHost 192.168.1.101;
option SunRay.LogKern code 25 = integer 8;
option SunRay.LogKern 6;
option SunRay.LogNet code 26 = integer 8;
option SunRay.LogNet 6;
option SunRay.LogUSB code 27 = integer 8;
option SunRay.LogUSB 6;
option SunRay.LogVid code 28 = integer 8;
option SunRay.LogVid 6;
option SunRay.LogAppl code 29 = integer 8;
option SunRay.LogAppl 6;

Replace IPADDRESSHERE with the valid IPs of your authentication and firmware servers. INTERFACENAMEHERE should be set to the name of the interface DHCP requests are being accepted on (e.g. eth1). By default these options are not handed out to all clients. A group must be configured to use the specific options. e.g.

group {
    vendor-option-space SunRay;
    subnet 192.168.1.0 netmask 255.255.255.0 {
        authoritative;
        option routers 192.168.1.1;
        range 192.168.1.50 192.168.1.100;
    }
}

By using the above you gain full control over the information passed to your DTU. Using this it is very easy to allow a DTU to sit on a network well away from your Sun Ray and DHCP server... but wait, if simply allowing a DTU to contact a Sun Ray server on a different network is all you are looking to do, you can overload DHCP option 49: "X Window System Display Manager Option", RFC2132.

With ISC dhcpd this is configured by adding:

option x-display-manager IPADDRESSHERE(, IPADDRESSHERE, IPADDRESSHERE);

to the configuration file. Replace IPADDRESSHERE with the IP address of the Sun Ray server.

If, like me, you're using an embedded Linux device (e.g. Linksys WRT54g) to provide your DHCP, the chances are Dnsmasq is handling both DNS and DHCP for you. Add the following to your dnsmasq.conf to replicate the functionality just discussed:

dhcp-option=49,IPADDRESSHERE

If you want to know more, check out Configuring DHCP options 49 and 66 for Sun Ray use (used as a reference), this blog also covers configuring Windows DHCP server to provide option 49.

Wednesday Jul 04, 2007

A little background information first...

I joined Sun in July 2006 as a student lab intern working for Paul Humphreys where I worked with four other students to provide hardware (and sometimes software) setups for Sun support engineers.

During this time I moved towards high-end hardware such as the E15/25k, Serengeti and Niagara-based systems. All the while I was doing my best to beef my knowledge of the Solaris kernel and userland and other assorted goodies (including the incredible Sun Ray). Solaris as a whole is the way I'd like to take things in the future, at least until I figure out what specifically interests me the most.

Two days ago I started as a full-time employee within the solutions centre where I will be working within the BT group as a support engineer.

And now...

Here I am, I have finally have the coveted blogs.sun.com blog and I plan to use this space to cover technical issues in some way related to Sun. Most entries will be basic, the odd one might be a little more advanced but overall I hope to provide some useful tips, tricks and info that might help somebody out when they're in a fix...

This blog copyright 2008 by Lewis Thompson