bugGNU GRUB - Bugs: bug #39498, grub-mkconfig_lib creates...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #39498: grub-mkconfig_lib creates "search" lines incorrectly for multi-device volumes

Submitter:  Evan Callicoat <apsu>
Submitted:  Tue 16 Jul 2013 08:50:48 PM UTC
   
 
Category:  Configuration Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Evan Callicoat
Open/Closed:  Closed Release:  Bazaar - trunk
Release:  Reproducibility:  Every Time
Planned Release:  None

Fri 19 Jul 2013 08:20:37 PM UTC, comment #1: 

Could you paste exact grub-install invocation and attach grub-install --debug output?

Andrei Borzenkov <arvidjaar>
Group Member
Tue 16 Jul 2013 08:50:48 PM UTC, original submission:  

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.

Evan Callicoat <apsu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Updated the item)
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by apsu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-14 phcoder StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code