#!/bin/sh

PREREQ=""
DESCRIPTION="Configuring client-preseed..."
PRESEED_DIR="/root/etc/"
PRESEED_FILE="/root/etc/lliurex.seed"
prereqs()
{
    echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
       prereqs
       exit 0
       ;;
esac

. /scripts/casper-functions

log_begin_msg "$DESCRIPTION"

# If directory is not present, create it!
[ -d "$PRESEED_DIR" ] || mkdir -p "$PRESEED_DIR" 

# Create file wit cateof technology
cat > $PRESEED_FILE <<EOF
#LliureX only locale sets language, country and locale.
d-i keyboard-configuration/modelcode string pc105
d-i keyboard-configuration/layoutcode string es
d-i netcfg/get_hostname string pandora


# (logical) line. This example creates a small /boot partition, suitable
# swap, and uses the rest of the space for the root partition:
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              500 10000 1000000000 ext4                       \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              64 512 300% linux-swap                          \
                      method{ swap } format{ }                \
              .

# If you just want to change the default filesystem from ext3 to something
# else, you can do that without providing a full recipe.
d-i partman/default_filesystem string ext4

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

EOF

log_end_msg
