5.2. 開機參數

開機參數是 Linux 核心的參數。一般用於確保周邊設備能夠正確地運行。對於其中的大多數部分來說,核心可以自動檢查周邊設備的相關資訊。但是在某些情況下,您可能需要給核心一點小小的幫助。

如果這是您第一次開機系統,嘗試預設的開機參數 (即:不要輸入任何參數) 並且檢查是否工作正確。大部分情況下應該如此,如果不是,可以重新啟動,並且檢查需要告訴系統什麼樣的特定參數。

有關很多開機參數的資訊可以參閱 Linux BootPrompt HOWTO,其中包括一些老舊硬體的解決方法。這一節只描述一些對最常用的基本參數。一些常見的問題描述見 節 5.3, "安裝過程中的障礙排除"

當核心開機的時候,一條訊息

Memory:availk/totalk available 

應該會在開機過程的早期顯示。其中 total 應該符合您記憶體的總量,其中單位為多少 kb。如果此參數不符合您安裝的記憶體總數,需要使用 mem=ram 參數。 這裡 ram 被設成記憶體的數量。如是 "k" 為位元組,"m" 為兆位元組。例如,mem=65536kmem=64m 表示 64MB 記憶體。

If you are booting with a serial console, generally the kernel will autodetect this. If you have a videocard (framebuffer) and a keyboard also attached to the computer which you wish to boot via serial console, you may have to pass the console=device argument to the kernel, where device is your serial device, which is usually something like ttyS0.

5.2.1. Debian 安裝程式的參數

The installation system recognizes a few additional boot parameters[8] which may be useful.

A number of parameters have a "short form" that helps avoid the limitations of the kernel command line options and makes entering the parameters easier. If a parameter has a short form, it will be listed in brackets behind the (normal) long form. Examples in this manual will normally use the short form too.

debconf/priority (priority)

This parameter sets the lowest priority of messages to be displayed.

The default installation uses priority=high. This means that both high and critical priority messages are shown, but medium and low priority messages are skipped. If problems are encountered, the installer adjusts the priority as needed.

If you add priority=medium as boot parameter, you will be shown the installation menu and gain more control over the installation. When priority=low is used, all messages are shown (this is equivalent to the expert boot method). With priority=critical, the installation system will display only critical messages and try to do the right thing without fuss.

DEBIAN_FRONTEND

This boot parameter controls the type of user interface used for the installer. The current possible parameter settings are:

  • DEBIAN_FRONTEND=noninteractive

  • DEBIAN_FRONTEND=text

  • DEBIAN_FRONTEND=newt

  • DEBIAN_FRONTEND=gtk

The default frontend is DEBIAN_FRONTEND=newt. DEBIAN_FRONTEND=text may be preferable for serial console installs. Generally, only the newt frontend is available on default install media. On architectures that support it, the graphical installer uses the gtk frontend.

BOOT_DEBUG

設定此開機參數為 2 將使得安裝程式的啟動程序寫下所有冗長的紀錄。設定為 3 使得除錯介殼在決定性的時間點上能被使用。 (離開介殼後將繼續安裝程序。)

BOOT_DEBUG=0

此為預設。

BOOT_DEBUG=1

更多的資訊。

BOOT_DEBUG=2

大量的除錯資訊。

BOOT_DEBUG=3

介殼腳本將在開機期間執行於不同的地方以允許細節上的調整。退出介殼將繼續開機過程。

INSTALL_MEDIA_DEV

此參數值是載入 Debian 安裝程式設備的路徑,例如: INSTALL_MEDIA_DEV=/dev/floppy/0

The boot floppy, which normally scans all floppies it can to find the root floppy, can be overridden by this parameter to only look at the one device.

lowmem

Can be used to force the installer to a lowmem level higher than the one the installer sets by default based on available memory. Possible values are 1 and 2. See also 節 6.3.1.1, "Check available memory / low memory mode".

debian-installer/framebuffer (fb)

Some architectures use the kernel framebuffer to offer installation in a number of languages. If framebuffer causes a problem on your system you can disable the feature by the parameter fb=false. Problem symptoms are error messages about bterm or bogl, a blank screen, or a freeze within a few minutes after starting the install.

The video=vga16:off argument may also be used to disable the kernel's use of the framebuffer. Such problems have been reported on a Dell Inspiron with Mobile Radeon card.

debian-installer/theme (theme)

A theme determines how the user interface of the installer looks (colors, icons, etc.). What themes are available differs per frontend. Currently both the newt and gtk frontends only have a "dark" theme that was designed for visually impaired users. Set the theme by booting with theme=dark.

netcfg/disable_dhcp

預設情況下,debian-installer 會透過 DHCP 來自動偵測網路。如果檢測成功,您將不需要審視並且改變其取得的設定。您可以在 DHCP 檢測失敗的情況下手動配置網路。

如果您的網路上面具備一台 DHCP 伺服器,但是不想使用它,例如,因為它給出錯誤的答案。您可以使用參數 netcfg/disable_dhcp=true 來透過 DHCP 來設定網路並且手動輸入參數。

hw-detect/start_pcmcia

設定成 false 來阻止啟動 PCMCIA 服務,如果其引起各種問題。有些筆記型電腦對此會有錯誤的行為。

disk-detect/dmraid/enable (dmraid)

Set to true to enable support for Serial ATA RAID (also called ATA RAID, BIOS RAID or fake RAID) disks in the installer. Note that this support is currently experimental. Additional information can be found on the Debian Installer Wiki.

preseed/url (url)

