URL:
  <http://savannah.gnu.org/bugs/?39498>

                 Summary: grub-mkconfig_lib creates "search" lines incorrectly
for multi-device volumes
                 Project: GNU GRUB
            Submitted by: apsu
            Submitted on: Tue 16 Jul 2013 08:50:48 PM GMT
                Category: Configuration
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Evan Callicoat
        Originator Email: [email protected]
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: Bazaar - trunk
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

When grub-mkconfig is called for a grub installation on a multi-device btrfs
volume, the function prepare_grub_to_access_device() is called from the
/usr/share/grub/grub-mkconfig_lib bash library, which has this block of code
in it:

if fs_uuid="`"${grub_probe}" --device "$@" --target=fs_uuid 2> /dev/null`" ;
then
hints="`"${grub_probe}" --device "$@" --target=hints_string 2> /dev/null`" ||
hints=
echo "if [ x\$feature_platform_search_hint = xy ]; then"
echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
echo "else"
echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
echo "fi"
fi

The ${grub_probe} call with --target=hints_string will return multiple lines
of output when --device refers to more than one device, which is the case for
multi-device btrfs volumes (and probably others). Normally, the newlines would
be converted to space-separated fields via the default IFS, but because the
echo lines put double-quotes around ${hints}, the newline separators are
preserved, resulting in a completely broken "search" line output in grub.cfg.

It seems that the search and its hints isn't strictly necessary as I haven't
seen any configuration fail to boot without it, but this is a fairly simple
bug to fix so I figured I should follow up on it.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39498>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to