grub-probe fails when generating initrd

Bug #956495 reported by Pascal de Bruijn
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Customization Kit
Fix Released
Undecided
Unassigned

Bug Description

When running apt-get update apt-get dist-upgrade in the UCK Terminal, the kernel do not install properly because of grub-probe:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-3.2.0-18-generic (3.2.0-18.29) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-18-generic /boot/vmlinuz-3.2.0-18-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-18-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-18-generic /boot/vmlinuz-3.2.0-18-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-18-generic /boot/vmlinuz-3.2.0-18-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-18-generic /boot/vmlinuz-3.2.0-18-generic
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
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.2.0-18-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-18-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-18-generic; however:
  Package linux-image-3.2.0-18-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.2.0.18.20); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                                              Errors were encountered while processing:
 linux-image-3.2.0-18-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Related branches

Revision history for this message
Fabrizio Balliano (fabrizio-balliano) wrote :

it wasn't happening to me anyway I deactivated grub-probe during the chroot processes so it shouldn't happen ever. if it is possible if would be great if you could try agains uck 2.4.6 svn.
thank you!

Changed in uck:
status: New → Fix Committed
Changed in uck:
status: Fix Committed → Fix Released
Revision history for this message
Märt Põder (boamaod) wrote :

Still having a very similar bug when building from Ubuntu 12.04

Setting up linux-image-3.2.0-24-generic-pae (3.2.0-24.39) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-23-generic-pae
The link /vmlinuz is a dangling linkto /boot/vmlinuz-3.2.0-23-generic-pae
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-24-generic-pae /boot/vmlinuz-3.2.0-24-generic-pae
update-initramfs: Generating /boot/initrd.img-3.2.0-24-generic-pae
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-24-generic-pae /boot/vmlinuz-3.2.0-24-generic-pae
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-24-generic-pae /boot/vmlinuz-3.2.0-24-generic-pae
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-24-generic-pae /boot/vmlinuz-3.2.0-24-generic-pae
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
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.2.0-24-generic-pae.postinst line 1010.
dpkg: error processing linux-image-3.2.0-24-generic-pae (--configure):
 subprocess installed post-installation script returned error exit status 2

You can see the full log at http://eb32.povi.ee/images/logs-history/estobuntu-12.04-alpha-gnome-dvd-i686.iso_2012.06.03_03%3a59.53.log

Revision history for this message
Märt Põder (boamaod) wrote :

Oh, I actually tested it with grub-probe deactivator from 2.4.6, relevant log is: http://eb32.povi.ee/images/logs-history/estobuntu-12.04-alpha-gnome-dvd-i686.iso_2012.06.04_06%3a29.07.log

Revision history for this message
Märt Põder (boamaod) wrote :
Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

With uck 2.4.6 this problem still exists:

# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-3.2.0-24-generic (3.2.0-24.39) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-24-generic /boot/vmlinuz-3.2.0-24-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-24-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-24-generic /boot/vmlinuz-3.2.0-24-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-24-generic /boot/vmlinuz-3.2.0-24-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-24-generic /boot/vmlinuz-3.2.0-24-generic
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
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.2.0-24-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-24-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-24-generic; however:
  Package linux-image-3.2.0-24-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.2.0.24.26); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
       No apport report written because the error message indicates its a followup error from a previous failure.
              Errors were encountered while processing:
 linux-image-3.2.0-24-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Reverse applying the above patch seems to resolved the issue at hand.

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Actually this seems only half a fix...

During the image build everything seems fine... However grub-probe is missing from the final live ISO, so installation fails on grub-install (which I'm guessing depends on grub-probe).

There is however /usr/sbin/grub-probe.ucb-blocked (which is symlinked to /bin/true).

Revision history for this message
Fabrizio Balliano (fabrizio-balliano) wrote :

i'm sorry but in your build log you're updating grub... that's a situation uck cannot detect and anyway there's no way we can hook in the debian installer to tell grub not to run its probe (and our blocked binary it's just been overwritten by the upgraded package).

i'm updating the README with this right now:
   5) If you update grub in your chroot environment you can have troubles,
      every software that dialogs with hardware (while installing) could
      can couse troblues and UCK cannot detect or work around this thing.
      grub-probe binary is deactivated (renamed to grub-probe.uck-blocked
      and symlinked to /bin/true) so if you update grub you'll have to take
      care of this, renaming grub-probe to grub-probe.uck-blocked before
      leaving the chrooted environment.
but no fix to be released here.

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Ok, that's understandable.

Please consider putting the grub package on-hold when dropping into a terminal (and unholding it, when exiting a terminal), so the grub package can't be accidentally upgraded (resulting in unexpected breakage).

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Something along these lines:

dpkg -l | grep grub | awk '{print $2 " hold"}' | dpkg --set-selections
dpkg --get-selections | grep hold | sed 's#hold#install#g' | dpkg --set-selections

But even with grub on hold (and not being upgraded), grub-probe is still not being renamed back (though I haven't rechecked with the latest version of uck).

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Here's a patch which seems to work for me.

It holds the grub packages so they can't be accidentally upgraded, making sure nothing gets unintentionally broken.

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

I've pushed a patched package to my PPA:

https://launchpad.net/~pmjdebruijn/+archive/uck-testing

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.