Novell Home

Slipstreaming Post Service-Pack Patches into a Service Pack Build on NetWare

Novell Cool Solutions: AppNote
By Greg Riedesel

Digg This - Slashdot This

Posted: 4 Aug 2006
 

Abstract: This article describes procedures for including patches released after a service pack into a service pack. Some patches are very simple, and others require knowledge of obscure Novell scripting. This can reduce (sometimes greatly) the number of reboots required during the application process of a NetWare service pack. Especially if the Service Pack has been out a while and there are a number of post-SP patches. In larger environments it can be used to help unify server patch-levels by providing a custom build.

Introduction

The longer you wait after a Service Pack comes out, the more post Service Pack patches you generally need to apply. Also, some Service Packs ship with flaws that will hurt you significantly, and the post patches fix the flaws. It would be nice to be able to include the patches in the Service Pack (SP) build itself.

This can be done, but it takes understanding of how Service Packs are constructed. It also can require the ability to read install scripts. But when done right, it can provide a way to get all of your post-SP patches included into the SP build itself and minimize the steps required to get it all in.

Generally speaking, patches come in two flavors:

  1. Patches where the install process is, "Read the readme, copy the files where it tells you to."


  2. Patches where the install process is, "Launch NWCONFIG, and Install New Product."

The first type is the easiest to include in a SP build. The second requires some reading, but for all but the most complex of patches (such as eDirectory updates, or anything that updates by way of RPM such as BASH) it can be done. This article will walk you through getting both types included.

Service Pack Build Structure

Before you can start including patches into a Service Pack, you need to understand how the SP is organized.

The directories most immediately useful to the slipstream process are the STARTUP, SYS, PRODUCTS, and SP directories. STARTUP and SYS contain the base operating system updates and are copied to C:\NWSERVER (or wherever your SERVER.EXE lives) and SYS:\ respectively. PRODUCTS includes everything that is an installable product, such as NDPS/iPrint, eDir, NetStorage, SMS, and Apache. The SP directory contains the scripts that actually drive the Service Pack install process itself.

Files in the STARTUP and SYS directories will get copied to every single NetWare server that Service Pack build is installed on. Once that file copy is completed, the Service Pack process then starts applying updates from the PRODUCTS directory depending on what it finds installed on the server. When you are putting updated files into the SP build, you need to make sure that you are copying over the old file in the build tree. Most of the files in the PRODUCTS directory are kept in compressed archives, so it can take some poking to find where the updated files need to go.

Including Simple Patches

Simple patches are the ones where you do the file copying based on what the attached documentation tells you to do. Generally they are pretty simple and include only a few files. For larger operations Novell is pretty good about making install scripts to handle the copying process.

For this example, I'm going to use the patch titled, "iPrint Updates to NetWare Support Pack 5 (iprntnw65sp5d.exe)", which you can obtain here.

This is an iPrint patch, not a base OS patch, so the area we will be working in is the PRODUCTS directory. We'll be leaving the STARTUP and SYS areas for another patch. Looking inside the PRODUCTS directory we see PRODUCTS\NDPS. Inside the NDPS directory we see three files, titled APACHE2.ZSP, GATEWAYS.ZSP, and IPRINT.ZSP.

These are ZIP-formatted files, but the base Windows ZIP editor can't handle them. Use a third party tool such as WinZip or 7-zip to open them. Once you open them, you can see the files included. This is where we will be updating files.

If you crack open the APACHE2.ZSP file you will see a directory at the top level titled, "apache2". This will ultimately install to SYS:\APACHE2\. Drill down again and you get a pair of directories, "htdocs," and, "iprint." Reference the Readme that came with the patch, and you will see this directive:

5. Copy the updated NDPSM.NLM, IPPSRVR.NLM, and NIPPED.NLM to the 
server's SYS:\SYSTEM directory and MOD_IPP to SYS:\Apache2\iprint

This tells us that we need to look into the apache2\iprint directory, where we do indeed find the MOD_IPP.NLM. Copy the updated MOD_IPP.NLM from the patch to this sub-directory in this archive. Since this is the only file going into the Apache2 directory structure, close the archive.

