# More than one file can be listed, separated by spaces; all will be
# loaded. The included files can have preseed/include directives of their
# own as well. Note that if the filenames are relative, they are taken from
# the same directory as the preconfiguration file that includes them.
 d-i preseed/include string stretch.conf

# This is how to make the installer shutdown when finished, but not
# 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

# Okay, so perhaps we should just debootstrap... but preseeds are a bit more
# portable and I happened to have a lot of infra invested in preseed approach.
d-i preseed/early_command string echo 'while [ ! -f /var/lib/dpkg/info/partman-base.postinst ]; do sleep 1; done; cat /tmp/dis_pm > /var/lib/dpkg/info/partman-base.postinst' > /kill-partman.sh && \
    echo "sh -c ' \
        mkdir -p /target && \
        modprobe ext3 && \
	mkfs.ext3 /dev/xvda -F && \
	mkswap /dev/xvdb && \
        mount -t ext3 /dev/xvda /target && \
        mkdir /target/etc && \
        mount && \
        echo \"/dev/xvda / ext3 defaults 0 1\" > /target/etc/fstab && \
        echo \"/dev/xvdb none swap sw 0 0\" >> /target/etc/fstab' \
        >/tmp/kill-partman-stage2.log 2>&1" > /tmp/dis_pm && \
    sh /kill-partman.sh >/tmp/kill-partman.log 2>&1 &

