# Debian squeeze server preseed file - to automate this, at boot:
# install auto=true priority=critical preseed/url=http://DOMAIN.COM/path/preseed.cfg
#
### Localization
d-i debian-installer/language string zh_CN
d-i debian-installer/country string CN
d-i debian-installer/locale string zh_CN.UTF-8
# Keyboard selection.
d-i console-keymaps-at/keymap select us
d-i keyboard-configuration/xkb-keymap select us
### Network configuration
# 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/choose_interface select auto
d-i netcfg/dhcp_timeout string 60
d-i netcfg/get_hostname string u-nas
d-i netcfg/get_domain string u-nas
# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.
d-i hw-detect/load_firmware boolean true
### Mirror settings
d-i mirror/country string manual
#d-i mirror/http/hostname string mirrors.163.com
d-i mirror/http/hostname string ftp.tw.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# Suite to install.
d-i mirror/suite string squeeze
### Account setup
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
### create a password with `printf "r00tme" | mkpasswd -s -m md5`
d-i passwd/root-password password yutech
d-i passwd/root-password-again password yutech
#d-i passwd/root-password-crypted password $1$ZgNbzcXq$hUR0CnHVtYAvNNNnA2.br1
# To create a normal user account.[u-nas admin account]
d-i passwd/user-fullname string U-NAS admin
d-i passwd/username string admin
# Normal user's password, either in clear text
d-i passwd/user-password password password
d-i passwd/user-password-again password password
### Clock and time zone setup
d-i clock-setup/utc boolean true
#d-i time/zone string US/Eastern
d-i time/zone string Aisa/Shanghai
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string 0.debian.pool.ntp.org
### Partitioning
d-i partman/early_command string \
usb_rom=$(mount |grep "iso9660"|cut -d " " -f1 |sed 's#/dev/##'|sed 's#[0-9]$##');\
sys_disk=$(ls /var/lib/partman/device/ |grep -v $usb_rom|sed 's#=#/#g');\
debconf-set partman-auto/disk $sys_disk;
#d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
#d-i partman-auto/purge_lvm_from_device boolean true
#d-i partman-lvm/device_remove_lvm boolean true
#d-i partman-md/device_remove_md boolean true
#d-i partman-lvm/confirm boolean true
#d-i partman-auto/choose_recipe select atomic
d-i partman-basicfilesystems/no_swap boolean false
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/expert_recipe string \
boot-root ::\
2000 50 -1 ext4 \
$primary{ } $bootable{ } \
$linux-swap{ } method{ format } \
detected_filesystem{ ext4 } format{ }\
use_filesystem{ ext4 } filesystem{ ext4 } \
mountpoint{ / } \
.
# boot-root :: \
# 50 60 100 ext4 \
# $primary{ } \
# $bootable{ } \
# method{ format } \
# format{ } \
# use_filesystem{ } filesystem{ ext4 } \
# mountpoint{ /boot } \
# . \
# 40 10000 1000000000 ext4 \
# $primary{ } \
# $bootable{ } \
# method{ format } format{ } \
# default_filesystem{ ext4 } \
# use_filesystem{ ext4 } filesystem{ ext4 } \
# mountpoint{ / } \
# . \
# 30 512 200% linux-swap \
# $primary{ } \
# method{ swap } format{ } \
# .
# The full recipe format is documented in the file partman-auto-recipe.txt
# included in the 'debian-installer