Debian的自动安装
我尝试了利用附录B的preseed来自动化安装。
听说使用preseed可以加载并设置安装程序的问题之类的。(不太清楚)
可以在http://www.debian.org/releases/wheezy/example-preseed.txt找到一个模板,复制并进行适当的配置。
--- example-preseed.txt 2014-03-08 12:35:13.254098876 +0900
+++ wheezy-preseed.cfg 2014-03-08 13:13:25.939464901 +0900
@@ -4,15 +4,15 @@
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
-#d-i debian-installer/language string en
-#d-i debian-installer/country string NL
-#d-i debian-installer/locale string en_GB.UTF-8
+d-i debian-installer/language string en
+d-i debian-installer/country string JP
+d-i debian-installer/locale string en_US.UTF-8
# Optionally specify additional locales to be generated.
#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
# Keyboard selection.
# keymap is an alias for keyboard-configuration/xkb-keymap
-d-i keymap select us
+d-i keyboard-configuration/xkb-keymap select us
# d-i keyboard-configuration/toggle select No toggling
### Network configuration
@@ -66,13 +66,13 @@
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
-d-i netcfg/get_hostname string unassigned-hostname
-d-i netcfg/get_domain string unassigned-domain
+#d-i netcfg/get_hostname string unassigned-hostname
+#d-i netcfg/get_domain string unassigned-domain
# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
# and adjust the following line.
-#d-i netcfg/hostname string somehost
+d-i netcfg/hostname string debian
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
@@ -96,10 +96,10 @@
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
#d-i mirror/protocol string ftp
-d-i mirror/country string manual
-d-i mirror/http/hostname string http.us.debian.org
+d-i mirror/country string JP
+d-i mirror/http/hostname string http.jp.debian.org
d-i mirror/http/directory string /debian
-d-i mirror/http/proxy string
+#d-i mirror/http/proxy string
# Suite to install.
#d-i mirror/suite string testing
@@ -114,17 +114,17 @@
#d-i passwd/make-user boolean false
# Root password, either in clear text
-#d-i passwd/root-password password r00tme
-#d-i passwd/root-password-again password r00tme
+d-i passwd/root-password password q
+d-i passwd/root-password-again password q
# or encrypted using an MD5 hash.
#d-i passwd/root-password-crypted password [MD5 hash]
# To create a normal user account.
-#d-i passwd/user-fullname string Debian User
-#d-i passwd/username string debian
+d-i passwd/user-fullname string yomi
+d-i passwd/username string yomi
# Normal user's password, either in clear text
-#d-i passwd/user-password password insecure
-#d-i passwd/user-password-again password insecure
+d-i passwd/user-password password q
+d-i passwd/user-password-again password q
# or encrypted using an MD5 hash.
#d-i passwd/user-password-crypted password [MD5 hash]
# Create the first user with the specified UID instead of the default.
@@ -140,12 +140,12 @@
# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
-d-i time/zone string US/Eastern
+d-i time/zone string Asia/Tokyo
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
-#d-i clock-setup/ntp-server string ntp.example.com
+d-i clock-setup/ntp-server string ntp.nict.jp
### Partitioning
## Partitioning example
@@ -164,17 +164,17 @@
# - regular: use the usual partition types for your architecture
# - lvm: use LVM to partition the disk
# - crypto: use LVM within an encrypted partition
-d-i partman-auto/method string lvm
+d-i partman-auto/method string regular
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
-d-i partman-lvm/device_remove_lvm boolean true
+#d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
-d-i partman-md/device_remove_md boolean true
+#d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
-d-i partman-lvm/confirm boolean true
-d-i partman-lvm/confirm_nooverwrite boolean true
+#d-i partman-lvm/confirm boolean true
+#d-i partman-lvm/confirm_nooverwrite boolean true
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
@@ -264,11 +264,11 @@
# repository.
# This makes partman automatically partition without confirmation.
-d-i partman-md/confirm boolean true
-d-i partman-partitioning/confirm_write_new_label boolean true
-d-i partman/choose_partition select finish
-d-i partman/confirm boolean true
-d-i partman/confirm_nooverwrite boolean true
+#d-i partman-md/confirm boolean true
+#d-i partman-partitioning/confirm_write_new_label boolean true
+#d-i partman/choose_partition select finish
+#d-i partman/confirm boolean true
+#d-i partman/confirm_nooverwrite boolean true
## Controlling how partitions are mounted
# The default is to mount by UUID, but you can also choose "traditional" to
@@ -314,16 +314,16 @@
#d-i debian-installer/allow_unauthenticated boolean true
### Package selection
-#tasksel tasksel/first multiselect standard, web-server
+tasksel tasksel/first multiselect standard
# If the desktop task is selected, install the kde and xfce desktops
# instead of the default gnome desktop.
#tasksel tasksel/desktop multiselect kde, xfce
# Individual additional packages to install
-#d-i pkgsel/include string openssh-server build-essential
+d-i pkgsel/include string openssh-server
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
-#d-i pkgsel/upgrade select none
+d-i pkgsel/upgrade select full-upgrade
# Some versions of the installer can report back on what software you have
# installed, and what software you use. The default is not to report back,
@@ -348,7 +348,7 @@
# reboot into the installed system.
#d-i debian-installer/exit/halt boolean true
# This will power off the machine instead of just halting it.
-#d-i debian-installer/exit/poweroff boolean true
+d-i debian-installer/exit/poweroff boolean true
### Preseeding other packages
# Depending on what software you choose to install, or if things go wrong
你只需要在安装程序菜单中选择“高级选项”的“自动安装”,然后按Tab键将url=http://example.com/path/to/preseed这样的引导选项添加,并启动即可。