Specify the url to a preconfiguration file to download and use for automating the install. See 節 4.6, "自動化安裝".

preseed/file (file)

Specify the path to a preconfiguration file to load for automating the install. See 節 4.6, "自動化安裝".

preseed/interactive

Set to true to display questions even if they have been preseeded. Can be useful for testing or debugging a preconfiguration file. Note that this will have no effect on parameters that are passed as boot parameters, but for those a special syntax can be used. See 節 B.5.2, "Using preseeding to change default values" for details.

auto-install/enable (auto)

Delay questions that are normally asked before preseeding is possible until after the network is configured. See 節 B.2.3, "Auto mode" for details about using this to automate installs.

finish-install/keep-consoles

During installations from serial or management console, the regular virtual consoles (VT1 to VT6) are normally disabled in /etc/inittab. Set to true to prevent this.

cdrom-detect/eject

在重開機前,debian-installer 預設會自動退出安裝時的光學媒介。如果系統不是自動從光碟開機,這不是必要的動作。在某些情況下,這反而不便,例如,如果光碟機不能自動插入光碟片,使用者又不在旁邊操作。許多 slot loading, slim-line 和 caddy 類型的光碟機不能自動重新掛載媒介。

設為 false 可以禁止自動退出,但要小心確保系統在安裝完後,不會自動從光碟開機。

debian-installer/allow_unauthenticated

By default the installer requires that repositories be authenticated using a known gpg key. Set to true to disable that authentication. Warning: insecure, not recommended.

mouse/protocol

For the gtk frontend (graphical installer), users can set the mouse protocol to be used by setting this parameter. Supported values are[9]: PS/2, IMPS/2, MS, MS3, MouseMan and MouseSystems. In most cases the default protocol should work correctly.

mouse/device

For the gtk frontend (graphical installer), users can specify the mouse device to be used by setting this parameter. This is mostly useful if the mouse is connected to a serial port (serial mouse). Example: mouse/device=/dev/ttyS1.

mouse/left

For the gtk frontend (graphical installer), users can switch the mouse to left-handed operation by setting this parameter to true.

directfb/hw-accel

For the gtk frontend (graphical installer), hardware acceleration in directfb is disabled by default. Set this parameter to true to enable it.

rescue/enable

Set to true to enter rescue mode rather than performing a normal installation. See 節 8.7, "Recovering a Broken System".

5.2.1.1. Using boot parameters to answer questions

With some exceptions, a value can be set at the boot prompt for any question asked during the installation, though this is only really useful in specific cases. General instructions how to do this can be found in 節 B.2.2, "Using boot parameters to preseed questions". Some specific examples are listed below.

debian-installer/locale (locale)

Can be used to set both the language and country for the installation. This will only work if the locale is supported in Debian. For example, use locale=de_CH to select German as language and Switzerland as country.

anna/choose_modules (modules)

Can be used to automatically load installer components that are not loaded by default. Examples of optional components that may be useful are openssh-client-udeb (so you can use scp during the installation) and ppp-udeb (see 節 D.5, "Installing Debian GNU/Linux using PPP over Ethernet (PPPoE)").

netcfg/disable_dhcp

Set to true if you want to disable DHCP and instead force static network configuration.

mirror/protocol (protocol)

By default the installer will use the http protocol to download files from Debian mirrors and changing that to ftp is not possible during installations at normal priority. By setting this parameter to ftp, you can force the installer to use that protocol instead. Note that you cannot select an ftp mirror from a list, you have to enter the hostname manually.

tasksel:tasksel/first (tasks)

Can be used to select tasks that are not available from the interactive task list, such as the kde-desktop task. See 節 6.3.5.2, "Selecting and Installing Software" for additional information.

5.2.1.2. Passing parameters to kernel modules

If drivers are compiled into the kernel, you can pass parameters to them as described in the kernel documentation. However, if drivers are compiled as modules and because kernel modules are loaded a bit differently during an installation than when booting an installed system, it is not possible to pass parameters to modules as you would normally do. Instead, you need to use a special syntax recognized by the installer which will then make sure that the parameters are saved in the proper configuration files and will thus be used when the modules are actually loaded. The parameters will also be propagated automatically to the configuration for the installed system.

Note that it is now quite rare that parameters need to be passed to modules. In most cases the kernel will be able to probe the hardware present in a system and set good defaults that way. However, in some situations it may still be needed to set parameters manually.

The syntax to use to set parameters for modules is:

module_name.parameter_name=value

If you need to pass multiple parameters to the same or different modules, just repeat this. For example, to set an old 3Com network interface card to use the BNC (coax) connector and IRQ 10, you would pass:

3c509.xcvr=3 3c509.irq=10

5.2.1.3. Blacklisting kernel modules

Sometimes it may be necessary to blacklist a module to prevent it from being loaded automatically by the kernel and udev. One reason could be that a particular module causes problems with your hardware. The kernel also sometimes lists two different drivers for the same device. This can cause the device to not work correctly if the drivers conflict or if the wrong driver is loaded first.

You can blacklist a module using the following syntax: module_name.blacklist=yes. This will cause the module to be blacklisted in /etc/modprobe.d/blacklist.local both during the installation and for the installed system.

Note that a module may still be loaded by the installation system itself. You can prevent that from happening by running the installation in expert mode and unselecting the module from the list of modules displayed during the hardware detection phases.



[8] With current kernels (2.6.9 or newer) you can use 32 command line options and 32 environment options. If these numbers are exceeded, the kernel will panic.

[9] See the man page for directfbrc(5) for additional information.