Solaris 10 10/08 安裝指南:自訂 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         -