When zeroing debconf value, I was able to see that grub-installer populates it again (grub-installer/bootdev with the wrong value "/dev/mapper"). The code that db_sets it again is:
elif [ "$(device_to_disk "$cdsrc")" = "$default_bootdev" ] || \ ([ -n "$hdsrc" ] && [ "$(device_to_disk "$hdsrc")" = "$default_bootdev" ]) || \ ([ "$default_bootdev" = '(hd0)' ] && \ (([ -n "$cdfs" ] && [ "$cdfs" != "iso9660" ]) || \ [ "$hybrid" = true ])) || \ ([ "$default_bootdev" != '(hd0)' ] && \ ! partmap "$default_bootdev" >/dev/null && \ ! grub_probe -t fs -d "$default_bootdev" >/dev/null); then db_fget grub-installer/bootdev seen if [ "$RET" != true ]; then bootfs=$(findfs /boot) [ "$bootfs" ] || bootfs="$(findfs /)" disk=$(device_to_disk "$bootfs") db_set grub-installer/bootdev "$disk" ---------- HERE state=2 fi fi ;;
When zeroing debconf value, I was able to see that grub-installer populates it again (grub-installer /bootdev with the wrong value "/dev/mapper"). The code that db_sets it again is:
elif [ "$(device_to_disk "$cdsrc")" = "$default_bootdev" ] || \ bootdev seen
bootfs= $(findfs /boot)
disk= $(device_ to_disk "$bootfs") bootdev "$disk" ---------- HERE
([ -n "$hdsrc" ] && [ "$(device_to_disk "$hdsrc")" = "$default_bootdev" ]) || \
([ "$default_bootdev" = '(hd0)' ] && \
(([ -n "$cdfs" ] && [ "$cdfs" != "iso9660" ]) || \
[ "$hybrid" = true ])) || \
([ "$default_bootdev" != '(hd0)' ] && \
! partmap "$default_bootdev" >/dev/null && \
! grub_probe -t fs -d "$default_bootdev" >/dev/null); then
db_fget grub-installer/
if [ "$RET" != true ]; then
[ "$bootfs" ] || bootfs="$(findfs /)"
db_set grub-installer/
state=2
fi
fi
;;