Wednesday, May 23, 2007

Kernel Patching Solaris 10

I've patched several late '05 and early '06 Solaris 10 releases now. I've got six Ultra 20 workstations and two V20z servers to maintain. Patched all of them except one of the Ultra 20's months ago. Just went to patch the last Ultra 20 and forgot all the problems I had with the other systems. This is mostly for my reference but might help someone else out too.

smpatch is your friend

# smpatch analyze > /root/smpatch.txt
# smpatch download
# smpatch update

Technically you can just use smpatch update, but I prefer to keep a text file of my updates and download all patches before updating.

Now that will work for most patches. Eventually though you'll need to apply a kernel patch. smpatch downloads 118855-36. The problem is smpatch doesn't download 118844-19 (or later) which is a prerequisite patch for 118855-36 kernel patch. Here is how I got everything to work.
Goto http://sunsolve.sun.com and click on the patch finder.
Search for 118844-19 and download it.
unzip it and from a terminal

# init 1

This will drop you to single user mode. Wait for the system to prompt for root password to enter system maintenance and enter it. This will log you in as root.

# patchadd -d 118844-19
# init 6

System reboots. Login as root and drop to init 1 again.

# smpatch add -i 118855-36
# init 6

System reboots again. Login in as root and open a terminal. You'll now be at kernel version 118855-36. Now finish patching the system. No further patches should require you to drop to single user mode.

# smpatch update
# init 6

As of this writing all systems have kernel patch 125101-07