[原]Anaconda 的启动参数

    Anaconda是Red Hat、CentOS、Fedora、红旗等Linux的安装管理程序。它提供文本、图形等安装方式,并支持Kickstart等脚本提供自动安装的功能。此外,其还支持许多启动参数,熟悉这些参数可为安装带来很多方便。

一、简单介绍
Anaconda 目前由Fedora 维护:官网地址。另一个相关的项目是Kickstart:官网地址。
当使用光盘引导机器,见到如下提示时,即将准备进入Anaconda环境:

引用
boot:

额外的启动参数,可在该提示后输入,如:

boot: linux dd

若您使用的是PXE 等安装方式(参考这里),则可加在配置文件 /tftpboot/pxelinux.cfg/default 中的append后面:

引用
label ax3_x86_sp3
  kernel vmlinuz_ax3_x86_sp3
  append initrd=initrd_ax3_x86_sp3.img devfs=nomount ramdisk_size=16384

或在网络引导后,在label 的后面输入,例如:

ax3_x86_sp3 vnc ip=dhcp

二、举例
以常见的PXE+VNC方式安装为例,该方式可利用网络引导机器,并使用VNC进行图形方式的安装。
常见的参数是:

ax3_x86_sp3 vnc vncpassword=123456 headless ip=192.168.0.10 gateway=192.168.0.254 netmask=255.255.255.0 dns=192.168.0.254 ksdevice=eth0 method=cdrom lang=en_US keymap=us

ax3_x86_sp3 vnc vncpassword=123456 headless ip=dhcp ksdevice=eth0 method=ftp://yumer:yumer@192.168.228.153/dc/6.0/sp3/os/i386 lang=en_US keymap=us

说明:

引用
1、ax3_x86_sp3 是使用PXE方式时,在配置文件/tftpboot/pxelinux.cfg/default 中定义的label 名称;
2、vnc 是激活VNC 安装模式,稍后可通过其他机器上的VNC 客户端连接到本机上进行图形方式的安装;(有另一个参数vncconnect,可直接设定对端VNC客户端的IP地址,当VNC服务起来后,会自动连接到该客户端上)
3、vncpassword 是提供VNC 使用的密码,最少六位,但也可以不设该参数,即不使用密码进行连接;
4、headless 指定可用于不带显卡的环境中;
5、ip 可直接设定地址(配合gateway、netmask、dns等使用),可可通过dhcp获得IP;
6、ksdevice 指定安装时将使用哪个网卡设备;
7、method 指定获取安装介质的方式,可用cdrom、ftp、http、nfs等方式;
8、lang 指定使用哪种语言;
9、keymap 键盘类型

以上参数中并没有包括分区方式,若希望实现完全自动化的安装,可通过配置Kickstart脚本,用ks 参数加载。

三、Anaconda 启动参数
以下内容,来自Anaconda Boot Options,还可参考Boot Options:
allowwireless
Experimental option to allow use of wireless networking adapters in the loader.

askmethod
Do not automatically use the CD-ROM as the install source if we detect installation media in your CD-ROM drive.

asknetwork
Prompt for network configuration in the first stage of installation regardless of installation method.

autostep
Advance to the next screen automatically. This is mostly useful for debugging.

blacklist=
Do not automatically load module , even if the hardware exists on the system.

btrfs
Enable btrfs file system support in Fedora 13. Note that Btrfs is still a experimental filesystem in this release. Feedback is welcome but take regular backups of your data if you are using it.

cmdline
Force command line install mode. This mode simply prints out text and does not allow any interactivity. All options must be specified either in a kickstart file or on the command line.

dd or driverdisk
Use a driver disk.

debug=1
Add a debug button to the UI that allows dropping into a python debugger.

dhcpclass=
Sends a custom DHCP vendor class identifier. ISC’s dhcpcd can inspect this value using “option vendor-class-identifier”.

dhcptimeout=
Stop attempting to get a DHCP lease after seconds.

display=
Sets the $DISPLAY environment variable.

dns=
Comma separated list of nameservers to use for a network installation.