Since none of the remaining update files are gateways, we can skip the GATEWAYS.ZSP file and go right to IPRINT.ZSP. As with the APACHE2.ZSP file, this contains the file structure as if it were at the root of SYS:. Since the instructions told us to go to SYSTEM, go into that sub-directory. All three of the remaining files are in this sub-directory, so copy in the three files from the patch over the files in the archive.

Congratulations, you've just slipstreamed your first patch into a Service Pack build.

Unfortunately, it isn't always obvious what directory under PRODUCTS you need to go into. In this case the iPrint files were in the NDPS directory. This is because when IP Print was integrated into NDPS, Novell renamed NDPS to iPrint. Novell just kept the name in the Service Packs for their own reasons. Another example is NetStorage, which is kept in the "ISTORAGE" directory. Sometimes it can take a lot of poking to find where you're looking for.

Including NWCONFIG installed Patches

These are significantly more complex to install, but it can be done for all but the most complex of patches. NWCONFIG uses a script included in the patch directory to tell it what to do. To understand what to do with the update files, you either need to be able to read the supplied script and integrate it into the full Service Pack build (aie!), or read the key bits and do a bit of twiddling. The second is much easier, and what I cover.

Most, but sadly not all, NWCONFIG installed patches copy files to many directories and update the products database. They also usually include NetWare version checking and sometimes product version checking as well. Some even include schema updates as part of the process, which is why we leave those for their own installs and don't try to slipstream them.

For a lot more detail about how these scripts work, the documentation is contained within the NetWare 6 manual set.

http://www.novell.com/documentation/nw6p/othr_enu/data/a3hfq6f.html

First Example, Simple Script

For this example I'm going to use the patch titled, "Post SP5 NSS Modules for NetWare 6.5 (n65nss5a)", which you can obtain here.

Download and explode the patch. At the root of the "N65NSS5A" directory is a file called "nss.ips". This is the script that NWCONFIG will use to install the patch. Open this file in Notepad, and follow along.

; ***************************************************************
; This script has been developed to install NSS Patches.
; Date last modified: March 13, 2006
; Modified by: Mike Hasleton	
; ***************************************************************
; @SyntaxVersion 1.00
; "CoPyRiGhT=(c) 1996 Novell, Inc.  All Rights Reserved."
; VeRsIoN=1.04

 ; CopyToServer SYSTEM\NWUPDATE, ICMD.NLM, '', ''
 ; CopyToServer SYSTEM\NWUPDATE, ICMD.MSG, '', ''
  Command ICMD

Already we can see that comments are preceded by a semi-colon. Useful to know. Read those.

@FileSet
;----------- Change these lines when making modifications ---------
    Description: "NetWare 6.5 post-SP5 / Novell OES post-SP2 NSS NLMs"
        Name: N65NSS5a.exe
    CLASS: OPTIONAL
    ATTRIBUTE:0, 1
    HELP: "Included in this update kit are the following:\n
           1.  NSS modules (post Support Pack 5)"

This is what NWCONFIG displays during the install process. For our purposes, we don't care.

; ***************************************************************
;------Check for the correct OS ----
GotoIfNEqual %{PI_PRODUCTMAJORVERSION}, 6, INCORRECT_OS_VERSION
GotoIfNEqual %{PI_PRODUCTMINORVERSION}, 50, INCORRECT_OS_VERSION
GotoIfNEqual %{PI_PRODUCTREVISION},     5, WRONG_SUPPORT_PACK_VERSION
    Goto VERSION_IS_CORRECT

This is the version checking that NWCONFIG does to make sure this patch can be applied. It is looking for NetWare 6.5 SP5, which we're installing right now. So we still don't care. But nice to know at any rate. Following this section are the messages NWCONFIG displays when the checks fail. For what we are doing, it doesn't matter.

Label INCORRECT_OS_VERSION

	Display 1, "Incorrect OS Version Found:\n
                    NetWare 6.5 with Support Pack 5 installed or Novell 
Open Enterprise Server Support Pack 2 is required to apply this update.  The install will now terminate."
	Goto Exit


