- 論壇徽章:
- 1
|
作者:silverwolf
SCO UNIX 下Custom發(fā)布軟件的制作方法(含CCS的使用)
很早以前寫好的帖子,根據(jù)“SCO UNIX高級(jí)寶典”修改而成,用完后丟在公司的論壇上,現(xiàn)重新發(fā)布出來。中間半角空格被我用全角替換,估計(jì)直接粘貼無法使用,有用到的替換一下。
問題:
很多軟件產(chǎn)品完工之后,都會(huì)做成一個(gè)軟件包,以便于用戶用custom工具進(jìn)行安裝。哪位能詳細(xì)描述一下,做軟件包的過程?
答:
SCO OPENSERVER 下custom發(fā)布軟件的制作方法
在SCO OPENSERVER5.0.x下,軟件都用cutsom管理用戶通過該工具,可以很好地進(jìn)行軟件的安裝、升級(jí)、刪除;開發(fā)商通過該工具,可以很好地管理好開發(fā)的發(fā)布軟件的版本。利用SCO OPENSERVER下的一個(gè)工具--Custom Distribution Master ToolKit,本文提供了custom發(fā)布軟件的制作方法。
CDMT生成的發(fā)布軟件,根據(jù)其介質(zhì)可為軟盤、磁帶或光盤版。其中光盤發(fā)布軟件的生成比較困難,這是由于SCO OPENSERVER支持的光盤刻錄機(jī)比較少,往往只好借助于windows或linux下的刻錄工具。然而,現(xiàn)在軟件大都通過光盤來安裝,因此,光盤發(fā)布軟件的制作顯得尤為重要。下面將具體介紹CDMT生成發(fā)布軟件的具體過程,包括軟盤、磁帶和光盤。
一、確定你的產(chǎn)品結(jié)構(gòu)
SCO OPENSERVER下,custom按照如下層次組織系統(tǒng)上安裝的軟件:
如產(chǎn)品SCO OpenServer 5.0.x被分成很多組件,如Xclient和Wserver,每一個(gè)組件又分成多個(gè)包,如man等。
為了說明方便,我們所舉的例中名稱都取為一個(gè),并且只有一個(gè)組件和一個(gè)包,名字全部為test。
二、確定每個(gè)文件的屬性
屬性有shared(/opt)和non-shared(/var/opt)之分,其中shared的文件為只讀,non-shared的文件為可讀可寫。本處為說明方便,所舉的例子中的文件全部為shared。
To specify the shared and non-shared files when you create the distribution tree, put the shared files in the SHARED directory, and the non-shared files in CLIENT. Another way to accomplish this is to define the shared and non-shared files in the CDMT input files. Set the distTreeRootSHARED attribute to the directory containing the shared files and distTreeRootCLIENT to the directory containing the non-shared files. Set these attributes in the COMP record in *.cmpnt, or PKG record in *.pkg. See cdmtInput(CDMT) for details.
For example, if you want custom(ADM) to place a non-shared file in the /var/opt/K/SCO/WServer/1.0.0/lib directory, either put the distribution file in the distTreeRoot/CLIENT/lib directory or set the COMP record distTreeRootCLIENT attribute to the directory containing the non-shared files.
三、構(gòu)件軟件的目錄結(jié)構(gòu)
所安裝的test軟件的目錄結(jié)構(gòu)為:
/usr/test/.profile
database/
dblog/
bin/
tmp/
四、設(shè)置CDMT的環(huán)境
設(shè)置生成該Distribution的根目錄CDMT_DIR環(huán)境變量,在命令行下鍵入:
#CDMT_DIR=/usr/test ;export CDMT_DIR
五、生成CDMT命令所需的輸入文件
包括三個(gè)文件,分別是:
$CDMT_DIR/input/test.prd
$CDMT_DIR/input/test.cmpnt
$CDMT_DIR/input/test.pkg上述三個(gè)文件可以用vi生成,也可以用如下兩條命令生成后用vi修改。
在$CDMT_DIR目錄下:
find . -print>/tmp/test.files
cdmtConvert /tmp/test.files
在input目錄下,生成了四個(gè)文件,其中一個(gè)是為生成cdmt.config文件的。
轉(zhuǎn)到$CDMT_DIR目錄下,執(zhí)行命令:
。i $CDMT_DIR/cdmt.config
在該文件下輸入:
CONFIG:
archiveMedia=CD
CD_MEDIA:
distCode=“CDDist”
再把input目錄下的test.config文件中的內(nèi)容拷貝到cdmt.config中。
以上的config文件是為生成光盤介質(zhì),生成其它介質(zhì)的config也類似,可以參考隨機(jī)手冊(cè)。
六、生成SSO樹
在CDMT_DIR宏已設(shè)定的條件下,在任何目錄下(當(dāng)然,一般都在$CDMT_DIR/下)先后執(zhí)行以下三個(gè)命令:
1?cdmtParse,該命令軟件存儲(chǔ)對(duì)象(SSO)數(shù)據(jù)庫,它讀取CDMT的input文件,并把生成的SSO放在$CDMT-DIR/sso下。
2?cdmtCompress,該命令構(gòu)件SSO的目錄,并壓縮它。
3?cdmtArchive,該命令生成可custom安裝的格式。
七、從硬盤上移到指定介質(zhì)上
1?若是FLOPPY,可以用以下命令
cdmtArchive -media FLOPPY -copy
默認(rèn)狀態(tài)下,系統(tǒng)用cpio拷貝到軟盤上,cpio有個(gè)缺點(diǎn),不檢查寫得是否正確;用tar也一樣。往往在多張軟盤tar到硬盤上時(shí),發(fā)現(xiàn)最后一張盤有問題,而不得不從頭來。
2?若是TAPE,可以用以下命令
cdmtArchive -media TAPE -copy
默認(rèn)狀態(tài)下,在磁帶上生成一個(gè)文件系統(tǒng)。此步完成即完成整個(gè)制作過程。
3?若是CD介質(zhì),比較復(fù)雜
(1)#cd /usr/test/sso #ls可在其下看見 /opt目錄
(2)用mkisofs工具生成ISO9660的文件系統(tǒng)
mkisofs可從internet上downlad下來,編譯后可以使用
mkisofs -r -T -o cd_image.iso
其中,表示對(duì)當(dāng)前目錄操作,不可改為opt。
此時(shí),在/usr/test目錄下,生成文件cd_image.iso,該文件即是用來刻錄的鏡像文件。
(3)把cd_image.iso移到windows操作系統(tǒng)下,在該操作系統(tǒng)下進(jìn)行刻錄。可以用ftp方式(windows和openserver不在同一計(jì)算機(jī)中),也可以用mount方式(windows和openserver在同一計(jì)算機(jī)中)。用windows下的刻錄軟件刻錄該軟件。
BTW:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cdmtConvert 轉(zhuǎn)換一個(gè)文件列表成為CDMT輸入文件(*.prd, *.cmpnt and *.pkg)。
cdmtConvert [-f] [-inputDir directory] [-defaultPerms] [-version version] [-exportMacro macroName]packageCode*.files
-f 在刪除以前的目錄和文件時(shí),不提示用戶
-inputDir 指明存放轉(zhuǎn)換后的文件的目錄
-defaultPerms 忽略實(shí)際文件的權(quán)限,使用*.cmpnt中的缺省定義
-version 定義版本號(hào)
-exportMacro 定義一個(gè)宏名
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cdmtParse 命令從CDMT輸入文件(*.prd, *.cmpnt and *.pkg)中產(chǎn)生SSO數(shù)據(jù)庫的文件。
cdmtParse [-f] [-config filename] [-inputDir directory] [-prd *.prd files] [-cmpnt *.cmpnt files] [*.prd files]
一般情況下,cdmtParse命令是讀入$CDMT_DIR/input目錄下所有的*.prd文件,*.prd文件中引用了*.cmpnt和*.pkg文件。
-f 在刪除以前的目錄和文件時(shí),不提示用戶
-inputDir 指明輸入文件*.prd的目錄
-config 指明一個(gè)配置文件,而不用cdmt.config
-prd *.prd files 指明只處理指定的prd文件。
-cmpnt *.cmpnt files 指明只處理指定的*.cmpnt文件
*.prd files 只讀入指定的prd文件
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cdmtCompress 把所有SSO文件轉(zhuǎn)換成分布程序文件形式,再壓縮這些文件(如果指定要壓縮的話)
cdmtCompress [-config filename] [-cmpnt *.cmpnt files]
-config filename 指明一個(gè)配置文件,而不用cdmt.config
-cmpnt *.cmpnt files 只拷貝和壓縮在cmpnt文件中指定的組件文件
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cdmtArchive 命令產(chǎn)生能夠用custom安裝的程序
cdmtArchive [-f] [-config filename] [-media media_type] [-copy]
缺省情況下,cdmtArchive命令從cdmt.config文件讀入配置信息;生成的安裝文件缺省的放在$CDMT_DIR/archives/TAPE目錄下。
-f 在刪除以前的目錄和文件時(shí),不提示用戶
-config 指明一個(gè)配置文件,而不用cdmt.config
-copy 拷貝檔案到介質(zhì)
-f copy 與-copy一樣,只是不提示。
-media media_type 指定要拷貝的介質(zhì),可以是:TAPE, CD和FLOPPY
cdmtArchive命令產(chǎn)生出以下的文件:
VOL.volumeIndex.archiveIndex CPIO文檔,volumeIndex是介質(zhì)的卷標(biāo),archiveIndex是文檔號(hào)
VOL.volumeIndex.archiveIndex.files 每個(gè)文檔里面的文件列表,用來產(chǎn)生實(shí)際的文檔。
VOL.volumeIndex.archiveIndex.sum 一個(gè)用命令sum -r產(chǎn)生出來的檔案的sum值列表。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cdmt.config -- specify default CDMT configuration
在這個(gè)文件里面,可以定義以下的選項(xiàng):
MACROS 定義宏
格式:
MACROS:
macroname = macrovalue
COMPONENT_ORDER 指明應(yīng)用程序組件在發(fā)布中順序
格式:
COMPONENT_ORDER:
integer = componentID|componentCode
integer = componentID|componentCode
integer = componentID|componentCode
EXAMPLE:
COMPONENT_ORDER:
1 = SCO:cdmt::1.0.1
2 = SCO:WServer::4.0
3 = SCO:XClients::1.0
This example specifies that the CDMT component appears first, WServer appears second, and XClients appears third on the media.
CONFIG 指明安裝文件的一般配置信息
格式:
CONFIG:
inputDir= pathname(default $CDMT_DIR/inputDir)
ssoDir = pathname(default $CDMT_DIR/sso)
removalPrompt = TRUE | FALSE (default TRUE)
removeFiles = TRUE | FALSE (default TRUE)
compress = TRUE | FALSE (default TRUE)
archiveMedia = TAPE | CD | FLOPPY (default TAPE)
FLOPPY_MEDIA 指明如果用軟盤作為工具時(shí)的一些配置信息
格式:
FLOPPY_MEDIA:
device = media device name (default /dev/rfd0135ds18)
volumeSize = volume size in KB (default 1440)
archivesDir = directory where cdmtArchive creates archives (default $CDMT_DIR/archives/FLOPPY)
archiveFormat = format of the archive (default CPIO)
freeSpace = amount of space to leave on filesystem (default 0)
distCode = distribution code (default ``protoFloppyDist'')
distVersion = distribution version (default ``1.0'')
paperLabel = volume media label (default ``Floppy Volume %d'')
TAPE_MEDIA 指明如果用磁帶作為工具時(shí)的一些配置信息
格式:
TAPE_MEDIA:
device = media device name (default /dev/nrct0)
volumeSize = volume size in KB (default 9000000000)
archivesDir = directory where cdmtArchive creates archives (default $CDMT_DIR/archives/TAPE)
distCode = distribution code (default ``protoTapeDist'')
distVersion = distribution version (default ``1.0'')
paperLabel = volume media label (default ``Tape Volume %d'')
CD_MEDIA 指明如果用光盤作為工具時(shí)的一些配置信息
格式:
CD_MEDIA:
distCode = distribution code (default ``protoCDDist'')
distVersion = distribution version (default ``1.0'')
paperLabel = volume media label (default ``CD Volume %d'')
在以上的定義的一些屬性的意義:
archivesDir 指定cdmtArchive命令產(chǎn)生的文件的存放目錄,缺省放在$CDMT_DIR/archives/TAPE或者$CDMT_DIR/archives/FLOPPY
archiveFormat 對(duì)于軟盤,指定其文檔格式為CPIO或者FILESYS;如果指定為FILESYS,則cdmtArchive 命令在軟盤上創(chuàng)建一個(gè)文件系統(tǒng),并把文檔拷貝到上面,CUSTOM可以識(shí)別兩種格式。缺省CPIO.
freeSpace 指明在介質(zhì)上保留的空間。對(duì)于軟盤文件系統(tǒng)格式(FILESYS),預(yù)留空間可以后來拷貝文件到這個(gè)空間里面;缺省是零。
inputDir 指定包含有CDMT文件的目錄,cdmtParse命令在這個(gè)目錄中搜索*.prd,*.cmpnt和*.pkg文件,缺省$CDMT_DIR/input
ssoDir 指明cdmtParse命令產(chǎn)生的組件文件*.sso映象文件的存放目錄。缺省是$CDMT_DIR/sso。
archiveMedia 指明cdmtArchive命令要產(chǎn)生文檔的存放介質(zhì)類型,缺省是TAPE。
removeFiles 指明命令cdmtParse時(shí),是否移除原來的SSO文件和SSO數(shù)據(jù)庫中的記錄。如果不需要移除,則cdmtCompress命令要比較新產(chǎn)生的SSO文件與原來在目錄下的SSO文件的修改時(shí)間,如果當(dāng)前SSO文件新,則拷貝該文件。缺省是TRUE
removalPrompt 在刪除一個(gè)文件或者是目錄時(shí),是否提示,缺省是TRUE
compress 是否壓縮SSO文件,缺省是TRUE
distCode 指定一個(gè)唯一的分布碼.
distVersion 指明發(fā)布軟件的版本號(hào),非產(chǎn)品的版本號(hào)。
paperLabel 對(duì)每一個(gè)介質(zhì)產(chǎn)生一個(gè)卷標(biāo),缺省是"Volume %d"
macroName 指定一個(gè)宏名的替代值
integer 指定一個(gè)組件的ID號(hào)
device 指定檔案文件的介質(zhì)名稱,缺省對(duì)于軟盤,是/dev/rfd0135ds18;對(duì)于磁帶,是/dev/nrct0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mkisofs
選項(xiàng) 功能
-o 指定 ISO 映像的輸出文件名
-J 生成 Joliet 命名記錄;對(duì)于將在 Windows 環(huán)境下使用的光盤有幫助
-R 生成 Rock Ridge (RR) 命名記錄來保留文件名長(zhǎng)度和大小寫,特別用于 UNIX/Linux 環(huán)境
-A 設(shè)立一個(gè)應(yīng)用程序 ID - 一個(gè)將會(huì)被寫入到映像卷頭的文本字串,它對(duì)于判定光盤上的應(yīng)用程序有幫助
-V 設(shè)立一個(gè)文件卷 ID - 當(dāng)映像被刻錄后,光盤被掛載到 Solaris 和 Windows 環(huán)境后被指派給它的一個(gè)名稱
-v 設(shè)置執(zhí)行時(shí)的詳細(xì)反饋,對(duì)于在映像被制作時(shí)查看 它的狀態(tài)有幫助。
-x 不包括任何緊跟在這個(gè)選項(xiàng)之后的目錄; 這個(gè)選項(xiàng)可以被重復(fù)使用(譬如, ... -x /home/joe/trash -x /home/joe/delete ...)
-r 使用長(zhǎng)文件名,并開放全部文件的讀取權(quán)限。
-T 建立文件名的轉(zhuǎn)換表,適用于不支持長(zhǎng)文件名的系統(tǒng)上。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example 12-1 Example product description file (WServer.prd)
PROD:SCO:testProd:
description ="Widget Server"
# $WServer_VER is a CDMT macro defined in the cdmt.config file.
version =$WServer_VER
packages =SCO:WServer
# $WServer_DIR is defined in cdmt.config.
cmpntFiles =$WServer_DIR/input/WServer.cmpnt
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example 12-2 Example component description file (WServer.cmpnt)
COMP:SCO:WServer:
description = "Widget Server"
# $WServer_VER is a CDMT macro defined in the cdmt.config file.
version = $WServer_VER
subpackages = WSERVER,EXAMPLES
# $WServer_DIR is defined in cdmt.config.
distTreeRoot = $WServer_DIR
# distTreeRootSHARED specifies where the shared files are located
distTreeRootSHARED = $WServer_DIR
# distTreeRootCLIENT specifies where the non-shared files are located
distTreeRootCLIENT = $WServer_DIR
pkgFiles = $WServer_DIR/input/WServer.pkg
FILE_DEFAULT:
perms = 444
owner = bin
group = bin
DIR_DEFAULT:
perms = 755
owner = bin
group = bin
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example 12-3 Example package description file (WServer.pkg)
(This example describes only a few of the packages in the WServer component.)
PKG:Control:
description = "WServer component definition files"
# $WServer_DIR is defined in cdmt.config.
distTreeRoot = $WServer_DIR
# distTreeRootSHARED specifies where the shared files are located
distTreeRootSHARED = $WServer_DIR
# distTreeRootCLIENT specifies where the non-shared files are located
distTreeRootCLIENT = $WServer_DIR
DIR:WSERVER:SHARED:./cntl:
perms = 0755
owner = bin
group = bin
FILE:WSERVER:SHARED:./cntl/ccs:
perms = 0755
owner = bin
group = bin
PKG:WSERVER:
description = "Widget Server"
distTreeRoot = $WServer_DIR
distTreeRootSHARED = $WServer_DIR
distTreeRootCLIENT = $WServer_DIR
DIR:WSERVER:SHARED:./bin:
perms = 0755
owner = bin
group = bin
FILE:WSERVER:SHARED:./bin/xm_wserver:
perms = 0755
owner = bin
group = bin
exportPath = /bin/xm_wserver
DIR:WSERVER:CLIENT:./usr:
perms = 0755
owner = bin
group = bin
DIR:WSERVER:CLIENT:./usr/lib:
perms = 0755
owner = bin
group = bin
DIR:WSERVER:CLIENT:./usr/lib/X11:
perms = 0755
owner = bin
group = bin
DIR:WSERVER:CLIENT:./usr/lib/X11/app-defaults:
perms = 0755
owner = bin
group = bin
FILE:WSERVER:CLIENT:./usr/lib/X11/app-defaults/WServer:
perms = 0444
owner = bin
group = bin
exportPath = ./lib/X11/app-defaults/WServer
.
.
.
PS: CDMT的高級(jí)功能 (CCS 組件控制腳本)
The Component Control Script (ccs) located in SSOroot/cntl/ccs, defines how custom(ADM) installs the component. For each component that you prepare for installation, create a ccs.
The ccs takes three arguments:
$1 step to perform
The step name contains three items:
+ the name of the phase to perform (such as LOAD)
+ the prefix UN (if the step is a reverse operation)
+ the prefix PRE_ or POST_, indicating which step to perform
For example, use PRE_LOAD to indicate the pre-load step during an installation; POST_UNATTACH indicates the post-attach step during a removal.
$2 keyword_list
The keyword specifies how the ccs behaves (during
installation only):
UPGRADE
Upgrades an older version of an SSO-based component to the new version of an SSO-based component.
OLD_CUSTOM_UPGRADE
Upgrades a non-SSO component to an SSO component. See ``Creating software upgrades'' in Developer's Topics.
$3
package_list
The package_list is a space-separated list of the fully-qualified package names in the component. Package names are in the form: vendorCode:componentCode:packageCode. See ``Component identifiers'' in Developer's Topics. To use the simpler packageCode, use the getPackageCode function in the ccsSetup(CDMT) library.
1. 說明:在CDMT_DIR根目錄下建立/cntl/ccs文件,文件格式可參考模板,一般只要修訂do_postexport函數(shù)
2. 設(shè)置CDMT的環(huán)境
#CDMT_DIR=/usr/test ;export CDMT_DIR
3. 生成.cmpnt, .prd, .pkg ,.config文件
find . -print>/tmp/test.files
cdmtConvert /tmp/test.files
4. 打開$CDMT_DIR/input/目錄下的.pkg文件, 修改/cntl/ccs文件的用戶,屬組為bin:bin,訪問權(quán)限為744
5. 拷貝.config到$CDMT_DIR目錄,重命名為cdmt.config(偷懶步驟)
6. 余下步驟同上
PS:
如果出現(xiàn)如下警告:
Warning: distribution vendor not set
Warning: distribution code not set
Warning: distribution version not set
請(qǐng)定義cdmt.config中介質(zhì)相關(guān)參數(shù)(以軟盤為例)
CONFIG:
archiveMedia=FLOPPY
FLOPPY_MEDIA:
distVendor=foo
distCode=distribution code (default ``protoFloppyDist'')
distVersion=distribution version (default ``1.0'')
以下是CCS的內(nèi)容
#!/ibin/sh
# %Z% %M% %I% %E% %Q%
#
# Copyright (C) 2001 The Santa Cruz Operation, Inc.
# All Rights Reserved.
# The information in this file is provided for the exclusive use of
# the licensees of The Santa Cruz Operation, Inc. Such users have the
# right to use, modify, and incorporate this code into other products
# for purposes authorized by the license agreement provided they include
# this notice and the associated copyright notice with any such product.
# The information in this file is provided "AS IS" without warranty.
#
#******************************************************************************
# Generic CCS script -- CHANGE THIS!!!
#-----------------------------------------------------------------------------
# COMMENTS/DESCRIPTION
#-----------------------------------------------------------------------------
#
# input:
# $1 is the name of the step
# $2 is the keyword list (e.g., INSTALL, UPGRADE, REMOVE)
# $3 is the package list
#============================================================================
#====================================================================== INT ===
# cleanup --
#
# cleanup exits the package script with the passed argument
#
#------------------------------------------------------------------------------
cleanup()
{
exit $1
}
#====================================================================== INT ===
# do_save --
#
# do_save uses ccsUpgradeTool to save the RTS config files
#
#------------------------------------------------------------------------------
do_save()
{
return # don't do anything here for now
}
#=================CUSTOM INSTALLATION STEP FUNCTIONS=================== INT ===
#
#====================================================================== INT ===
# do_preload --
#
# If the keyword "UPGRADE" is specified, but the old version being
# upgraded is not an SSO component, special action may be required
# at this point. See guidelines 4.6.2 "How to Handle In-Place Upgrade".
#
# Note that only the files in the "SharedControl" package of the
# component have been loaded onto the target at this point.
#
#------------------------------------------------------------------------------
do_preload()
{
# calls do_save to save config files for upgrade
#
do_save
}
#====================================================================== INT ===
# do_postload --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postload()
{
do_save
# no work currently defined for here
}
#====================================================================== INT ===
# do_preattach --
#
# In this step, the ccs should make any necessary version-compatibility
# checks. If, for some reason it is not valid to install the component
# on the given client -- perhaps an inappropriate version of the
# operating system is installed, for instance -- the ccs shoudl return
# an exit code of $FAIL, causing teh installation to fail.
#
# If the keyword "UPGRADE" is specified, but the old version being
# upgraded is not an SSO component, special action is required at this
# point. See guidelines 4.6.2 "How to Handle In-Place Upgrade".
#
#------------------------------------------------------------------------------
do_preattach()
{
#
#
#
# perform necessary version-compatibility checks. perform a
# cleanup $FAIL
# if something is not right after loggin the reasons.
#
# calls do_save to save config files for network client upgrade
#
do_save
}
#====================================================================== INT ===
# do_postattach --
#
# If the keyword "UPGRADE" is specified, this is the step in which the
# ccs should merge the old configuration data into the appropriate files.
#
# If the old version being upgraded was not an SSO component, the old
# configuration data will have been saved in the CCS_PERSISTENT_STORAGE by
# an earlier script phase.
#
# After the saved data has been restored, any "query" parameters that
# necessitate further self-configuration should be applied. Only files
# wholly owned by this component -- i.e., those in the /var/opt area
# -- can be modified.
#
#------------------------------------------------------------------------------
do_postattach()
{
case "$upgrade" in
nonSSOupgrade)
# preserve any needed data from a 3.2v4 installation
;;
SSOupgrade)
# preserve any needed data from an OSr5 installation
;;
esac
}
#====================================================================== INT ===
# do_preregister --
#
# Here is where ScoAdmin OSAs that need to be available to other
# components during those component's "configure" phase should be
# installed. This implies some stringent restrictions on the
# implementation of such OSA's: they must operate completely within
# the boundries of their own component provided tools and data,
# possibly relying as well on tools available in /ibin.
#
#------------------------------------------------------------------------------
do_preregister()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_postregister --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postregister()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_preconfigure --
#
# The component should configure itself into any system service of which
# it is a consumer. For instance, calls to "idinstall" should be made
# here to add a drive into (or, in the case of a removal, to pull a
# driver out of) the link kit.
#
#------------------------------------------------------------------------------
do_preconfigure()
{
:
#
#
#
# This is where things that need to register with OSA's should call
# those OSAs.
}
#====================================================================== INT ===
# do_postconfigure --
#
# Any remaining configuration that relied on steps taken in the pre-
# configurure and system steps should be completed here
#
#------------------------------------------------------------------------------
do_postconfigure()
{
:
#
#
#
# Continue anything started in do_preconfigure that needs finishing
# up.
#
}
#====================================================================== INT ===
# do_preexport --
#
# No work defined here
#
#------------------------------------------------------------------------------
do_preexport()
{
:
# no work defined yet
}
#====================================================================== INT ===
# do_postexport --
#
# In the final phase, all the remaining public interfaces are exported
# to the system's public name space.
#
#------------------------------------------------------------------------------
do_postexport()
{
:
# ln -s /opt/K/SCO/manager/1.0/bin/monitor /usr/bin/monitor
}
#=================CUSTOM REMOVAL STEP FUNCTIONS-----=================== INT ===
#
#====================================================================== INT ===
# do_preunexport --
#
# In the first phase, all the extra public interfaces are unexported
# from the system's public name space.
#
#------------------------------------------------------------------------------
do_preunexport()
{
:
#
#
#
# This is the place that would be filled by all the other misc
# functions performed by the removal script that were not covered by
# the previous steps. Things like flushing buffers and the like.
}
#====================================================================== INT ===
# do_postunexport --
#
# No work defined here
#
#------------------------------------------------------------------------------
do_postunexport()
{
:
# no work defined yet
}
#====================================================================== INT ===
# do_preunconfigure --
#
# The component should unconfigure itself from any system service it is
# a consumer of, using calls to the appropriate service interface. For
# instance, kernel drivers should be removed by a call to the "idinstall"
# utility.
#
#------------------------------------------------------------------------------
do_preunconfigure()
{
:
#
#
#
# This is where things that needed to register with OSA's should
# remove themselves from those OSAs.
}
#====================================================================== INT ===
# do_postunconfigure --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postunconfigure()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_preunregister --
#
# For components which provide system services, any work which is
# necessary prior to the removal of those services should be completed
# in this step. Depending on the service, it may be appropriate to
# inform all service consumers of the service's removal, using a
# provider-defined interface. See the guidlines 3.4 "Responsibilies
# involved with providing a system service."
#
#------------------------------------------------------------------------------
do_preunregister()
{
:
#
#
#
# This is where OSAs should call classconf & osaconf to remove
# themselves from the osa registration database
#
}
#====================================================================== INT ===
# do_postunregister --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postunregister()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_preunattach --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_preunattach()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_postunattach --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postunattach()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_preunload --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_preunload()
{
:
# No work defined yet
}
#====================================================================== INT ===
# do_postunload --
#
# No work is defined
#
#------------------------------------------------------------------------------
do_postunload()
{
:
# No work defined yet
}
#====================================================================== INT ===
# main --
#
# Based on step specified, perform actions of the general form:
# Global initialization
# Loop to call each package script for package-specific actions
# Global cleanup
#
# NOTE: Currently, a number of steps exist for which no action needs to
# be specified in this product. This will probably be true for most
# products in the near future.
#------------------------------------------------------------------------------
# NOTE: Do not "cd" around the place as the SSO_CLIENT_ROOT and related
# variables are of relative path and your use of them will be damaged
# if you change your location.
# set a trap so if the user dels out, a WARN exit value is passed
# to the calling program
trap 'cleanup $WARN' 1 2 3 15
# Process the arguments to this script and perform action
# for the step being executed currently
pkg_step=$1
pkg_keywords=$2
pkg_list=$3
# Source in the standard functions library
. ccsSetup.sh
# determine action to perform, default is install
upgrade=
removal=
for word in $pkg_keywords
do
case "$word" in
OLD_CUSTOM_UPGRADE) upgrade=nonSSOupgrade
;;
UPGRADE) upgrade=SSOupgrade
;;
esac
done
# This first case details in which order an "installation" takes place in:
case "$pkg_step" in
PRE_LOAD)
do_preload
;;
POST_LOAD)
do_postload
;;
PRE_ATTACH)
do_preattach
;;
POST_ATTACH)
do_postattach
;;
PRE_REGISTER)
do_preregister
;;
POST_REGISTER)
do_postregister
;;
PRE_CONFIGURE)
do_preconfigure
;;
POST_CONFIGURE)
do_postconfigure
;;
PRE_EXPORT)
do_preexport
;;
POST_EXPORT)
do_postexport
;;
esac
# This first case details in which order an "removal" takes place in:
case "$pkg_step" in
PRE_UNEXPORT)
do_preunexport
;;
POST_UNEXPORT)
do_postunexport
;;
PRE_UNCONFIGURE)
do_preunconfigure
;;
POST_UNCONFIGURE)
do_postunconfigure
;;
PRE_UNREGISTER)
do_preunregister
;;
POST_UNREGISTER)
do_postunregister
;;
PRE_UNATTACH)
do_preunattach
;;
POST_UNATTACH)
do_postunattach
;;
PRE_UNLOAD)
do_preunload
;;
POST_UNLOAD)
do_postunload
;;
esac
cleanup $OK
本文來自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u/31/showart_509556.html |
|