dpkg-divert grub-probe binary to avoid problems in OpenVZ environments
authorMichael Prokop <mika@grml.org>
Mon, 27 Aug 2012 18:20:55 +0000 (20:20 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 27 Aug 2012 18:20:55 +0000 (20:20 +0200)
commitc92e94e88fb89eefe6806a278a5b4c43f5ab08d4
tree0bb152ad96abb0016fa940d777f7b5261f2355a4
parent2519a4ebfba89144f847f0b48d3bd90881fdb347
dpkg-divert grub-probe binary to avoid problems in OpenVZ environments

It's a hard to debug problem as it doesn't seem to be
reproducible in every OpenVZ environment and on the other hand
makes the system unusable as soon as the bug is triggered. :(

On the command line/in the logs you'll notice something like
that before the system is becoming unuseable:

| Setting up grub-common (1.99-22.1) ...
| Setting up grub2-common (1.99-22.1) ...
| Setting up grub-pc-bin (1.99-22.1) ...
| Setting up grub-pc (1.99-22.1) ...
|
| Creating config file /etc/default/grub with new version
| grub-probe: error: cannot find a device for / (is /dev mounted?).
| grub-probe: error: cannot find a device for /boot (is /dev mounted?).
| grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

To avoid grub-probe being executed during software installation
let's dpkg-divert the binary during the FAI dirinstall process
through the existing hook script instsoft.GRMLBASE. Then revert
the dpkg-divert via scripts/GRMLBASE/98-clean-chroot before
actually building the ISO again.

While at it also divert update-grub in the same code path as
well.
etc/grml/fai/config/hooks/instsoft.GRMLBASE
etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot