JavaScript is required to for searching.
跳过导航链接
退出打印视图
应用程序包开发者指南     Oracle Solaris 10 1/13 Information Library (简体中文)
search filter icon
search icon

文档信息

前言

1.  设计软件包

2.  生成软件包

3.  增强软件包的功能(任务)

4.  验证和转换软件包

5.  软件包创建案例研究

请求来自管理员的输入

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

request 脚本

在安装时创建文件并在删除期间保存文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

space 文件

i.admin 类操作脚本

r.cfgdata 删除脚本

定义软件包兼容性和相关性

技术

方法

案例研究文件

pkginfo 文件

copyright 文件

compver 文件

depend 文件

使用标准类和类操作脚本修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

i.inittab 安装类操作脚本

r.inittab 删除类操作脚本

inittab 文件

使用 sed 类和 postinstall 脚本修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

sed 类操作脚本 (/etc/inittab)

postinstall 脚本

使用 build 类修改文件

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

生成文件

在安装期间修改 crontab 文件

技术

方法

案例研究文件

pkginfo 命令

prototype 文件

i.cron 安装类操作脚本

r.cron 删除类操作脚本

crontab 文件 #1

crontab 文件 #2

使用过程脚本安装和删除驱动程序

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

request 脚本

postinstall 脚本

preremove 脚本

使用 sed 类和过程脚本安装驱动程序

技术

方法

案例研究文件

pkginfo 文件

prototype 文件

sed 类操作脚本 (/etc/devlink.tab)

postinstall 安装脚本

preremove 删除脚本

copyright 文件

6.  创建软件包的高级技术

词汇表

索引

使用过程脚本安装和删除驱动程序

此软件包可安装驱动程序。

技术

此案例研究展示以下技术:

有关这些脚本的更多信息,请参见编写过程脚本

方法

案例研究文件

pkginfo 文件

PKG=bufdev
NAME=Buffer Device
CATEGORY=system
BASEDIR=/
ARCH=INTEL
VERSION=Software Issue #19
CLASSES=none

prototype 文件

要在安装时安装驱动程序,您必须在 prototype 文件中包括驱动程序的对象和配置文件。

在此示例中,驱动程序的可执行模块被命名为 bufferadd_drv 命令处理该文件。内核使用配置文件 buffer.conf 帮助配置驱动程序。

i pkginfo
i request
i postinstall
i preremove
f none $KERNDIR/buffer 444 root root
f none $KERNDIR/buffer.conf 444 root root

查看此示例中的 prototype 文件,请注意以下事项:

request 脚本

trap 'exit 3' 15
# determine where driver object should be placed; location
# must be an absolute path name that is an existing directory
KERNDIR=`ckpath -aoy -d /kernel/drv -p \
“Where do you want the driver object installed”` || exit $?

# make parameters available to installation service, and
# so to any other packaging scripts
cat >$1 <<!

CLASSES='$CLASSES'
KERNDIR='$KERNDIR'
!
exit 0

postinstall 脚本

# KERNDIR parameter provided by `request' script
err_code=1                    # an error is considered fatal
# Load the module into the system
cd $KERNDIR
add_drv -m '* 0666 root sys' buffer || exit $err_code
# Create a /dev entry for the character node
installf $PKGINST /dev/buffer0=/devices/eisa/buffer*:0 s
installf -f $PKGINST

preremove 脚本

err_code=1                    # an error is considered fatal
# Unload the driver
rem_drv buffer || exit $err_code
# remove /dev file
removef $PKGINST /dev/buffer0 ; rm /dev/buffer0
removef -f $PKGINST