bugGNU GRUB - Bugs: bug #28642, GRUB2 1.97.1 - Strange behavior...

 
 

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

bug #28642: GRUB2 1.97.1 - Strange behavior after using configfile command

Submitted by:  Alexey Loukianov <lexa2>
Submitted on:  Sun 17 Jan 2010 08:40:40 AM UTC  
 
Category: BootingSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: Every Time
Planned Release: None

Wed 20 Jan 2010 11:56:30 PM UTC, comment #5:

This was fixed in bazaar trunk

Vladimir Serbinenko <phcoder>
Project Administrator
Mon 18 Jan 2010 01:56:12 AM UTC, comment #4:

Figured it out!
Main point is that it looks like that:
a) "export" statement should be specified before the "set" statement for that variable;
b) "export" statement should be supplied no matter is the variable set or not in current configfile context.

So the following set of commands works normally:

sh:grub> export prefix
sh:grub> export root
sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> configfile (hd0,5)/boot/grub/grub.cfg
sh:grub> export prefix
sh:grub> export root
sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> configfile (hd0,5)/boot/grub/grub.cfg
sh:grub> export prefix
sh:grub> export root
sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> set root=(hd0,1)
sh:grub> chainloader +1
sh:grub> ls /
txtsetup.sif autorun.inf ...
sh:grub> boot

Alexey Loukianov <lexa2>
Mon 18 Jan 2010 01:46:37 AM UTC, comment #3:

Hmm, still no success:

sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> export prefix
sh:grub> configfile (hd0,5)/boot/grub/grub.cfg
sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> export prefix
sh:grub> configfile (hd0,5)/boot/grub/grub.cfg
sh:grub> set prefix=(hd0,5)/boot/grub
sh:grub> export prefix
sh:grub> set root=(hd0,1)
sh:grub> export root
sh:grub> chainloader +1
error: no such disk
sh:grub> ls /
error: no such disk

Am I doing something wrong?

Alexey Loukianov <lexa2>
Mon 18 Jan 2010 01:34:59 AM UTC, comment #2:

Thanks for clarifications. I was unaware about export command.
For now I will use it, as it is a bit uncomfortable for me now to use trunk branch in production environment. Will the fixes from the r1951 go to next stable release?

Alexey Loukianov <lexa2>
Sun 17 Jan 2010 02:00:08 PM UTC, comment #1:

That behaviour is caused by a bug in the export behaviour. Therefore the essential variables root and prefix are not properly exported all the time.
It's fixed as of revision 1951.

You can workaround it by always exporting prefix and root like this:
export prefix
export root

Do this also for any other variable you would like to keep.

This report is a duplicate of that fixed bug: https://savannah.gnu.org/bugs/?func=detailitem&item_id=27710

Andreas Born <shador>
Sun 17 Jan 2010 08:40:40 AM UTC, original submission:

I'm using grub2 1.97.1 built by myself on Fedora 8 box.

Strange grub2 behavior experienced after using configfile command with following scenario:

1. Boot from media to grub2. On boot grub2 loads up grub.cfg by default.
2. Get into grub shell and use configfile command twice or more times (for ex.):

sh:grub> configfile (hd0,5)/boot/grub/grub.cfg
sh:grub> configfile (hd0,5)/boot/grub/grub.cfg

3. Trying to use GRUB2 to chainload results in a strange errors:
sh:grub> set root=(hd0,1)
sh:grub> chainloader +1
error: no such disk
sh:grub> ls /
error: no such disk

Using chainloader (hd0,1)+1 works as expected.
Using configfile command only once gives correct behavior:

sh:grub> set root=(hd0,1)
sh:grub> chainloader +1
sh:grub> ls /
txtsetup.sif autorun.inf ...
sh:grub> boot

Confirmed to happen on several PCs, and also inside VirtualBOX.

Alexey Loukianov <lexa2>

 

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 (Posted a comment)
  • -unavailable- added by shador (Posted a comment)
  • -unavailable- added by lexa2 (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Jan 2010 11:56:30 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Releaseother=>Bazaar - trunk

    Back to the top


    Powered by Savane 3.1-cleanup1