# Disable framebuffer, it's usually slower, especially on VMs
d-i debian-installer/framebuffer boolean false

# Locale, language and country
d-i debconf/language string en_US:en
d-i debian-installer/country string NO
d-i debian-installer/language string en_US:en
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/preferred-locale string en_US.UTF-8
d-i localechooser/supported-locales en_US.UTF-8, nb_NO.UTF-8

# Keyboard selection
d-i keyboard-configuration/layoutcode string no
d-i keyboard-configuration/variantcode string 

# Controls whether or not the hardware clock is set to UTC
d-i clock-setup/utc boolean true
# 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 Europe/Oslo
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true

# Skip creation of a root account (normal user account will be able to
# use sudo). The default is false; preseed this to true if you want to set
# a root password.
d-i passwd/root-login boolean true
# Root password, either in clear text
#d-i passwd/root-password password r00tme
#d-i passwd/root-password-again password r00tme
# or encrypted using an MD5 hash.
d-i passwd/root-password-crypted password $1$92PDztZI$asdkfljhasdf2UR8il9Lz0
# To create a normal user account.
d-i passwd/user-fullname string Robin Smidsrød
d-i passwd/username string robin
# Normal user's password, either in clear text
#d-i passwd/user-password password insecure
#d-i passwd/user-password-again password insecure
# or encrypted using an MD5 hash.
d-i passwd/user-password-crypted password $1$92PDztZI$OnXkjhasdfuweu2UR8il9Lz0
# Do not encrypt home directory
d-i user-setup/encrypt-home boolean false

# If you select ftp, the mirror/country string does not need to be set
# Location: http://boot.smidsrod.lan/ubuntu-12.04-server-amd64/
d-i mirror/protocol string http
d-i mirror/country string manual
d-i mirror/http/hostname string boot.smidsrod.lan
d-i mirror/http/directory string /ubuntu-12.04-server-amd64
d-i mirror/http/proxy string
# Suite to install
d-i mirror/suite string precise
# Suite to use for loading installer components (optional)
d-i mirror/udeb/suite string precise
# Components to use for loading installer components (optional)
d-i mirror/udeb/components multiselect main, restricted

# The kernel image (meta) package to be installed; "none" can be used if no
# kernel is to be installed.
d-i base-installer/kernel/image string linux-generic

# Disk setup (partman)
# Suppress question if it is okay to not have swap
# We don't use disk for swap on iSCSI, we have enough memory
d-i partman-basicfilesystems/no_swap boolean false

# Package selection
tasksel tasksel/first multiselect openssh-server
# Individual additional packages to install
d-i pkgsel/include string build-essential ntp
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade string full-upgrade
# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
d-i pkgsel/update-policy string unattended-upgrades
# Install language packs for apps
d-i pkgsel/install-language-support boolean true
# By default, the system's locate database will be updated after the
# installer has finished installing most packages. This may take a while, so
# if you don't want it, you can set this to "false" to turn it off.
d-i pkgsel/updatedb boolean true

# 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,
# but sending reports helps the project determine what software is most
# popular and include it on CDs.
popularity-contest popularity-contest/participate boolean true

# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
# This one makes grub-installer NOT install to the MBR if it also finds some other
# OS, which is less safe as it might not be able to boot that other OS.
d-i grub-installer/with_other_os boolean false

# This will prevent the installer from ejecting the CD during the reboot,
# which is useful in some situations.
d-i cdrom-detect/eject boolean false

# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.

# Fix broken resolvconf setup
# Change apt to use public mirror and refresh apt database
# Set proper initator IQN and remove quiet flag in grub
# Update grub
d-i preseed/late_command string \
 in-target mv /etc/resolvconf/resolv.conf.d/original /etc/resolvconf/resolv.conf.d/tail; \
 in-target sed -i -e 's/http:\/\/boot.smidsrod.lan\/ubuntu-12.04-server-amd64/http:\/\/no.archive.ubuntu.com\/ubuntu/' /etc/apt/sources.list; \
 in-target apt-get -qq update; \
 apt-install joe; \
 in-target sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/' /etc/default/grub; \
 in-target sed -i -e 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"iscsi_initiator=iqn.2011-02.lan.smidsrod:$(hostname)\"/' /etc/default/grub; \
 in-target update-grub;