dogtail=
Use the dogtail (automated UI testing framework) script found at . Only makes sense on graphical installs.

essid=
Connect to the wireless network given by for a network installation. Only makes sense with allowwireless.

ethtool=
Specify certain additional network device settings. Valid options are duplex={full,half} and speed={1000,100,10}. Multiple options may be given as a string separated by spaces and surrounded by double quotes.

ext4migrate
In Fedora 11 or above, configure the system to mount ext3 partitions as ext4 and enable the extents format among other changes.

gateway=
Gateway to use for a network installation.

graphical
Force graphical install. Required to have ftp/http use GUI. A graphical install implies that the installed system will boot up into runlevel 5, using whichever display manager is in use by the default desktop (gdm for GNOME, kdm for KDE).

headless
Specify that the machine being installed onto does not have any display hardware, and that anaconda should not probe for it.

ip=
IP to use for a network installation, use ‘dhcp’ for DHCP.

ipv6=
IPv6 IP address to use for a network installation. Use ‘auto’ for automatic neighbor discovery.

keymap=
Keyboard layout to use. Valid values are those which can be used for the keyboard kickstart command.

ks
Gives the location of the kickstart file to be used for installation. If only ks is given, the file is assumed to be on NFS. The ks parameter may take these other forms:
ks=cdrom:
ks=file: (path = ‘fd0/ks.cfg’, for example)
ks=ftp://ks=hd:: (dev = ‘hda1’, for example)
ks=http:///ks=nfs[:options]::ks=bd:: (biosdev = ’80p1′, for example, note this does not work for BIOS RAID sets)

ksdevice
Takes one of 4 types of argument which tells install what network device to use for kickstart from network:
An argument like ‘eth0’ naming a specific interface
An argument like 00:12:34:56:78:9a indicating the MAC address of a specific interface
The keyword ‘link’ indicating that the first interface with link up
The keyword ‘bootif’ indicating that the MAC address indicated by the BOOTIF command line option will be used to locate the boot interface. BOOTIF is automagically supplied by pxelinux when you include the option ‘IPAPPEND 2’ in your pxelinux.cfg file

kssendmac
Adds HTTP headers to ks=http:// request that can be helpful for provisioning systems. Includes MAC address of all network interfaces in HTTP headers of the form “X-RHN-Provisioning-MAC-0: eth0 01:23:45:67:89:ab”.

lang=
Language to use for the installation. This should be a language which is valid to be used with the lang kickstart command.

linksleep=
Check the network device for a link every second for seconds.

loglevel=
Set the minimum level required for messages to be logged on a terminal (log files always contain messages of all levels). Values for are debug, info, warning, error, and critical. The default value is info.

lowres
In Fedora 10 and earlier, force GUI installer to run at 640×480. This will not resize the interface, so some UI elements will likely be offscreen (although still active through keyboard navigation).

mediacheck
Activates loader code to give user option of testing integrity of install source (if an ISO-based method).

method=
This option is deprecated in favor of repo=. For now, it does the same thing as repo= but will be removed at a later date.

mtu=
Set the MTU (maximum transmission unit) used during network installs to the given number. Uses the network stack default if this option is not specified.

netmask=
Netmask to use for a network installation.

nicdelay=
Sleep for seconds before trying again to bring up the network.

nodmraid
Disable support for dmraid.

nofirewire
Do not load support for firewire devices.

noipv4
Disable IPv4 networking during installation.

noipv6
Disable IPv6 networking during installation.

nokill
A debugging option that prevents anaconda from terminating all running programs when a fatal error occurs.

nomount
Don’t automatically mount any installed Linux partitions in rescue mode.

nompath
Disable support for multipath devices.

nopass
Don’t pass keyboard/mouse info to stage 2 installer, good for testing keyboard and mouse config screens in stage2 installer during network installs.

noprobe
Do not attempt to detect hw, prompts user instead.

noselinux
Disable SELinux on the installed system.

noshell
Do not put a shell on tty2 during install.

nousb
Do not load USB support (helps if install hangs early sometimes).

nousbstorage
Do not load usbstorage module in loader. May help with device ordering on SCSI systems.

proxy=[protocol://][username[:password]@]host[:port]
Use the given proxy settings when performing an HTTP/HTTPS/FTP installation.

repo=
This option tells anaconda where to find the packages for installation. This option must point to a valid yum repository. It is analagous to the older method= option, but repo= makes it more clear exactly what is meant. This option may appear only once on the command line. It may appear multiple times inside a kickstart file.
The value passed to repo= can also be used to find the stage2 image if no CD or stage2= parameter is found. In this case, the image is looked for by appending images/install.img to the repo parameter.
The following forms are accepted for repo=:
repo=cdrom:
repo=ftp://[user:password@]/repo=http:///repo=hd::/Look for ISO images on the hard drive partition given by device (/dev/sda1, for instance). This may not be a partition that will be formatted during installation later. These should be ISO images, not an exploded tree on the hard drive. anaconda will not look for the install.img file in any of the ISO images. The install.img must be placed in /images/, or a stage2= or CD must be provided. device can be a device name, LABEL=, or UUID=.
repo=nfs[:options]::/repo=nfsiso[:options]::/Look for ISO images on the NFS volume with the given server and path. These should be ISO images, not loopback mounted. anaconda will not look for the install.img file in any of the ISO iamges. The install.img must be placed in /images/, or a stage2= or CD must be provided.

rescue
Run rescue environment.

resolution=
Run installer in mode specified, ‘1024×768’ for example.

selinux[=0]
Disables selinux entirely. Defaults to on.

serial
Turns on serial console support.

stage2=
Specifies a path to a install.img file instead of to an installation source. Otherwise, follows the same syntax as repo=. If this parameter is provided, it takes precedence over all other methods of finding the install.img. Otherwise, anaconda will attempt to find the install.img first on any existing CD, and then from the location given by repo=/method=.
If only stage2= is given without repo=/method=, anaconda will use whatever repos the installed system would have enabled by default for installation. For instance, an install of a Fedora release will attempt to use the Fedora mirrorlist given by /etc/yum.repos.d/fedora.repo from that release.

syslog=[:]
Once installation is up and running, send log messages to the syslog process on , and optionally, on TCP port . Requires the remote syslog process to accept incoming connections.

telnet
Start a telnet server early during installation.

text
Force text mode install. This will install only base packages for a minimal system and implies that the installed system will boot up in runlevel 3 instead of to the graphical login screen.

updates
Prompt for removable media containing updates (bug fixes).

updates=
Image containing updates over FTP or HTTP.

upgradeany
Don’t require an /etc/redhat-release that matches the expected syntax to upgrade.

usefbx
Use the framebuffer X driver instead of attempting to use a hardware-specific one.

utf8
Set the TERM variable to vt100.

virtiolog=
Forward logs through the character device at /dev/virtio-ports/. See also Anaconda/Logging.

vnc
Enable vnc-based installation. You will need to connect to the machine using a vnc client application. A vnc install implies that the installed system will boot up in runlevel 3 instead of to the graphical login screen.

vncconnect=[:]
Once installation is up and running, connect to the vnc client named , and optionally use port .

vncpassword=
Enable a password for the vnc connection. This will prevent someone from inadvertently connecting to the vnc-based installation. Requires vnc option to be specified as well. If you have specified vncconnect the will not be used unless connection to host is not possible.

wepkey=
Use as the wireless key when doing a network installation via a wireless network. Requires use of essid. Only makes sense with allowwireless.

xdriver=
Use as the X driver to use during installation as well as on the installed system.

四、参考资料
Anaconda Boot Options
Fedora Installation Guide Chapter 9. Boot Options
Installing Fedora Using PXE Images
Headless VNC Install Disk
Headless VNC安装CentOS/RHEL
PXE Booting/Fedora Core

个性化Linux发行版光盘之补充——XZ(LZMA算法)
自定义Linux发行版光盘
完善PXE安装方式
使用PXE方式安装红旗Desktop 5.0

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/104193.html

(0)
上一篇 2021年8月25日
下一篇 2021年8月25日

相关推荐

发表回复

登录后才能评论