免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3360 | 回复: 5
打印 上一主题 下一主题

[SCO UNIX] 【原创】SCO UNIX 下Custom发布软件的制作方法(含CCS的使用) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-10-13 23:36 |只看该作者 |倒序浏览
SCO UNIX 下Custom发布软件的制作方法(含CCS的使用)

  很早以前写好的帖子,根据“SCO UNIX高级宝典”修改而成,用完后丢在公司的论坛上,现重新发布出来。中间半角空格被我用全角替换,估计直接粘贴无法使用,有用到的替换一下。

  问题:
  很多软件产品完工之后,都会做成一个软件包,以便于用户用custom工具进行安装。哪位能详细描述一下,做软件包的过程?

  答:
  SCO OPENSERVER 下custom发布软件的制作方法
  在SCO OPENSERVER5.0.x下,软件都用cutsom管理用户通过该工具,可以很好地进行软件的安装、升级、删除;开发商通过该工具,可以很好地管理好开发的发布软件的版本。利用SCO OPENSERVER下的一个工具--Custom Distribution Master ToolKit,本文提供了custom发布软件的制作方法。

  CDMT生成的发布软件,根据其介质可为软盘、磁带或光盘版。其中光盘发布软件的生成比较困难,这是由于SCO OPENSERVER支持的光盘刻录机比较少,往往只好借助于windows或linux下的刻录工具。然而,现在软件大都通过光盘来安装,因此,光盘发布软件的制作显得尤为重要。下面将具体介绍CDMT生成发布软件的具体过程,包括软盘、磁带和光盘。
  
  一、确定你的产品结构
  
  SCO OPENSERVER下,custom按照如下层次组织系统上安装的软件:
  如产品SCO OpenServer 5.0.x被分成很多组件,如Xclient和Wserver,每一个组件又分成多个包,如man等。
  为了说明方便,我们所举的例中名称都取为一个,并且只有一个组件和一个包,名字全部为test。
  
  二、确定每个文件的属性
  
  属性有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.

  三、构件软件的目录结构
  
  所安装的test软件的目录结构为:
  /usr/test/.profile
       database/
       dblog/
       bin/
       tmp/
  
  四、设置CDMT的环境
  
  设置生成该Distribution的根目录CDMT_DIR环境变量,在命令行下键入:
  #CDMT_DIR=/usr/test ;export CDMT_DIR
  
  五、生成CDMT命令所需的输入文件
  
  包括三个文件,分别是:
  $CDMT_DIR/input/test.prd
  $CDMT_DIR/input/test.cmpnt
  $CDMT_DIR/input/test.pkg上述三个文件可以用vi生成,也可以用如下两条命令生成后用vi修改。

  在$CDMT_DIR目录下:
  find . -print>;/tmp/test.files
  cdmtConvert /tmp/test.files

  在input目录下,生成了四个文件,其中一个是为生成cdmt.config文件的。
  转到$CDMT_DIR目录下,执行命令:
  #vi $CDMT_DIR/cdmt.config

  在该文件下输入:
  CONFIG:
  archiveMedia=CD

  CD_MEDIA:
  distCode=“CDDist”
  再把input目录下的test.config文件中的内容拷贝到cdmt.config中。
  以上的config文件是为生成光盘介质,生成其它介质的config也类似,可以参考随机手册。
  
  六、生成SSO树
  
  在CDMT_DIR宏已设定的条件下,在任何目录下(当然,一般都在$CDMT_DIR/下)先后执行以下三个命令:
  1?cdmtParse,该命令软件存储对象(SSO)数据库,它读取CDMT的input文件,并把生成的SSO放在$CDMT-DIR/sso下。
  2?cdmtCompress,该命令构件SSO的目录,并压缩它。
  3?cdmtArchive,该命令生成可custom安装的格式。
  
  七、从硬盘上移到指定介质上
  
  1?若是FLOPPY,可以用以下命令
  cdmtArchive -media FLOPPY -copy
  默认状态下,系统用cpio拷贝到软盘上,cpio有个缺点,不检查写得是否正确;用tar也一样。往往在多张软盘tar到硬盘上时,发现最后一张盘有问题,而不得不从头来。

  2?若是TAPE,可以用以下命令
  cdmtArchive -media TAPE -copy
  默认状态下,在磁带上生成一个文件系统。此步完成即完成整个制作过程。

  3?若是CD介质,比较复杂
  (1)#cd /usr/test/sso  #ls可在其下看见 /opt目录

  (2)用mkisofs工具生成ISO9660的文件系统
  mkisofs可从internet上downlad下来,编译后可以使用
  mkisofs -r -T -o cd_image.iso
  其中,表示对当前目录操作,不可改为opt。
  此时,在/usr/test目录下,生成文件cd_image.iso,该文件即是用来刻录的镜像文件。

  (3)把cd_image.iso移到windows操作系统下,在该操作系统下进行刻录。可以用ftp方式(windows和openserver不在同一计算机中),也可以用mount方式(windows和openserver在同一计算机中)。用windows下的刻录软件刻录该软件。

  BTW:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  cdmtConvert 转换一个文件列表成为CDMT输入文件(*.prd, *.cmpnt and *.pkg)。
  cdmtConvert [-f] [-inputDir directory] [-defaultPerms] [-version version] [-exportMacro macroName]packageCode*.files 
  -f       在删除以前的目录和文件时,不提示用户
  -inputDir    指明存放转换后的文件的目录
  -defaultPerms  忽略实际文件的权限,使用*.cmpnt中的缺省定义
  -version    定义版本号
  -exportMacro  定义一个宏名

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  cdmtParse 命令从CDMT输入文件(*.prd, *.cmpnt and *.pkg)中产生SSO数据库的文件。
  cdmtParse [-f] [-config filename] [-inputDir directory] [-prd *.prd files] [-cmpnt *.cmpnt files] [*.prd files]
  一般情况下,cdmtParse命令是读入$CDMT_DIR/input目录下所有的*.prd文件,*.prd文件中引用了*.cmpnt和*.pkg文件。
  -f           在删除以前的目录和文件时,不提示用户
  -inputDir        指明输入文件*.prd的目录
  -config         指明一个配置文件,而不用cdmt.config
  -prd *.prd files    指明只处理指定的prd文件。
  -cmpnt *.cmpnt files  指明只处理指定的*.cmpnt文件
  *.prd files       只读入指定的prd文件
  
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  cdmtCompress 把所有SSO文件转换成分布程序文件形式,再压缩这些文件(如果指定要压缩的话)
  cdmtCompress [-config filename] [-cmpnt *.cmpnt files]
  -config filename    指明一个配置文件,而不用cdmt.config
  -cmpnt *.cmpnt files  只拷贝和压缩在cmpnt文件中指定的组件文件

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  cdmtArchive 命令产生能够用custom安装的程序
  cdmtArchive [-f] [-config filename] [-media media_type] [-copy]
  缺省情况下,cdmtArchive命令从cdmt.config文件读入配置信息;生成的安装文件缺省的放在$CDMT_DIR/archives/TAPE目录下。
  -f           在删除以前的目录和文件时,不提示用户
  -config         指明一个配置文件,而不用cdmt.config
  -copy          拷贝档案到介质
  -f copy         与-copy一样,只是不提示。
  -media media_type    指定要拷贝的介质,可以是:TAPE, CD和FLOPPY

  cdmtArchive命令产生出以下的文件:
  VOL.volumeIndex.archiveIndex    CPIO文档,volumeIndex是介质的卷标,archiveIndex是文档号
  VOL.volumeIndex.archiveIndex.files 每个文档里面的文件列表,用来产生实际的文档。
  VOL.volumeIndex.archiveIndex.sum  一个用命令sum -r产生出来的档案的sum值列表。

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  cdmt.config -- specify default CDMT configuration
  在这个文件里面,可以定义以下的选项:
  MACROS 定义宏 
  格式:
  MACROS:
  macroname = macrovalue

  COMPONENT_ORDER 指明应用程序组件在发布中顺序
  格式:
  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 指明如果用软盘作为工具时的一些配置信息
  格式:
  FLOPPY_MEDIA:
  device = media device name (default /dev/rfd0135ds1
  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 指明如果用磁带作为工具时的一些配置信息
  格式:
  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 指明如果用光盘作为工具时的一些配置信息
  格式:
  CD_MEDIA:
  distCode = distribution code (default ``protoCDDist'')
  distVersion = distribution version (default ``1.0'')
  paperLabel = volume media label (default ``CD Volume %d'')

  在以上的定义的一些属性的意义:
  archivesDir   指定cdmtArchive命令产生的文件的存放目录,缺省放在$CDMT_DIR/archives/TAPE或者$CDMT_DIR/archives/FLOPPY
  archiveFormat  对于软盘,指定其文档格式为CPIO或者FILESYS;如果指定为FILESYS,则cdmtArchive 命令在软盘上创建一个文件系统,并把文档拷贝到上面,CUSTOM可以识别两种格式。缺省CPIO.
  freeSpace    指明在介质上保留的空间。对于软盘文件系统格式(FILESYS),预留空间可以后来拷贝文件到这个空间里面;缺省是零。
  inputDir    指定包含有CDMT文件的目录,cdmtParse命令在这个目录中搜索*.prd,*.cmpnt和*.pkg文件,缺省$CDMT_DIR/input
  ssoDir     指明cdmtParse命令产生的组件文件*.sso映象文件的存放目录。缺省是$CDMT_DIR/sso。
  archiveMedia  指明cdmtArchive命令要产生文档的存放介质类型,缺省是TAPE。
  removeFiles   指明命令cdmtParse时,是否移除原来的SSO文件和SSO数据库中的记录。如果不需要移除,则cdmtCompress命令要比较新产生的SSO文件与原来在目录下的SSO文件的修改时间,如果当前SSO文件新,则拷贝该文件。缺省是TRUE
  removalPrompt  在删除一个文件或者是目录时,是否提示,缺省是TRUE
  compress    是否压缩SSO文件,缺省是TRUE
  distCode    指定一个唯一的分布码.
  distVersion   指明发布软件的版本号,非产品的版本号。
  paperLabel   对每一个介质产生一个卷标,缺省是"Volume %d"
  macroName    指定一个宏名的替代值
  integer     指定一个组件的ID号
  device     指定档案文件的介质名称,缺省对于软盘,是/dev/rfd0135ds18;对于磁带,是/dev/nrct0

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  mkisofs
  选项  功能
  -o   指定 ISO 映像的输出文件名
  -J   生成 Joliet 命名记录;对于将在 Windows 环境下使用的光盘有帮助
  -R   生成 Rock Ridge (RR) 命名记录来保留文件名长度和大小写,特别用于 UNIX/Linux 环境
  -A   设立一个应用程序 ID - 一个将会被写入到映像卷头的文本字串,它对于判定光盘上的应用程序有帮助
  -V   设立一个文件卷 ID - 当映像被刻录后,光盘被挂载到 Solaris 和 Windows 环境后被指派给它的一个名称
  -v   设置执行时的详细反馈,对于在映像被制作时查看 它的状态有帮助。
  -x   不包括任何紧跟在这个选项之后的目录; 这个选项可以被重复使用(譬如, ... -x /home/joe/trash -x /home/joe/delete ...)
  -r   使用长文件名,并开放全部文件的读取权限。
  -T   建立文件名的转换表,适用于不支持长文件名的系统上。

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  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的高级功能 (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函数
  
  2. 设置CDMT的环境
  #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,访问权限为744
  
  5. 拷贝.config到$CDMT_DIR目录,重命名为cdmt.config(偷懒步骤)
  
  6. 余下步骤同上

  PS:
  如果出现如下警告:
  Warning: distribution vendor not set
  Warning: distribution code not set
  Warning: distribution version not set

  请定义cdmt.config中介质相关参数(以软盘为例)
  CONFIG:
    archiveMedia=FLOPPY
  FLOPPY_MEDIA:
    distVendor=foo
    distCode=distribution code (default ``protoFloppyDist'')
    distVersion=distribution version (default ``1.0'')

论坛徽章:
0
2 [报告]
发表于 2005-10-13 23:42 |只看该作者

【原创】SCO UNIX 下Custom发布软件的制作方法(含CCS的使用)

以下是CCS的内容

  1. #!/ibin/sh
  2. #       %Z% %M% %I% %E% %Q%
  3. #
  4. #        Copyright (C) 2001 The Santa Cruz Operation, Inc.
  5. #                All Rights Reserved.
  6. #        The information in this file is provided for the exclusive use of
  7. #        the licensees of The Santa Cruz Operation, Inc.  Such users have the
  8. #        right to use, modify, and incorporate this code into other products
  9. #        for purposes authorized by the license agreement provided they include
  10. #        this notice and the associated copyright notice with any such product.
  11. #        The information in this file is provided "AS IS" without warranty.
  12. #
  13. #******************************************************************************
  14. #                      Generic CCS script -- CHANGE THIS!!!
  15. #-----------------------------------------------------------------------------
  16. #  COMMENTS/DESCRIPTION
  17. #-----------------------------------------------------------------------------
  18. #
  19. #       input:
  20. #           $1 is the name of the step
  21. #           $2 is the keyword list (e.g., INSTALL, UPGRADE, REMOVE)
  22. #           $3 is the package list
  23. #============================================================================

  24. #====================================================================== INT ===
  25. #  cleanup --
  26. #   
  27. #    cleanup exits the package script with the passed argument
  28. #
  29. #------------------------------------------------------------------------------
  30. cleanup()
  31. {
  32.         exit $1
  33. }

  34. #====================================================================== INT ===
  35. #  do_save --
  36. #   
  37. #    do_save uses ccsUpgradeTool to save the RTS config files
  38. #
  39. #------------------------------------------------------------------------------
  40. do_save()
  41. {
  42.         return # don't do anything here for now
  43. }

  44. #=================CUSTOM INSTALLATION STEP FUNCTIONS=================== INT ===
  45. #
  46. #====================================================================== INT ===
  47. #  do_preload --
  48. #   
  49. #        If the keyword "UPGRADE" is specified, but the old version being
  50. #        upgraded is not an SSO component, special action may be required
  51. #        at this point. See guidelines 4.6.2 "How to Handle In-Place Upgrade".
  52. #
  53. #        Note that only the files in the "SharedControl" package of the
  54. #        component have been loaded onto the target at this point.
  55. #
  56. #------------------------------------------------------------------------------
  57. do_preload()
  58. {
  59.         # calls do_save to save config files for upgrade
  60.         #

  61.         do_save
  62. }

  63. #====================================================================== INT ===
  64. #  do_postload --
  65. #   
  66. #        No work is defined
  67. #
  68. #------------------------------------------------------------------------------
  69. do_postload()
  70. {
  71.         do_save
  72.         # no work currently defined for here
  73. }

  74. #====================================================================== INT ===
  75. #  do_preattach --
  76. #
  77. #        In this step, the ccs should make any necessary version-compatibility
  78. #        checks. If, for some reason it is not valid to install the component
  79. #        on the given client -- perhaps an inappropriate version of the
  80. #        operating system is installed, for instance -- the ccs shoudl return
  81. #        an exit code of $FAIL, causing teh installation to fail.
  82. #
  83. #        If the keyword "UPGRADE" is specified, but the old version being
  84. #        upgraded is not an SSO component, special action is required at this
  85. #        point. See guidelines 4.6.2 "How to Handle In-Place Upgrade".
  86. #   
  87. #------------------------------------------------------------------------------
  88. do_preattach()
  89. {
  90.         #
  91.         #        < FILL IN HERE >;
  92.         #
  93.         # perform necessary version-compatibility checks. perform a
  94.         #        cleanup $FAIL
  95.         # if something is not right after loggin the reasons.
  96.         #

  97.         # calls do_save to save config files for network client upgrade
  98.         #

  99.         do_save
  100. }

  101. #====================================================================== INT ===
  102. #  do_postattach --
  103. #
  104. #        If the keyword "UPGRADE" is specified, this is the step in which the
  105. #        ccs should merge the old configuration data into the appropriate files.
  106. #
  107. #        If the old version being upgraded was not an SSO component, the old
  108. #        configuration data will have been saved in the CCS_PERSISTENT_STORAGE by
  109. #        an earlier script phase.
  110. #
  111. #        After the saved data has been restored, any "query" parameters that
  112. #        necessitate further self-configuration should be applied. Only files
  113. #        wholly owned by this component -- i.e., those in the /var/opt area
  114. #        -- can be modified.
  115. #   
  116. #------------------------------------------------------------------------------
  117. do_postattach()
  118. {
  119.         case "$upgrade" in
  120.             nonSSOupgrade)
  121.                 # preserve any needed data from a 3.2v4 installation
  122.                 ;;
  123.             SSOupgrade)
  124.                 # preserve any needed data from an OSr5 installation
  125.                 ;;
  126.         esac
  127. }

  128. #====================================================================== INT ===
  129. #  do_preregister --
  130. #   
  131. #        Here is where ScoAdmin OSAs that need to be available to other
  132. #        components during those component's "configure" phase should be
  133. #        installed. This implies some stringent restrictions on the
  134. #        implementation of such OSA's: they must operate completely within
  135. #        the boundries of their own component provided tools and data,
  136. #        possibly relying as well on tools available in /ibin.
  137. #
  138. #------------------------------------------------------------------------------
  139. do_preregister()
  140. {
  141.         :
  142.         # No work defined yet
  143. }

  144. #====================================================================== INT ===
  145. #  do_postregister --
  146. #
  147. #        No work is defined
  148. #
  149. #------------------------------------------------------------------------------
  150. do_postregister()
  151. {
  152.         :
  153.         # No work defined yet
  154. }

  155. #====================================================================== INT ===
  156. #  do_preconfigure --
  157. #   
  158. #        The component should configure itself into any system service of which
  159. #        it is a consumer. For instance, calls to "idinstall" should be made
  160. #        here to add a drive into (or, in the case of a removal, to pull a
  161. #        driver out of) the link kit.
  162. #
  163. #------------------------------------------------------------------------------
  164. do_preconfigure()
  165. {
  166.         :
  167.         #
  168.         #        < FILL IN HERE >;
  169.         #
  170.         # This is where things that need to register with OSA's should call
  171.         # those OSAs.
  172. }

  173. #====================================================================== INT ===
  174. #  do_postconfigure --
  175. #
  176. #        Any remaining configuration that relied on steps taken in the pre-
  177. #        configurure and system steps should be completed here
  178. #
  179. #------------------------------------------------------------------------------
  180. do_postconfigure()
  181. {
  182.         :
  183.         #
  184.         #        < FILL IN HERE >;
  185.         #
  186.         # Continue anything started in do_preconfigure that needs finishing
  187.         # up.
  188.         #
  189. }

  190. #====================================================================== INT ===
  191. #  do_preexport --
  192. #   
  193. #        No work defined here
  194. #
  195. #------------------------------------------------------------------------------
  196. do_preexport()
  197. {
  198.         :
  199.         # no work defined yet
  200. }

  201. #====================================================================== INT ===
  202. #  do_postexport --
  203. #   
  204. #        In the final phase, all the remaining public interfaces are exported
  205. #        to the system's public name space.
  206. #
  207. #------------------------------------------------------------------------------
  208. do_postexport()
  209. {
  210.         :
  211.     # ln -s /opt/K/SCO/manager/1.0/bin/monitor /usr/bin/monitor
  212. }

  213. #=================CUSTOM REMOVAL STEP FUNCTIONS-----=================== INT ===
  214. #
  215. #====================================================================== INT ===
  216. #  do_preunexport --
  217. #   
  218. #        In the first phase, all the extra public interfaces are unexported
  219. #        from the system's public name space.
  220. #
  221. #------------------------------------------------------------------------------
  222. do_preunexport()
  223. {
  224.         :
  225.         #
  226.         #        < FILL IN HERE >;
  227.         #
  228.         # This is the place that would be filled by all the other misc
  229.         # functions performed by the removal script that were not covered by
  230.         # the previous steps. Things like flushing buffers and the like.

  231. }

  232. #====================================================================== INT ===
  233. #  do_postunexport --
  234. #   
  235. #        No work defined here
  236. #
  237. #------------------------------------------------------------------------------
  238. do_postunexport()
  239. {
  240.         :
  241.         # no work defined yet
  242. }

  243. #====================================================================== INT ===
  244. #  do_preunconfigure --
  245. #   
  246. #        The component should unconfigure itself from any system service it is
  247. #        a consumer of, using calls to the appropriate service interface. For
  248. #        instance, kernel drivers should be removed by a call to the "idinstall"
  249. #        utility.
  250. #
  251. #------------------------------------------------------------------------------
  252. do_preunconfigure()
  253. {
  254.         :
  255.         #
  256.         #        < FILL IN HERE >;
  257.         #
  258.         # This is where things that needed to register with OSA's should
  259.         # remove themselves from those OSAs.
  260. }

  261. #====================================================================== INT ===
  262. #  do_postunconfigure --
  263. #
  264. #        No work is defined
  265. #
  266. #------------------------------------------------------------------------------
  267. do_postunconfigure()
  268. {
  269.         :
  270.         # No work defined yet
  271. }

  272. #====================================================================== INT ===
  273. #  do_preunregister --
  274. #
  275. #        For components which provide system services, any work which is
  276. #        necessary prior to the removal of those services should be completed
  277. #        in this step. Depending on the service, it may be appropriate to
  278. #        inform all service consumers of the service's removal, using a
  279. #        provider-defined interface. See the guidlines 3.4 "Responsibilies
  280. #        involved with providing a system service."
  281. #
  282. #------------------------------------------------------------------------------
  283. do_preunregister()
  284. {
  285.         :
  286.         #
  287.         #        < FILL IN HERE >;
  288.         #
  289.         # This is where OSAs should call classconf & osaconf to remove
  290.         # themselves from the osa registration database
  291.         #
  292. }

  293. #====================================================================== INT ===
  294. #  do_postunregister --
  295. #
  296. #        No work is defined
  297. #
  298. #------------------------------------------------------------------------------
  299. do_postunregister()
  300. {
  301.         :
  302.         # No work defined yet
  303. }

  304. #====================================================================== INT ===
  305. #  do_preunattach --
  306. #
  307. #        No work is defined
  308. #
  309. #------------------------------------------------------------------------------
  310. do_preunattach()
  311. {
  312.         :
  313.         # No work defined yet
  314. }

  315. #====================================================================== INT ===
  316. #  do_postunattach --
  317. #
  318. #        No work is defined
  319. #
  320. #------------------------------------------------------------------------------
  321. do_postunattach()
  322. {
  323.         :
  324.         # No work defined yet
  325. }


  326. #====================================================================== INT ===
  327. #  do_preunload --
  328. #
  329. #        No work is defined
  330. #
  331. #------------------------------------------------------------------------------
  332. do_preunload()
  333. {
  334.         :
  335.         # No work defined yet
  336. }

  337. #====================================================================== INT ===
  338. #  do_postunload --
  339. #
  340. #        No work is defined
  341. #
  342. #------------------------------------------------------------------------------
  343. do_postunload()
  344. {
  345.         :
  346.         # No work defined yet
  347. }

  348. #====================================================================== INT ===
  349. #  main --
  350. #   
  351. #    Based on step specified, perform actions of the general form:
  352. #       Global initialization
  353. #       Loop to call each package script for package-specific actions
  354. #       Global cleanup
  355. #
  356. #    NOTE: Currently, a number of steps exist for which no action needs to
  357. #    be specified in this product.  This will probably be true for most
  358. #    products in the near future.
  359. #------------------------------------------------------------------------------

  360. # NOTE: Do not "cd" around the place as the SSO_CLIENT_ROOT and related
  361. #       variables are of relative path and your use of them will be damaged
  362. #        if you change your location.

  363. # set a trap so if the user dels out, a WARN exit value is passed
  364. # to the calling program
  365. trap 'cleanup $WARN' 1 2 3 15

  366. # Process the arguments to this script and perform action
  367. # for the step being executed currently
  368. pkg_step=$1
  369. pkg_keywords=$2
  370. pkg_list=$3

  371. # Source in the standard functions library
  372. . ccsSetup.sh

  373. # determine action to perform, default is install
  374. upgrade=
  375. removal=
  376. for word in $pkg_keywords
  377. do
  378.         case "$word" in
  379.                 OLD_CUSTOM_UPGRADE) upgrade=nonSSOupgrade
  380.                 ;;
  381.                 UPGRADE) upgrade=SSOupgrade
  382.                 ;;
  383.         esac
  384. done

  385. # This first case details in which order an "installation" takes place in:
  386. case "$pkg_step" in
  387.         PRE_LOAD)
  388.                         do_preload
  389.                         ;;
  390.         POST_LOAD)
  391.                         do_postload
  392.                         ;;
  393.         PRE_ATTACH)
  394.                         do_preattach
  395.                         ;;
  396.         POST_ATTACH)
  397.                         do_postattach
  398.                         ;;
  399.         PRE_REGISTER)
  400.                         do_preregister
  401.                         ;;
  402.         POST_REGISTER)
  403.                         do_postregister
  404.                         ;;
  405.         PRE_CONFIGURE)
  406.                         do_preconfigure
  407.                         ;;
  408.         POST_CONFIGURE)
  409.                         do_postconfigure
  410.                         ;;
  411.         PRE_EXPORT)
  412.                         do_preexport
  413.                         ;;
  414.         POST_EXPORT)
  415.                         do_postexport
  416.                         ;;
  417. esac

  418. # This first case details in which order an "removal" takes place in:
  419. case "$pkg_step" in
  420.         PRE_UNEXPORT)
  421.                         do_preunexport
  422.                         ;;
  423.         POST_UNEXPORT)
  424.                         do_postunexport
  425.                         ;;
  426.         PRE_UNCONFIGURE)
  427.                         do_preunconfigure
  428.                         ;;
  429.         POST_UNCONFIGURE)
  430.                         do_postunconfigure
  431.                         ;;
  432.         PRE_UNREGISTER)
  433.                         do_preunregister
  434.                         ;;
  435.         POST_UNREGISTER)
  436.                         do_postunregister
  437.                         ;;
  438.         PRE_UNATTACH)
  439.                         do_preunattach
  440.                         ;;
  441.         POST_UNATTACH)
  442.                         do_postunattach
  443.                         ;;
  444.         PRE_UNLOAD)
  445.                         do_preunload
  446.                         ;;
  447.         POST_UNLOAD)
  448.                         do_postunload
  449.                         ;;
  450. esac

  451. cleanup $OK

复制代码

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
3 [报告]
发表于 2005-10-14 09:06 |只看该作者

【原创】SCO UNIX 下Custom发布软件的制作方法(含CCS的使用)

不错,补充的内容很全面

论坛徽章:
0
4 [报告]
发表于 2005-10-14 12:55 |只看该作者

【原创】SCO UNIX 下Custom发布软件的制作方法(含CCS的使用)

很好的资料!

论坛徽章:
0
5 [报告]
发表于 2005-10-15 09:45 |只看该作者

【原创】SCO UNIX 下Custom发布软件的制作方法(含CCS的使用)

谢谢,很详细,收藏。。。:)

论坛徽章:
0
6 [报告]
发表于 2006-10-12 15:52 |只看该作者
七匹狼,高人
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP