Bug#802717: nexpected os-prober when setting up grub in a disk image
Sean Whitton
spwhitton at spwhitton.name
Sun Oct 25 08:40:56 GMT 2026
Joey Hess [22/Oct 4:10pm -04] wrote:
> Package: grub-pc
> Version: 2.02~beta2-28
> Severity: normal
>
> I'm creating a disk image, which I want to be bootable using grub.
> Unexpectedly, update-grub runs os-prober which probes the host system
> and adds unwanted entries for it.
>
> In the transcript below, /mnt is a loop mounted filesystem from my disk image.
> I used kpartx to set up the loop device for the partition inside the disk image.
>
> I bind mount /dev from the host system because this seems to be
> necessary to let update-grub figure out that it's being run in a disk
> image (by giving it access to /dev/mapper etc).
> (Also because vmdebootstrap does it..)
>
> root at darkstar:/mnt>mount --bind /dev dev
> root at darkstar:/mnt>chroot .
> root at darkstar:/# mount -t sysfs sys /sys
> root at darkstar:/# mount -t proc proc /proc
> root at darkstar:/# update-grub
> Generating grub configuration file ...
> Found linux image: /boot/vmlinuz-4.2.0-1-amd64
> Found initrd image: /boot/initrd.img-4.2.0-1-amd64
> Found Windows 8 (loader) on /dev/sda2
> Found Debian GNU/Linux (stretch/sid) on /dev/sda3
> done
> root at darkstar:/mnt>grub-install /dev/loop2
> Installing for i386-pc platform.
> Installation finished. No error reported.
>
> The result is, grub boots fine using this disk image, but the menu has
> unexpected entries, from os-prober, for the system where it was built.
>
> I think the only reason that vmdebootstrap images don't experience this
> problem is because it doesn't install os-prober by default. However, I'd
> like to include os-prober on my image, if possible.
>
> Could the os-prober hook perhaps notice when the root is a loopback
> image, and avoid probing the host system?
os-prober is off by default now, for exactly this reason, so I think
this bug should probably be closed.
--
Sean Whitton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 869 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20261025/a84d8ed4/attachment.sig>
More information about the Pkg-grub-devel
mailing list