[Bug 1060404] Re: update-grub runs and fails in containers

Andreas Hasenack andreas at canonical.com
Tue Jan 22 13:24:16 UTC 2013


Output when NOT running on LXC (a linode machine in this case):
(...)
Preparing to replace grub-pc 1.99-21ubuntu3.7 (using .../grub-pc_1.99-21ubuntu3.8_i386.deb) ...
Unpacking replacement grub-pc ...
Preparing to replace grub-pc-bin 1.99-21ubuntu3.7 (using .../grub-pc-bin_1.99-21ubuntu3.8_i386.deb) ...
Unpacking replacement grub-pc-bin ...
Preparing to replace grub2-common 1.99-21ubuntu3.7 (using .../grub2-common_1.99-21ubuntu3.8_i386.deb) ...
Unpacking replacement grub2-common ...
Preparing to replace grub-common 1.99-21ubuntu3.7 (using .../grub-common_1.99-21ubuntu3.8_i386.deb) ...
Unpacking replacement grub-common ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Processing triggers for ureadahead ...
Setting up grub-common (1.99-21ubuntu3.8) ...
Setting up grub2-common (1.99-21ubuntu3.8) ...
Setting up grub-pc-bin (1.99-21ubuntu3.8) ...
Setting up grub-pc (1.99-21ubuntu3.8) ...
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-36-virtual
Found initrd image: /boot/initrd.img-3.2.0-36-virtual
Found linux image: /boot/vmlinuz-3.2.0-35-virtual
Found initrd image: /boot/initrd.img-3.2.0-35-virtual
done
root at ls3-precise:~# echo $?
0
root at ls3-precise:~# which running-in-container
/bin/running-in-container
root at ls3-precise:~# running-in-container
root at ls3-precise:~# echo $?
1
root at ls3-precise:~#

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1060404

Title:
  update-grub runs and fails in containers

Status in “grub2” package in Ubuntu:
  Fix Released
Status in “lxc” package in Ubuntu:
  Fix Released
Status in “grub2” source package in Precise:
  Fix Committed
Status in “lxc” source package in Precise:
  Triaged
Status in “grub2” source package in Quantal:
  Fix Released
Status in “lxc” source package in Quantal:
  Fix Released

Bug description:
  [Impact] GRUB upgrades fail in containers.
  [Test Case] Upgrade the grub-pc package in a container.
  [Regression Potential] In itself, this postinst fix should be quite safe.  It's possible it won't solve the whole problem - e.g. linux-image-* upgrades calling update-grub - but I wanted to backport just what was in quantal/raring rather than getting creative in an SRU.

  [XXX edit - removed the SRU justification for lxc part.  The proposed solution
  was not safe, and was undone in a later commit.  devtmpfs cannot be mounted
  in a container, because changes under the container's /dev are then
  reflected in the host's /dev.

  If grub is installed in a container (as happens, for instance, with
  the ubuntu-cloud template) then an update of grub or linux-image will
  cause update-grub to be run.  It tries, finds it can't access the root
  device, fails, and causes the update to fail.

  It would be better for update-grub to detect that it is in a container
  and simply exit 0, so that the apt-get can succeed.  I'm attaching a
  debdiff which does that.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1060404/+subscriptions




More information about the foundations-bugs mailing list