Tips and tricks for anaconda and kickstart
来源:互联网 发布:淘宝贝高瞻国际幼儿园 编辑:程序博客网 时间:2024/05/21 12:39
真正的文本模式运行anaconda
大家应该都知道在Kickstart脚本中加入一行"text" 就能以文本模式安装CentOS,不过这还不算"纯文本" 模式,下边这个选项可以使用真正的shell-like文本模式进行安装。那就是使用 "cmdline" 替换KS文件中"text"选项。这个选项当你使用了%packages --nobase 或者运行很复杂的%post脚本的时候特别有用,因为你可以从屏幕上直接看到脚本的运行输出,可以省却你大量的debug的时间。
anaconda 安装中各终端显示内容
Alt-F1
安装程序主画面(text或cmdline模式)
Alt-F2
shell提示符
Alt-F3
安装程序输出的log
Alt-F4
kernel等输出的系统
Alt-F5
所有其他信息
Alt-F7
安装程序主画面(图形模式)
给%pre 和 %post 段添加log
当使用%pre 或 %post 脚本的时候,可以把脚本的输出记录到日志文件中,使用--log=/path/to/file
%post --log=/root/my-post-log
echo 'Hello, World!'
另外一个记录和显示屏幕输出的方法是:
%post
exec < /dev/tty3 > /dev/tty3
chvt 3
echo
echo "################################"
echo "# Running Post Configuration #"
echo "################################"
(
echo 'Hello, World!'
) 2>&1 | /usr/bin/tee /var/log/post_install.log
chvt 1
使用指定网卡运行kickstart
当系统有多块网卡时anaconda安装程序会询问使用哪一块来进行kickstart安装。使用哪一块网卡可以在启动时通过ksdevice参数来指定。
第一种方法:ksdevice=eth0
第二种方法:ksdevice=link. 这种情况下anaconda会使用第一个具有活动连接的网卡。
第三种方法:用于PXE安装。 在PXE配置文件中加入 IPAPPEND 2 ,然后使用 ksdevice=bootif。在这种配置下,anaconda 会使用做了PXE启动的那块网卡。 (不要求这块网卡是第一个具有活动连接的网卡)。
在kickstart配置文件中需要使用network段来定义网络配置。如果你使用方法2 或 3 ,那么你不能明确知道哪块网卡会被选中。如果你在Kickstart文件中的network配置段没有明确指定一个设备的话,anaconda会根据你在network段中的信息来配置那块进行了kickstart安装过程的网卡。
强制kickstart询问网络配置
自CentOS 5开始出现了一个隐藏的kickstart选项,可以强制在安装过询问网络配置。在网络配置那里把 "query”关键字加到 --bootproto=后边:
network --device=eth0 --bootproto=query
安装过程中会谈出一个对话框询问IP地址配置。
允许/禁止 firstboot
在Kickstart文件中 "firstboot --enable" 或者 "firstboot --disable"
配置防火墙信任接口
可以使用--trust选项配置多个信任接口:
# Enable firewall, open port for ssh and make eth1 and eth2 trusted
firewall --enable --ssh --trust=eth1 --trust=eth2
- Tips and tricks for anaconda and kickstart
- Tips and tricks for the Java connector
- Productivity tips, tricks and hacks for academics
- 50.Tips.and.Tricks.for.MongoDB.Developers
- Tips and tricks for using WebDriver
- Tips and Tricks For CNN Structure
- Printing Tips and Tricks
- Win32 Tips and Tricks
- Printing Tips and Tricks
- Win32 Tips and Tricks
- Matlab: Tips and tricks
- Sed Tips and Tricks
- Eclipse Tips and Tricks
- Ruby tricks and tips
- Rspec tips and tricks
- C++ Tips and Tricks
- Pentest Tips and Tricks
- 50.Tips.and.Tricks.for.MongoDB.Developers --- Optimization Tips
- TDesC8与TDesC16之间的互转 ---转杨芹勍的博客
- 黑盒测试——功能测试常用的策略和方法
- RIA
- 面向连接网络通信模型
- 转:SQLServer级联删除示例
- Tips and tricks for anaconda and kickstart
- NET牛人应该知道些什么?
- The Old Man and The Sea 老人与海 by Ernest Hemingway 欧内斯特-海明威
- 我们的家
- java中怎么加入声音
- 深入剖析 iLBC 编码器原理
- 使用eclipse时出错org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
- org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
- F1~F12键的一些技巧