[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#780115: grub-installer: fails on multi-device btrfs, zfs

Package: grub-installer
Version: 1.112
Severity: important
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
X-Debbugs-Cc: debian-bsd@lists.debian.org


A section of code in grub-installer (dating back to lilo-installer)
assumes that `grub-probe -t device` or 'findfs' returns only one device.
Otherwise it fails with:
    Wrong number of args: mapdevfs <path>

That's coming from here:
after rootfs, bootfs, bootfstype and rootfstype were all
properly set.

For a multi-disk mdraid or LVM, only one device path is returned, e.g.
/dev/md0, /dev/mapper/foo-bar

When modern filesystems btrfs and zfs are striped or mirrored across
multiple devices, then findfs returns a list of devices, one per line.
I'm not familiar if partman-btrfs allows to create multi-device sets.
The kfreebsd installer allows to create such a configuration.  This can
happen using unofficial ZFS-on-Linux installer images too.

That's the bug this patch refers to:
and fixed differently with this earlier proposal:

It appears to have been reported and fixed in Ubuntu, differently again:

All three fixes look a bit of a hack to me, but picking any one device
works as a placeholder until this code reaches a conclusion that is

The purpose of this code is to find indications it should fall back to
grub-legacy.  In the case of btrfs, zfs, and some other situations it is
mandatory to use grub2 anyway:

I think if bootfstype was tested earlier, a lot of this legacy code
could be skipped over or 'optimised out'.  Awkwardly though, variables
stay in scope until the end of this long script, and it's hard to see if
something gets (re-)used later.  findfs gets used in some more places
and I'm not sure yet if it's satisfactory in *all* places to to consider
only the first one.

Steven Chamberlain

Reply to: