Comment 5 for bug 1891680

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

First point => yes

Second point => mostly yes, but I am not sold on having it a must in preinst. dpkg-reconfigure does not call preinst, it only calls "prerm config postinst", and we must have the same checks and error recovery in postinst. (Because things can change between preinst and postinst, and/or fail to apply).

Third point => it is slightly more elaborate. Even when asking grub-install to not install any modules, or bootcode, the following files are still updated none-the-less

grub-install: info: copying `/usr/lib/grub/i386-pc/efiemu32.o' -> `/mnt/boot/grub/i386-pc/efiemu32.o'.
grub-install: info: copying `/usr/lib/grub/i386-pc/efiemu64.o' -> `/mnt/boot/grub/i386-pc/efiemu64.o'.
grub-install: info: copying `/usr/lib/grub/i386-pc/moddep.lst' -> `/mnt/boot/grub/i386-pc/moddep.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/command.lst' -> `/mnt/boot/grub/i386-pc/command.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/fs.lst' -> `/mnt/boot/grub/i386-pc/fs.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/partmap.lst' -> `/mnt/boot/grub/i386-pc/partmap.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/parttool.lst' -> `/mnt/boot/grub/i386-pc/parttool.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/video.lst' -> `/mnt/boot/grub/i386-pc/video.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/crypto.lst' -> `/mnt/boot/grub/i386-pc/crypto.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/terminal.lst' -> `/mnt/boot/grub/i386-pc/terminal.lst'.
grub-install: info: copying `/usr/lib/grub/i386-pc/modinfo.sh' -> `/mnt/boot/grub/i386-pc/modinfo.sh'.
grub-install: info: copying `/usr/share/grub/unicode.pf2' -> `/mnt/boot/grub/fonts/unicode.pf2'.
grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '(,msdos1)/boot/grub' --output '/mnt/boot/grub/i386-pc/core.img' --dtb '' --format 'i386-pc' --compression 'auto' 'ext2' 'part_msdos' 'biosdisk'
grub-install: info: copying `/usr/lib/grub/i386-pc/boot.img' -> `/mnt/boot/grub/i386-pc/boot.img'

And for example since we do not provide prebuild core.img it needs to be generated somewhere first before applying it to the MBR.

grub-install only takes one device at the time. So I'm not sure what to do with updating modules, if multiple devices need MBR updates, all exist, yet some of them fail to apply MBR. I feel like erroring on the optimistic side, if at least one MBR update was successful, update the modules.

What can be achieved, with very minimal amount of code is to separate bootcode updates from the /boot/ modules updates. And if any bootcode updates are successful, only then attempt to install modules.