Label WRONG_SUPPORT_PACK_VERSION

	Display 1, "Incorrect Support Pack Revision Found:\n
		    This update requires that either Support Pack 5 
(NW65SP5.EXE) or Novell Open Enterprise Server Support Pack 2 be applied prior to installing this update.  The installation will now terminate."
	Goto Exit


Label VERSION_IS_CORRECT
; ***************************************************************

;----- Get the source and destination paths -----
  GetPath SourceDrive1, 1, '%{NWSRC}', '', NWSRC
  GetPath DestinationDrive_Boot, 1, '%{NWBOOT}', '', NWSRC
  Getpath DestinationDrive_System, 1, 'SYS:\\SYSTEM', ''
  GetPath ROOT, 1, 'SYS:', ''

This section sets certain variables it uses during the file copy operations. %{NWBOOT} is a built-in variable for where SERVER.EXE lives, and can change from the default of C:\NWSERVER\. "NWSRC" is the patch source directory.

;----- Create the backup directory
  GetPath DOSDir, 1, '%{NWBOOT}',''
  GetPath SYSTEM, 1, 'SYS:\\SYSTEM', ''
  GetPath DOSBootDir, 1, '%{NWBOOT}' ,''
  SetDir  DOSDir, "!Backup.nss", '', '', 0, 2, 0
  GetPath BackupDir, 1, '%{NWBOOT}\\!Backup.nss', ''

This sets more variables, and also sets up the file backup process. Since the Service Pack includes NSS updates already, we can safely assume that the existing SP install process will back these up. So we can safely ignore all the bits of this script that involve backing up files.

  Display 2, "Backing up existing NSS files to SYS:SYSTEM\!BACKUP.NSS."

;----- Backup files that were changed but not copied over (ie. .NCF, .CFG)
    ;Backup c:\nwserver
	CopyFile 0,0,0,0,0,NWBOOT,CDDVD.NSS,'','',BackupDir,'NWSERVER','','',0
	CopyFile 0,0,0,0,0,NWBOOT,COMN.NSS,'','',BackupDir,'NWSERVER','','',0

Cut for space?

	CopyFile 0,0,0,0,0,NWBOOT,ZLSS.NSS,'','',BackupDir,'NWSERVER','','',0
	

    ;Backup SYS:\SYSTEM  
	CopyFile 0,0,0,0,0,SYSTEM,AFPSTOP.NCF,'','',BackupDir,'SYSTEM','','',0
	CopyFile 0,0,0,0,0,SYSTEM,AFPSTRT.NCF,'','',BackupDir,'SYSTEM','','',0 
	CopyFile 0,0,0,0,0,SYSTEM,AFPTCP.NLM,'','',BackupDir,'SYSTEM','','',0	        

Cut for space?

	CopyFile 0,0,0,0,0,SYSTEM,VOLSMS.NLM,'','',BackupDir,'SYSTEM','','',0
	

; Delete the files that reside in nwserver to make sure they aren't in sys:system
	EraseFile 0, SYSTEM,'CDDVD.NSS','',''
	EraseFile 0, SYSTEM,'COMN.NSS','',''

This section erases files that are in the wrong spot. Past NSS versions had things in different places so this step is needed. However, since the SP build already includes an NSS update, it is safe to assume that this step is already being taken. Therefore, we can ignore this section as well.

	EraseFile 0, SYSTEM,'DOSFAT.NSS','',''
	EraseFile 0, SYSTEM,'LIBNSS.NLM','',''


; Delete the files that reside in nwserver to make sure they aren't in 
c:\nwserver

	EraseFile 0, NWBOOT,'CDDVD.NSS','',''
	EraseFile 0, NWBOOT,'COMN.NSS','',''

Cut for space?

	EraseFile 0, NWBOOT,'XIPC.NSS','',''
	EraseFile 0, NWBOOT,'ZLSS.NSS','',''

; I am now deleting files from the sys:system directory to prepare it 
for the new files to be copied in.
	EraseFile 0, SYSTEM,'AFPSTOP.NCF','',''
	EraseFile 0, SYSTEM,'AFPSTRT.NCF','',''
	EraseFile 0, SYSTEM,'AFPTCP.NLM','',''

Cut for space?

	EraseFile 0, SYSTEM,'VMRPC.NLM','',''
	EraseFile 0, SYSTEM,'VOLSMS.NLM','',''
; ***************************************************************
; This is the main copy routine that moves the files from the original directories 
into the location they will
; be executed from when the server is operating.

  Display 2, "NSS 3.24 BUILD 06.0310 Update is being installed"

  CopyFile 0, 0, 1, 2, 0, SourceDrive1, '\\startup\\*.*', '', '', NWBOOT, '', '', '', 0
  CopyFile 0, 0, 1, 2, 0, SourceDrive1, '\\system\\*.*', '', '', SYSTEM, '', '', '', 0

This, after all this time, is the actual update process itself. It says to copy the contents of "startup" to C:\NWSERVER, and "system" to SYS:SYSTEM. Very simple in the end, but the script had to be sure the environment was correct before it got this far.

Because this is an OS patch, these files will go into the STARTUP and SYS\SYSTEM directories in the SP build.

  Display 2, "Done copying files."

  Display 0, "NetWare 6.5 NSS v3.24 (06:0310) modules installation is 
complete!"


;---------------UPDATE PRODUCT DATABASE-------------
 ; Display 2, "Removing old patch product records."
  ;NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL NSS'  ccode


;----------- Change this line when making modifications ---------
  ProductRecord NSS, 0, "3.24.01"
  ProductRecord NSS, 1, "NetWare 6.5 post-SP5 NSS 5A"
;---------------UPDATE PRODUCT DATABASE-------------

This is a critical step that can easily get missed. This updates the Product database with the information for this patch. I'll cover how to get this inserted into the product database later.

Label NWError
Label NWCancel
Label EXIT

@EndFileSet
; ***************************************************************

That's a lot of checking, and a very few lines that actually perform the update. In our case the Service Pack already includes NSS updates, so we don't have to worry about including the version checking logic. The most complex task will be to get the Product Database updated.

First and foremost, the CopyFile lines that actually do the update. That tells us that the contents of N65NSS5A\System\*.* need to be copied to SYS\SYSTEM in the SP build. The same for N65NSS5A\STARTUP\*.*.

Next we need to get the product records into the database. To do that, we need to edit the file SP\INSTALL\STARTUP.ICS. This particular file is what drives the majority of the service-pack install and is therefore quite large. Happily, the section we need is right at the bottom.

;----- Clean up temporary directory -----
EraseFile 0, autoexecDir, 'nwupdate', '',''
EraseFile 1, autoexecDir, 'nwupdate', '',''

GotoIfEqual %{CSP}, 1, STARTUP_Done
GotoIfEqual %{ZFS}, 1, Reboot
GotoIfEqual %{AREBOOT}, 1, Reboot

	Display 0, "\n\n%{DM_CSP_Complete}\n\n%{DM_CSP_Done1}\n\n%{DM_CSP_Done2}\n\n
				%{DM_CSP_Done3}%{DM_CSP_Done4}\n\n%{DM_CSP_Done5}"
	Goto STARTUP_Done
	
Label Reboot
	Display 2, "%{DM_Reset_Server}"	
	Console 'stopx',10
	Console 'java -exit',3
	; Send broadcast to all connected, the server is being restarted.
	Console 'SEND "%{NWSERVER} - %{DM_Reset_Server}"',10
	Console 'reset server', 5

Label STARTUP_Done
[end of file]

We will insert the ProductRecord lines right before "GotoIfEqual":

;----- Clean up temporary directory -----
EraseFile 0, autoexecDir, 'nwupdate', '',''
EraseFile 1, autoexecDir, 'nwupdate', '',''

      ProductRecord NSS, 0, "3.24.01"
      ProductRecord NSS, 1, "NetWare 6.5 post-SP5 NSS 5A"

GotoIfEqual %{CSP}, 1, STARTUP_Done
GotoIfEqual %{ZFS}, 1, Reboot
GotoIfEqual %{AREBOOT}, 1, Reboot

This will tell the script to update the product records for these patches as the very last thing it does.

By doing it here it more closely resembles doing patches after the SP has been applied. The ProductRecord updates for PRODUCTS are done during those installations. This way 'installation order' as far as the Product Database is concerned is maintained. Later patches that may require a post-SP patch will then be able to see the correct product versions in the database.

Second Example: Complex Script

For this example I'm going to use the patch titled, "Updated LIBC & DSAPI libraries (nwlib6h.exe)", which you can obtain here.

As with the first example, download and explode the patch. At the root of the patch directory you will find a file named 'install.ips'. This is what NWCONFIG uses to install this patch. Unlike the first example, this particular patch has selectable options permitting the installation of pieces of the patch. This adds complexity to the IPS file.

The selectable options are between the @FileSet and @EndFileSet lines. This patch has three selectable options:

  1. Backup current Library files
  2. NetWare LIBC Update
  3. NetWare CLIB / DSAPI Update

The script between the @FileSet and @EndFileSet lines describes to NWCONFIG how to install the patch. We can ignore the first set since the Service Pack handles that function for us already. Now lets look at the NetWare LIBC Update section.

@FileSet
;----------- Change these lines when making modifications ---------
    Description: "NetWare LIBC Update" 
    	Name: NWLIB6h.EXE
    CLASS: OPTIONAL
    ATTRIBUTE:0, 1
    HELP: "Netware Library Install for Netware 5 and Netware 6.x"

; ***************************************************************
;------Check for the correct OS ----
  GotoIfNEqual %{PI_OSMajorVersion}, 5, INCORRECT_OS_VERSION
 ; GotoIfEqual %{PI_OSMinorVersion}, 60, VERSION_IS_CORRECT
  
  ReadProductRecord SPACK, 0, ID, cCode	; SPACK Installed
     GotoIfNEqual %{cCode}, 0, INCORRECT_OS_VERSION
  
SGotoIfEqual %{ID}, "5.1.8", VERSION_IS_CORRECT			; Version is 5.1.8

;SGotoIfEqual %{ID}, "6.0.4", VERSION_IS_CORRECT		; Version is 6.0.4
SGotoIfEqual %{ID}, "6.0.5", VERSION_IS_CORRECT			; Version is 6.0.5

;SGotoIfEqual %{ID}, "6.5.3", VERSION_IS_CORRECT		; Version is 6.5.3 
SGotoIfEqual %{ID}, "6.5.4", VERSION_IS_CORRECT			; Version is 6.5.4 
SGotoIfEqual %{ID}, "6.5.5", VERSION_IS_CORRECT			; Version is 6.5.5 
  ;  Goto VERSION_IS_CORRECT

Label INCORRECT_OS_VERSION
        Display 0, "These LIBRARY modules should only be installed on 
minimum NetWare 5.1 SP8, Netware 6 SP5, or Netware 6.5 SP4 server. This 
installation will now terminate."
    Goto EXIT

Label VERSION_IS_CORRECT

;----- Get the source and destination paths -----
  GetPath SourceDrive1, 1, '%{NWSRC}\\LIBC', '', NWSRC
  GetPath SourceDrive2, 1, '%{NWSRC}\\65\\bin', '', NWSRC
  GetPath SourceDrive3, 1, '%{NWSRC}\\LIBC\\NLS', '', NWSRC
  GetPath DestinationDrive_Boot, 1, '%{NWBOOT}', '', NWSRC
  Getpath DestinationDrive_Bin, 1, 'SYS:\\BIN', ''
  
; check for enough space on dst
  ValueSet val, 0
  ValueAdd val, 6246868
  SpaceCheck DestinationDrive_Boot, %{val}
	 

; ***************************************************************

  Display 2, "NetWare LIBC Update is being installed"


; --------------Copying 6.5 Files ----------------;
  CopyFile 0, 0, 1, 2, 0, SourceDrive1, '*.NLM', '', '', NWBOOT, '', '', '', 3
  CopyFile 1, 1, 1, 2, 0, SourceDrive3, '', '', '', DOSBootNLS, '', '', '', 3

;SGotoIfEqual %{ID}, "6.5.3", BASHSTUFF			; Version is 6.5.3 
SGotoIfEqual %{ID}, "6.5.4", BASHSTUFF			; Version is 6.5.4 
SGotoIfEqual %{ID}, "6.5.5", BASHSTUFF			; Version is 6.5.5 

 Goto DONE

Label BASHSTUFF
CopyFile 0, 0, 1, 2, 0, SourceDrive2, 'NWTERMIO.NLM', '', '', DestinationDrive_Bin, '', '', '', 3
 Goto DONE

Label DONE
  Display 2, "Done copying files."

  Display 0, "NetWare LIBC Library Update is complete!"

;----------- Change this line when making modifications ---------
  ProductRecord LIBUP, 0, "9.00.03"
  ProductRecord LIBUP, 1, "NetWare LIBC NWLIB6h FTF Kit"
;---------------UPDATE PRODUCT DATABASE-------------

;  EraseFile 1, InstallDrive, '','',''

Label NWError	
Label NWCancel
Label EXIT

@EndFileSet

The rough logical flow of this section is as follows:

  1. Check software versions. These are the lines with SGotoIfEqual.
  2. Set variables for installation locations and patch-source locations. These are the GetPath lines.
  3. Check for available disk space. These are the ValueSet, ValueAdd, and SpaceCheck lines.
  4. Install the patch. These are the two CopyFile lines, we need these.
  5. If software version is new enough, also install NWTERMIO.NLM. This is the second SGotoIfEqual. It checks to see if the SP Rev is new enough for Bash to be installed by default, and if so, updates (CopyFile) NWTERMIO.NLM.
  6. Update Product Database. This is the ProductRecord pair of lines.

The three CopyFile lines tell us where updated files live, and where they're intended to go. The first two install files into NWBOOT (usually C:\NWSERVER), and the associated NLS files (usually C:\NWSERVER\NLS). The second one copies NWTERMIO.NLM to SYS:\BIN. Looking in the Service Pack build, we find that the update files exist in STARTUP, not in PRODUCTS. Therefore we copy the update files there.

The BASH update is another story. That file is in PRODUCTS\BASH. The full path of where to drop the file is: \PRODUCTS\BASH\BASH.RPM\BASH.cpio.gz\BASH.cpio\.\bin\ This means you need to have a decompression utility that can open and modify RPM files. As of Service Pack 5 (OES SP2) this particular file hadn't been included in a Service Pack yet, so the file doesn't exist in the Service Pack. You will have to add it.

As of this writing, the state of RPM modification tools for Windows is nearly nonexistent. If you don't know how to modify RPMs, mark this one file for post-update attention. In this specific case, since the file doesn't yet exist in the Service Pack we can get away with putting it into SYS\BIN\ in the SP build tree. But later service-packs will have this file, and this trick won't work as well. See Gotchas section for details as to why.

Now we need to put in the ProductRecord lines into the SP\INSTALL\STARTUP.ICS file. As with the first example we will insert the ProductRecord lines right before "GotoIfEqual":

;----- Clean up temporary directory -----
EraseFile 0, autoexecDir, 'nwupdate', '',''
EraseFile 1, autoexecDir, 'nwupdate', '',''

      ProductRecord NSS, 0, "3.24.01"
      ProductRecord NSS, 1, "NetWare 6.5 post-SP5 NSS 5A"
      ProductRecord LIBUP, 0, "9.00.03"
      ProductRecord LIBUP, 1, "NetWare LIBC NWLIB6h FTF Kit"

GotoIfEqual %{CSP}, 1, STARTUP_Done
GotoIfEqual %{ZFS}, 1, Reboot
GotoIfEqual %{AREBOOT}, 1, Reboot

This will tell the script to update the product records for these patches as the very last thing it does. By doing it here it more closely resembles doing patches after the SP has been applied. The ProductRecord updates for PRODUCTS are done during those installations. This way 'installation order' as far as the Product Database is concerned is maintained. Later patches that may require a post-SP patch will then be able to see the correct product versions in the database.

Now lets look at the NetWare CLIB / DSAPI Update section.

@FileSet
;----------- Change these lines when making modifications ---------
    Description: "NetWare CLIB / DSAPI Update" 
    Name: NWLIB6h
    CLASS: OPTIONAL
    ATTRIBUTE:0, 1
    HELP: "Netware Legacy Library Install for Netware 5 and Netware 6.x"

; ***************************************************************
;------Check for the correct OS ----
  GotoIfNEqual %{PI_OSMajorVersion}, 5, INCORRECT_OS_VERSION
 ; GotoIfEqual %{PI_OSMinorVersion}, 60, VERSION_IS_CORRECT
  
  ReadProductRecord SPACK, 0, ID, cCode	; SPACK Installed
     GotoIfNEqual %{cCode}, 0, INCORRECT_OS_VERSION
  
SGotoIfEqual %{ID}, "5.1.8", VERSION5_IS_CORRECT			; Version is 5.1.8

;SGotoIfEqual %{ID}, "6.0.4", VERSION6_IS_CORRECT			; Version is 6.0.4
SGotoIfEqual %{ID}, "6.0.5", VERSION6_IS_CORRECT			; Version is 6.0.5

;SGotoIfEqual %{ID}, "6.5.3", VERSION65_IS_CORRECT			; Version is 6.5.3 
SGotoIfEqual %{ID}, "6.5.4", VERSION65_IS_CORRECT			; Version is 6.5.4 
SGotoIfEqual %{ID}, "6.5.5", VERSION65_IS_CORRECT			; Version is 6.5.5 
  ;  Goto VERSION_IS_CORRECT

Label INCORRECT_OS_VERSION
        Display 0, "These LIBRARY modules should only be installed on 
minimum NetWare 5.1 SP8, Netware 6 SP5, or Netware 6.5 SP4 server. This 
installation will now terminate."
    Goto EXIT

Label VERSION65_IS_CORRECT
;----- Get the source and destination paths -----
  GetPath SourceDrive5, 1, '%{NWSRC}\\65\\startup', '', NWSRC
  GetPath SourceDrive6, 1, '%{NWSRC}\\65\\system', '', NWSRC
  GetPath DestinationDrive_Boot, 1, '%{NWBOOT}', '', NWSRC
  Getpath DestinationDrive_System, 1, 'SYS:\\SYSTEM', ''

; ***************************************************************
  Display 2, "NetWare CLIB /DSAPI Update is being installed"

; --------------Copying 6.5 Files ----------------;
  CopyFile 0, 0, 1, 2, 0, SourceDrive5, '*.NLM', '', '', NWBOOT, '', '', '', 3
  CopyFile 0, 0, 1, 2, 0, SourceDrive6, '*.NLM', '', '', DestinationDrive_System, '', '', '', 3

 Goto DONE

Label VERSION6_IS_CORRECT

GetPath SourceDrive3, 1, '%{NWSRC}\\60\\startup', '', NWSRC
GetPath SourceDrive4, 1, '%{NWSRC}\\60\\system', '', NWSRC
GetPath DestinationDrive_Boot, 1, '%{NWBOOT}', '', NWSRC
Getpath DestinationDrive_System, 1, 'SYS:\\SYSTEM', ''


; ------------ Copying 6.0 specific Files --------------;
CopyFile 0, 0, 1, 2, 0, SourceDrive3, '*.NLM', '', '', NWBOOT, '', '', '', 3
CopyFile 0, 0, 1, 2, 0, SourceDrive4, '*.NLM', '', '', DestinationDrive_System, '', '', '', 3

 Goto DONE

Label VERSION5_IS_CORRECT

GetPath SourceDrive1, 1, '%{NWSRC}\\51\\startup', '', NWSRC
GetPath SourceDrive2, 1, '%{NWSRC}\\51\\system', '', NWSRC
GetPath DestinationDrive_Boot, 1, '%{NWBOOT}', '', NWSRC
Getpath DestinationDrive_System, 1, 'SYS:\\SYSTEM', ''


; ------------ Copying 5.x specific Files --------------;
CopyFile 0, 0, 1, 2, 0, SourceDrive1, '*.NLM', '', '', NWBOOT, '', '', '', 3
CopyFile 0, 0, 1, 2, 0, SourceDrive2, '*.NLM', '', '', DestinationDrive_System, '', '', '', 3

 Goto DONE


Label DONE
  Display 2, "Done copying files."

  Display 0, "NetWare CLIB and DSAPI Library Update is complete!"


;----------- Change this line when making modifications ---------
;  ProductRecord LIBUP, 0, "9.00.03"
   ProductRecord LIBUP, 1, "NetWare LIBC / CLIB NWLIB6h FTF Kit"
;---------------UPDATE PRODUCT DATABASE-------------

;  EraseFile 1, InstallDrive, '','',''

Label NWError	
Label NWCancel
Label EXIT

@EndFileSet

This has the same general flow as the first section we looked at:

  1. Check software versions. These are the lines with SGotoIfEqual.
  2. Set variables for installation locations and patch-source locations. These are the GetPath lines.
  3. Install the patch. These are the two CopyFile lines, we need these.
  4. Update Product Database. This is the ProductRecord line.

This script checks for if we're running NetWare5 or NetWare6. Since this is a NetWare 6.5 Service Pack, we'll follow the NetWare65 flow after the Label VERSION65_IS_CORRECT line. This tells us that we copy the contents of \65\system to SYS:\SYSTEM, and \65\STARTUP to C:\NWSERVER. Looking inside the SP Build, we find these files in SYS\SYSTEM and STARTUP. Copy these files over the existing ones.

Then we need to update the Product Database. We place that line right below the ones we did for the previous section:

;----- Clean up temporary directory -----
EraseFile 0, autoexecDir, 'nwupdate', '',''
EraseFile 1, autoexecDir, 'nwupdate', '',''

      ProductRecord NSS, 0, "3.24.01"
      ProductRecord NSS, 1, "NetWare 6.5 post-SP5 NSS 5A"
      ProductRecord LIBUP, 0, "9.00.03"
      ProductRecord LIBUP, 1, "NetWare LIBC NWLIB6h FTF Kit"
      ProductRecord LIBUP, 1, "NetWare LIBC / CLIB NWLIB6h FTF Kit"

GotoIfEqual %{CSP}, 1, STARTUP_Done
GotoIfEqual %{ZFS}, 1, Reboot
GotoIfEqual %{AREBOOT}, 1, Reboot

Summary

To summarize the process of dealing with these kinds of patches:

  1. Read the .IPS script included with the patch.
  2. Review it for logical flow.
  3. If all it is doing is checking versions and environment and then copying files, it is a good candidate for slipstreaming.
  4. As with the 'simple' patch process, copy the updated files where the script tells you to. It may be in PRODUCTS, or in either of STARTUP or SYS.
  5. Modify the SP\INSTALL\STARTUP.ICS file to include the correct ProductRecord lines.

Gotchas

Resist as long as you can the temptation to put the updated files in SYS and STARTUP instead of there they belong in PRODUCTS. Because of how the install process works, you will almost definitely end up with problems during the service pack installation process. The files in those two directory trees are copied first, and then the PRODUCTS tree is installed later. If you had copied MOD_IPP.NLM into SYS\APACHE2\IPRINT in the SP build, it would get copied. But when the APACHE2.ZSP file expanded you would be met with a dialog like this one:

File MOD_IPP.NLM being copied is older than the current file. What do you want to do?

And that dialog box would appear for every file like that. If you can't find where the file goes in PRODUCTS, you can get away with putting it into SYS or STARTUP. Doing it that way makes the SP build less clean, as well as potentially generating errors.

Conclusion

As time passes after a Service Pack is released, post-SP patches accumulate. These fix problems introduced by the SP, and fix problems the SP didn't fix. If it has been a while since the SP came out, there are going to be a few post-SP patches to apply. With this method you can include those patches inside the Service Pack build itself and apply them all in one reboot.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell