Bug#919029: grub-pc: meaningless message "RUB boot loader was previously installed..."

Colin Watson cjwatson at debian.org
Tue Feb 26 12:44:41 GMT 2019


FWIW, the debconf bug that cut off the message has been fixed (in
1.5.70, although it required a follow-up fix in 1.5.71).

On Sat, Jan 19, 2019 at 11:49:54AM +0100, Vincent Lefevre wrote:
> On 2019-01-12 13:33:35 +0000, Colin Watson wrote:
> > I can see the argument that it might be convenient to have configuration
> > that effectively says "install to this device if it exists, otherwise
> > continue anyway"; but such a configuration may mean that the GRUB image
> > on disk that you might in fact attempt to boot from will end up being
> > incompatible with the rest of /boot/grub/ and thus cause a failure to
> > boot even though the postinst pretended everything is fine!
> > Disregarding this kind of configuration error can have grave
> > consequences of its own.  In any case, even if it might be convenient to
> > have such a configuration, I won't accept that part of the issue as a
> > grave bug.
> 
> I meant that the issue was that the user may not have remember
> or even known where GRUB was installed (this was my case, and
> I could find the information just because I keep track of the
> changes of config.dat). This makes the problem unfixable without
> risking to erase some data.

Of course, the grub-pc maintainer script doesn't know either.  All it
has available to it is a /dev/disk/by-id/ path that no longer points to
a disk.  The case I had in mind when writing that code, and I think
almost certainly the overwhelmingly common case, is where the disk in
question has been removed; the edge case that we have here is where the
disk in question is still installed but its supposedly fixed ID has
changed.

I think what I'm going to do here is as follows: if the answer to
grub-pc/install_devices_disks_changed is empty, then don't copy it to
grub-pc/install_devices (and still do the usual thing of asking if
you're really sure that you don't want to install GRUB to any devices).
This will have the effect that if you don't positively select a new disk
to install to, as in your case, then the old configuration information
will remain untouched and the same question will be asked again the next
time grub-pc is configured.

This isn't completely ideal: it's a little bit hacky, and it would be
nice if the description of grub-pc/install_devices_disks_changed
explained this workflow (but it's really too late to be introducing new
translatable text for buster at this point).  However, it's the best
realistic solution I can think of, it's a pretty small change, and I
expect this edge case to continue to be rare in any event.

Thanks,

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the Pkg-grub-devel mailing list