Commit e4e7c3fa authored by Colin Watson's avatar Colin Watson

Avoid spurious ucf prompts

Keep track of the previous version of /usr/share/grub/default/grub and
set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
can't figure this out for itself since we apply debconf-based
customisations on top of the template configuration file.

Closes: #812574
LP: #564853
parent 4133b434
......@@ -5,6 +5,11 @@ grub2 (2.02+dfsg1-10) UNRELEASED; urgency=medium
- grub-core/loader/efi/fdt.c: do not copy random memory
* Add luks modules to signed UEFI images (pointed out by Alex Griffin and
Hervé Werner; closes: #908162, LP: #1565950).
* Keep track of the previous version of /usr/share/grub/default/grub and
set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
can't figure this out for itself since we apply debconf-based
customisations on top of the template configuration file (closes:
#812574, LP: #564853).
-- Colin Watson <cjwatson@debian.org> Fri, 21 Dec 2018 21:20:48 +0000
......
......@@ -385,7 +385,19 @@ case "$1" in
;;
esac
ucf --three-way --debconf-ok --sum-file=/usr/share/grub/default/grub.md5sum ${tmp_default_grub} /etc/default/grub
# If the template configuration file hasn't changed, then no conflict is
# possible. ucf can't figure this out for itself since we apply
# debconf-based customisations on top of the template configuration
# file.
if [ -e /var/lib/grub/ucf/grub.previous ] && \
cmp -s /usr/share/grub/default/grub /var/lib/grub/ucf/grub.previous; then
ucf_env=UCF_FORCE_CONFFOLD=1
else
ucf_env=
fi
env $ucf_env ucf --three-way --debconf-ok --sum-file=/usr/share/grub/default/grub.md5sum "$tmp_default_grub" /etc/default/grub
cp -a /usr/share/grub/default/grub /var/lib/grub/ucf/grub.previous
package="$(ucfq --with-colons /etc/default/grub | cut -d : -f 2)"
if echo $package | grep -q "^grub-" ; then
ucfr --force @PACKAGE@ /etc/default/grub
......
......@@ -11,6 +11,7 @@ case "$1" in
if which ucfr >/dev/null ; then
ucfr --purge @PACKAGE@ /etc/default/grub || true
fi
rm -f /var/lib/grub/ucf/grub.previous
case @PACKAGE@ in
grub-pc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment