Solaris 10 10/09 安装指南:自定义 JumpStart 和高级安装

custom_probes 文件和关键字的示例

在以下目录中可以找到探测函数和比较函数的其他示例:

下面的 custom_probes 文件包含测试 TCX 图形卡是否存在的探测函数和比较函数。


示例 5–1 custom_probes 文件

#!/bin/sh
# 
# custom_probe script to test for the presence of a TCX graphics card.
# 

# 
# PROBE FUNCTIONS
# 
probe_tcx() {
  SI_TCX=`modinfo | grep tcx | nawk '{print $6}'`
  export SI_TCX
}

# 
# COMPARISON FUNCTIONS
# 
cmp_tcx() {
  probe_tcx

  if [ "X${SI_TCX}" = "X${1}" ]; then
     return 0
  else
     return 1
  if
}

下面的示例 rules 文件显示如何使用前面示例中定义的探测关键字 tcx。如果 TCX 图形卡已安装并在系统中被找到,则运行 profile_tcx。否则,运行 profile


注 –

总是将探测关键字放置在 rules 文件的开头或开头附近。这样,可确保在其他可能依赖于这些探测关键字的规则关键字之前读取和运行这些关键字。



示例 5–2 自定义在 rules 文件中使用的探测关键字

probe tcx
tcx     tcx     -     profile_tcx     -
any     any     -     profile         -