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

 
 

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

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

Submitted by:  Evan Callicoat <apsu>
Submitted on:  Tue 16 Jul 2013 08:50:48 PM UTC  
 
Category: ConfigurationSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: Evan Callicoat
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: 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?

Andrey Borzenkov <arvidjaar>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 14 Oct 2013 04:30:40 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup