<%#
kind: ptable
name: Preseed default
oses:
- Debian 6.0
- Debian 7.
- Debian 8.
- Ubuntu 10.04
- Ubuntu 12.04
- Ubuntu 13.04
- Ubuntu 14.04
%>
<%
  partitioning_method = @host.params['partitioning-method'] ? @host.params['partitioning-method'] : 'regular'
  partitioning_recipe = @host.params['partitioning-recipe'] ? @host.params['partitioning-recipe'] : 'atomic'
  partitioning_expert_recipe = @host.params['partitioning-expert-recipe'] ? @host.params['partitioning-expert-recipe'] : ''
  vg_name = @host.params['partitioning-vg-name'] ? @host.params['partitioning-vg-name'] : ''
  partitioning_filesystem = @host.params['partitioning-filesystem'] ? @host.params['partitioning-filesystem'] : ''
-%>

<% if @host.params['install-disk'] -%>
d-i partman-auto/disk string <%= @host.params['install-disk'] %>
<% else -%>
d-i partman-auto/disk string /dev/sda /dev/vda /dev/xvda
<% end -%>

### Partitioning
# The presently available methods are: "regular", "lvm" and "crypto"
d-i partman-auto/method string <%= partitioning_method %>

# 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
# The same applies to pre-existing software RAID array:
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

<% if partitioning_method == 'lvm' -%>
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
<% if vg_name != '' -%>
d-i partman-auto-lvm/new_vg_name string <%= vg_name %>
<% end -%>
<% end -%>

# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /var, and /tmp partitions (/usr was removed in jessie)
d-i partman-auto/choose_recipe select <%= partitioning_recipe %>

<% if partitioning_expert_recipe != '' -%>
# Or provide a recipe of your own...
# If you have a way to get a recipe file into the d-i environment, you can
# just point at it.
d-i partman-auto/expert_recipe string \
<%= partitioning_expert_recipe.gsub(/$/, " \\") %>

<% end -%>

# If you just want to change the default filesystem to something
# else, you can do that without providing a full recipe.
<% if partitioning_filesystem != '' -%>
d-i partman/default_filesystem string <%= partitioning_filesystem %>
<% end -%>

# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/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
