I discovered this bug on my systems this morning, and did a bunch of
digging trying to figure out what's happening. I'm no expert at debian-
installer, but I think what's happening is due to the cdebconf->debconf
transition that happens early in the installation.

When the installer first starts, it's using cdebconf, rather than debconf, with 
the database stored in /var/lib/cdebconf/questions.dat. This database is 
populated by /lib/debian-installer-startup.d/S35initrd-preseed before anything 
is installed:
Jul  7 14:32:17 preseed: successfully loaded preseed file from 
file:///preseed.cfg

However, during the first batch of installs, the real debconf gets configured 
just before dash:
Jul  7 14:33:54 debootstrap: Setting up debconf (1.5.20) ...
Jul  7 14:33:55 debootstrap: 
Jul  7 14:33:55 debootstrap: Setting up dash (0.5.4-8ubuntu1) ...
Jul  7 14:33:55 debootstrap: Adding `diversion of /bin/sh to /bin/sh.distrib by 
dash'
Jul  7 14:33:55 debootstrap: Adding `diversion of /usr/share/man/man1/sh.1.gz 
to /usr/share/man/man1/sh.distrib.1.gz by dash'

Then, later on the preseed gets re-read to populate the "real" debconf database 
in /var/cache/debconf/config.dat (I'm not sure of the exact mechanism of how 
this happens):
Jul  7 14:34:11 preseed: perl: warning: Setting locale failed.
Jul  7 14:34:11 preseed: perl: warning: Please check that your locale settings:
Jul  7 14:34:11 preseed: ^ILANGUAGE = (unset),
Jul  7 14:34:11 preseed: ^ILC_ALL = (unset),
Jul  7 14:34:11 preseed: ^ILANG = "C.UTF-8"
Jul  7 14:34:11 preseed:     are supported and installed on your system.
Jul  7 14:34:11 preseed: perl: warning: Falling back to the standard locale ("C"
).
Jul  7 14:34:11 preseed: locale: Cannot set LC_CTYPE to default locale
Jul  7 14:34:11 preseed: : No such file or directory
Jul  7 14:34:11 preseed: locale: Cannot set LC_MESSAGES to default locale: No su
ch file or directory
Jul  7 14:34:11 preseed: 
Jul  7 14:34:11 preseed: locale: Cannot set LC_ALL to default locale: No such fi
le or directory
Jul  7 14:34:11 preseed:

So, it looks like the dash postinst is being run during the interval
between the switch from cdebconf to debconf, but before the preseed is
re-read. So, the dash postinst never sees the false dash/sh setting
provided in the preseed.

The only "fix" I could imagine would be something in debconf's postinst
that detected whether it was being run in d-i and, if so, calling
whatever the mechanism is in the second case above to re-read the
preseed file.

Hopefully this will provide some clues for someone who's a little more
knowledgeable about d-i to see if there's a way to fix this.

In the meantime, you should (I haven't tested this yet) be able to work around 
this with a late_command. Something like:
d-i             preseed/late_command            string  in-target 
/var/lib/dpkg/info/dash.postinst

This will just run the dash preseed before reboot, and since at this
point the preseed values are in the regular debconf database, the
postinst will do the "right thing" and remove the symlink diversions.

-- 
can't preseed dash/sh to false
https://bugs.launchpad.net/bugs/105539
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to