21.3.3.2. 示例:在安装后脚本中挂载 NFS
这个 %post 部分的示例挂载 NFS 共享并执行位于 /usr/new-machines/ 上的名为 runme 的脚本。Kickstart 模式中不支持 NFS 文件锁定,因此需要使用 -o nolock 选项。
# Start of the %post section with logging into /root/ks-post.log
%post --log=/root/ks-post.log
# Mount an NFS share
mkdir /mnt/temp
mount -o nolock 10.10.0.2:/usr/new-machines /mnt/temp
openvt -s -w -- /mnt/temp/runme
umount /mnt/temp
# End of the %post section
%end