# Do not work off a debconf-get-selections (--installer) generated 
# preseed.cfg but get the values from it and modify the example preseed 
# file with them.

# In the list of debconf questions you posted, each question with a 
# comment "for internal use" without "can be preseeded" should not be preseeded.

# But a lot of other debconf questions may not be pre-answered with a preseed file, 
# like the hardware-related questions (if you want to run the installation on a 
# different hardware), the questions recording some automatic configuration failure 
# or success (which can be preseeded in some special cases but could without problem 
# be answered with the automatic process).

# The output of debconf-get-selections contains a lot of auto-answered questions most 
# people never see and do (should) not care about. This automatic choices are changing
# over time, with new hardware, software, better detection or new possibilities. 
# It is important to touch the least you can of the automatic configuration, to benefit
# from all the improvements of the debian-installer and to be able to keep to a minimum
# the changes needed to your preseed file over time and for different hardware.

# sudo debconf-get-selections --installer > file.preseed
# debconf: DbDriver "di_questions": could not open 
# /var/log/installer/cdebconf/questions.dat

# This is expected - the desktop installer doesn't use cdebconf during
# installation and doesn't write that file. It might not be desperately
# meaningful even if it did.

file=/var/tmp/automate/debconf-preseed.cfg

echo "#_preseed_V1" > $file
debconf-get-selections --installer >> $file
debconf-get-selections >> $file
