Bug#812574: grub-pc: wants to overwrite admin configuration on each upgrade

Jeroen Dekkers jeroen at dekkers.ch
Tue Oct 9 23:50:33 BST 2018


On Tue, 11 Apr 2017 19:26:44 +0200,
Thorsten Glaser wrote:
> debconf (developer): starting /tmp/grub-pc.config.GkdXih configure 2.02~beta2-36
> debconf (developer): <-- SET grub2/linux_cmdline rootdelay=5 net.ifnames=0 syscall.x32=y vsyscall=emulate kaslr
> debconf (developer): --> 0 value set
> debconf (developer): <-- SET grub2/linux_cmdline_default
> debconf (developer): --> 0 value set
> debconf (developer): <-- SET grub-pc/timeout 4
> debconf (developer): --> 0 value set
> debconf (developer): <-- INPUT medium grub2/linux_cmdline
> debconf (developer): --> 30 question skipped
> debconf (developer): <-- INPUT medium grub2/linux_cmdline_default
> debconf (developer): --> 30 question skipped
> debconf (developer): <-- GO
> debconf (developer): --> 0 ok

Here grub-pc.config parses /etc/default/grub and sets grub-pc/timeout
to 4.

> debconf (developer): starting /var/lib/dpkg/info/grub-pc.postinst configure 2.02~beta2-36
> debconf (developer): <-- GET grub2/linux_cmdline
> debconf (developer): --> 0 rootdelay=5 net.ifnames=0 syscall.x32=y vsyscall=emulate kaslr
> debconf (developer): <-- GET grub2/linux_cmdline_default
> debconf (developer): --> 0
> debconf (developer): <-- GET grub-pc/timeout
> debconf (developer): --> 0 4
> debconf (developer): <-- GET grub-pc/hidden_timeout
> debconf (developer): --> 0 false
> ucf: The new file is /tmp/grub.ePz0QM4HXU
> ucf: The Destination file is /etc/default/grub
> ucf: The Source directory is /tmp
> ucf: The State directory is /var/lib/ucf
> ucf: The md5sum is found here is /usr/share/grub/default/grub.md5sum
> The hash file exists
> egrep [[:space:]]\/etc\/default\/grub$ /var/lib/ucf/hashfile
> 2dcf752a6412b128ad753b192aaa39ba  /etc/default/grub
> The new start file is      `/tmp/grub.ePz0QM4HXU\'
> The destination is         `/etc/default/grub\' (`\/etc\/default\/grub\')
> The history is kept under  \'/tmp\'
> The file may be cached at \'/var/lib/ucf/cache/:etc:default:grub\'
> The destination file exists, and has md5sum:
> 011d1dd794945a8b756d52be4c8cdc88  /etc/default/grub
> The old md5sum exists, and is:
> 2dcf752a6412b128ad753b192aaa39ba
> The new file exists, and has md5sum:
> 359c3711e747b287ed186472de6b966a  /tmp/grub.ePz0QM4HXU

Here we generate /etc/default/grub based on the values stored by
debconf. The problem is that we just changed grub-pc/timeout and thus
the new file has the new timeout while the old file has the old
timeout and you get the ucf prompt.

I don't really see an easy way to fix this. On the one hand we try to
prevent a prompt on upgrade by parsing the cmdline and timeout, but on
the other hand this causes an ucf prompt on the next upgrade if there
were also other changes made. This would only happen once after one of
the variables are changed and debconf is updated and not on each
upgrade as the original bug report claimed.


Kind regards,

Jeroen Dekkers



More information about the Pkg-grub-devel mailing list