I'm doing a preseeded installation that involves displaying debconf
INFO messages right inside the debian installer. At the end of the late_command, I'm expecting the system to eject the installation cdrom, and reboot my instance. The problem is that instead of behaving this way, it gets back to the debian installer menu, and to finish the installation process it leaves me only the option to manually shutdown and to boot from the disk in order to eject the installation cdrom.
It's important to precise that this unexpected behavior only appeared when I started using debconf INFO
messages (it was working as expected before, so the preseed.cfg
is normally properly configured), it's thus directly related to it.
Below are the following : My late_command part
, the script that is launched by the late_command
which involves debconf
, the syslog
when the installation finishes,es and the screen in which I'm led back.
late_command
:
d-i preseed/late_command string \
cp -rf /cdrom/build /target/home/device; \
/bin/sh /target/home/machine/build/deployment-preseed-track.sh; \
chmod +x /target/home/machine/build/deployment-preseed.sh; \
in-target --pass-stdout ./home/machine/build/deployment-preseed.sh > /target/var/log/installation.log; \
in-target rm -rf /home/machine/build;
deployment-preseed-track.sh
(It basically scans lively the log to detect the deployment progress)
#!/bin/sh
. /usr/share/debconf/confmodule
. "/home/machine/build/variables.sh"
logFile="/target${INSTALLATION_LOG_LOCATION}"
templatePath="/target/tmp/deployment_progress_tracker.templates"
cat > "${templatePath}" << 'EOF'
Template: deployment_progress_tracker/progress/fallback
Type: text
Description: ${STEP}...
EOF
debconf-loadtemplate deployment_progress_tracker "${templatePath}"
db_progress START 0 1 deployment_progress_tracker/progress
watchLogs () {
deploymentDone=false
while ! $deploymentDone
do
if [ -f "${logFile}" ]; then
step=$(grep -E -o -a -h "Progress-step: .*" "${logFile}" | tail -1 | sed 's/Progress-step: //')
if [ -z "${step##*$DEPLOYMENT_FINISHED*}" ]; then
deploymentDone=true
elif [ -n "${step}" ]; then
db_subst deployment_progress_tracker/progress/fallback STEP "${step}"
db_progress INFO deployment_progress_tracker/progress/fallback
fi
fi
sleep 3
done
}