[Bug 1104463] Re: /etc/kernel/postinst.d/zz-update-grub triggers a grub update in lxc containers

Adam Conrad adconrad at 0c3.net
Thu Jan 24 21:33:59 UTC 2013


1. Patching zz-update-grub is almost certainly the wrong answer, as
manual runs of update-grub(1) or, indeed, anything else that might call
it that we've not noticed yet, will show exactly the same issue.

2. Exiting update-grub 0 on containers seems like a sane workaround, but
probably long-term silly.  And workarounds often end up as long-term
tech debt.

3. Fixing it somehow magically in grub-probe sounds appealing, until we
realise that there'd be no way for grub-probe to tell update-grub "well,
I looked, but couldn't find anything useful for you" without either
exiting non-zero (which is exactly what it does right now) or returning
completely bogus info for you to later write to you grub config (ewww).

Given the above, the second option seems the simplest and sanest for
now, with an enormous FIXME comment on it, mentioning that lxc is meant
to get device namespaces "some day", and when that happens, this can
probably be revisited.  Thoughts?

-- 
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/1104463

Title:
  /etc/kernel/postinst.d/zz-update-grub triggers a grub update in lxc
  containers

Status in “grub2” package in Ubuntu:
  New

Bug description:
  Before anyone points it out, this is NOT a duplicate of bug 1060404,
  just a different but extremely similar problem :)

  So I'm doing 12.10 => 13.04 desktop upgrade testing in a container.
  That means setting up a full dekstop 12.10 system, including grub and
  kernel, then dist-upgrading that to 13.04.

  In the past, this used to fail because of bug 1060404 but now that it's been fixed, I'm getting into a different problem bcause of zz-update-grub calling update-grub, bypassing the check added to grub's postinst and causing a similar error:
  ===
  Setting up linux-image-3.8.0-1-generic (3.8.0-1.5) ...
  Running depmod.
  update-initramfs: deferring update (hook will be called later)
  Examining /etc/kernel/postinst.d.
  run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-1-generic /boot/vmlinuz-3.8.0-1-generic
  run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-1-generic /boot/vmlinuz-3.8.0-1-generic
  update-initramfs: Generating /boot/initrd.img-3.8.0-1-generic
  cryptsetup: WARNING: could not determine root device from /etc/fstab
  run-parts: executing /etc/kernel/postinst.d/pm-utils 3.8.0-1-generic /boot/vmlinuz-3.8.0-1-generic
  run-parts: executing /etc/kernel/postinst.d/update-notifier 3.8.0-1-generic /boot/vmlinuz-3.8.0-1-generic
  run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.8.0-1-generic /boot/vmlinuz-3.8.0-1-generic
  /usr/sbin/grub-probe: error: failed to get canonical path of /dev/mapper/castiana-home.
  run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
  Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-1-generic.postinst line 1010.
  dpkg: error processing linux-image-3.8.0-1-generic (--configure):
   subprocess installed post-installation script returned error exit status 2
  No apport report written because MaxReports is reached already
  dpkg: dependency problems prevent configuration of linux-image-extra-3.8.0-1-generic:
   linux-image-extra-3.8.0-1-generic depends on linux-image-3.8.0-1-generic; however:
    Package linux-image-3.8.0-1-generic is not configured yet.

  dpkg: error processing linux-image-extra-3.8.0-1-generic (--configure):
   dependency problems - leaving unconfigured
  No apport report written because MaxReports is reached already
  dpkg: dependency problems prevent configuration of linux-image-generic:
   linux-image-generic depends on linux-image-3.8.0-1-generic; however:
    Package linux-image-3.8.0-1-generic is not configured yet.
   linux-image-generic depends on linux-image-extra-3.8.0-1-generic; however:
    Package linux-image-extra-3.8.0-1-generic is not configured yet.

  dpkg: error processing linux-image-generic (--configure):
   dependency problems - leaving unconfigured
  dpkg: dependency problems prevent configuration of linux-generic:
   linux-generic depends on linux-image-generic (= 3.8.0.1.14); however:No apport report written because MaxReports is reached already

    Package linux-image-generic is not configured yet.

  dpkg: error processing linux-generic (--configure):
   dependency problems - leaving unconfigured
  No apport report written because MaxReports is reached already
  Errors were encountered while processing:
   linux-image-3.8.0-1-generic
   linux-image-extra-3.8.0-1-generic
   linux-image-generic
   linux-generic
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  ===

  Proposed ways of fixing this as discussed in #ubuntu-devel include:
   - Make update-grub exit 0 if running-in-container returns 0
   - Patch just zz-update-grub with a similar check
   - Make the scripts check for the presence of the device and only then attempt to read/write to it (but limit that check to containers)

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




More information about the foundations-bugs mailing list