bugGNU GRUB - Bugs: bug #12018, grub-0.96. savedefault feature is...

 
 

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

bug #12018: grub-0.96. savedefault feature is not working for me.

Submitter:  Invalid User ID <#38697>
Submitted:  Fri 18 Feb 2005 06:07:42 AM UTC
   
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Peter
Open/Closed:  Closed Release:  None
Release:  0.96 Reproducibility:  Every Time
Planned Release:  None

Jump to the original submission

Thu 24 Mar 2005 04:27:43 PM UTC, comment #12: 

Hello again.

I'd like to report that with your patch, grub's savedefault feature works for me!

Thank you very much!!!

BTW. Please. If you have enough time. Backport this patch into 0.96 with the patch for stage2 default file initialisation. I'd like to add this into gentoo :)

Invalid User ID <#38697>
Sat 19 Mar 2005 06:04:03 PM UTC, comment #11: 

I have fixed it right now. Thanks.

Please write ChangeLog next time. Usually I do not apply any patch if ChangeLog is not written.

Okuji

Yoshinori K. Okuji <okuji>
Group administrator
Sat 19 Mar 2005 05:15:31 PM UTC, comment #10: 

Hi,

I encountered the same trouble this night, and found a bug in stage2.c.
The buffer for the "default" file path is not initialized correctly.
Attached patch will fix the bug.  Hope it helps.

NATORI Shin <natori>
Fri 18 Mar 2005 04:25:48 PM UTC, comment #9: 

Hello.

Thank you. I've tried latest cvs grub with your patch. Applied cleanly, compiled but savedefault not working. May be error messages helps you to find an error.

If I setup grub with `grub-install --root-directory=/boot --no-floppy  /dev/hda` then I have the error:
*******************
savedefault 2


Default file name: '!fPSR2##/boot/grub/default' will be open from (hd127,0,a): Filesystem type is ext2fs, partition type 0x83.

-- press a key

*******************

Instead of ! and ## there are some unreadable symbols.

If I setup with `grub-install --no-floppy  /dev/hda` then error is the same except boot/grub/default -> grub/default ; without boot.

Thank you for your work,
Peter.

Anonymous
Thu 17 Mar 2005 09:55:40 PM UTC, comment #8: 

Sorry, I have forgotten one file... here is another test patch. Be sure to have the last cvs version (2005/03/15 16:54:24).

Anonymous
Thu 17 Mar 2005 09:41:09 AM UTC, comment #7: 

Hello.
Seems that patch is not working.
After applying (look ChangeLog is rejected:) but I'll fix  this manually):
peter@camobap ~/grub-0.96/grub-0.96 $ patch -p1 < ../savedefault.patch
patching file ChangeLog
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file ChangeLog.rej
patching file stage2/builtins.c
Hunk #1 succeeded at 3070 (offset -9 lines).
Hunk #2 succeeded at 3103 (offset -9 lines).
Hunk #3 succeeded at 3312 (offset -9 lines).
patching file stage2/shared.h
patching file stage2/stage2.c

I encounter this linking problem:
pre_stage2_exec-builtins.o(.text+0x26e3):/home/peter/grub-0.96/grub-0.96/stage2/builtins.c:3316: undefined reference to `savedefault_partition'
pre_stage2_exec-stage2.o(.text+0xccb): In function `cmain':
/home/peter/grub-0.96/grub-0.96/stage2/stage2.c:891: undefined reference to `savedefault_drive'
pre_stage2_exec-stage2.o(.text+0xcd5):/home/peter/grub-0.96/grub-0.96/stage2/stage2.c:892: undefined reference to `savedefault_partition'
collect2: ld returned 1 exit status
make[2]: * [pre_stage2.exec] &#1054;&#1096;&#1080;&#1073;&#1082;&#1072; 1
make[2]: Leaving directory `/home/peter/grub-0.96/grub-0.96/stage2'
make[1]: * [all-recursive] &#1054;&#1096;&#1080;&#1073;&#1082;&#1072; 1
make[1]: Leaving directory `/home/peter/grub-0.96/grub-0.96'
make: * [all] &#1054;&#1096;&#1080;&#1073;&#1082;&#1072; 2

Thank you, for your work,
Peter.

Anonymous
Wed 16 Mar 2005 10:07:23 PM UTC, comment #6: 

I think the bug is in stage2/builtins.c lines 3292 and 3293. The aim of these 2 lines is to get the drive and the partition of the /boot/grub/default file. The bug is that it takes the device and the partition from your "root (hd0,1)" command. It is correct most of the time, but when /boot is on another partition than /, it doesn't work.

The attached patch should fix the bug. I let my debug traces (printf) in this patch, so this patch must NOT be commited. I want to be sure that I'm correct and that it works on your computer before doing a better patch. Take it as a draft.

As usual, backup your data before test this patch ;)

Anonymous
Wed 16 Mar 2005 05:40:14 AM UTC, comment #5: 


> I don't understand why this problem occurs.
>
> Can you try "grub-set-default n" and checks if the value in
> /boot/grub/default is changed consequently?


Yes. I've checked this. My save-default file is the same as yours.

Also I can from grub shell cat (hd0,1)/grub/default and menu.lst.

I've even checked that this is not our distribution patching problem. I've installed grub from sources, but the problem still occurs.

I'd like to repeat my config:
timeout 30
default saved
splashimage=/grub/splash.xpm.gz

title  GNU/Linux
root (hd0,1)
kernel /vmlinuz root=/dev/hda6 lapic=on
savedefault 0

title Windows XP SP2
rootnoverify (hd0,0)
makeactive
chainloader  +1
savedefault

and camobap grub-0.96 # cat /boot/grub/default
1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.

Well. I can try to reproduce this problem in vmware virtual computer and to put it somewhere for downloading. Can this help? Does anybody interested in this?

Any way. Thank you all, for your help,
Peter.

Anonymous
Tue 15 Mar 2005 11:06:31 PM UTC, comment #4: 

I don't understand why this problem occurs.

Can you try "grub-set-default n" and checks if the value in /boot/grub/default is changed consequently? Here is my default file when I do "grub-set-default 1":
---->8--->8---
1
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
---->8--->8---

Can you do from the grub shell do a
"cat (hd0,1)/grub/default" in order to see if grub can read the file? Can you cat menu.lst?

AFAIK the default file must be in the same file system and same directory than your menu.lst file. But it seems to be your case.

Anonymous
Tue 15 Mar 2005 08:07:59 AM UTC, comment #3: 

Thank you for your response.

I've tried many different combinations of command grub-install, then grub-set-default... Nothing works for me.

Now I'm sure. I have correcte default file.

It seems to me that the problem is because I have stage files and grub.conf (menu.lst) on the different partition.

I have /dev/hda2 on /boot type ext2 (rw,noatime)
and all stage files with the default and menu.lst file in /boot/grub.

I'm using command: grub-install --root-directory=/boot --no-floppy --recheck /dev/hda

then grub-set-default 1

but with the booting grub did not select menuitem 1 (it uses 0 by default) and attempt to boot entry with the savedefault NUM (where NUM is either 0 or 1) ends with the Error 1: ...

What else should I look at?

In any way, thank you for your attention.
grub is my favorite boot loader.:)

Invalid User ID <#38697>
Mon 07 Mar 2005 12:12:45 PM UTC, comment #2: 

The "default saved" command works only if a file named "default" exists and has the correct format. I had to guess its format, since I do not have an installed Linux on the system. If there is an instaled Linux, you can create that file with the command "grub-set-default" on the command line.

BTW: It would be nice to have some info about the file.

Anonymous
Sun 06 Mar 2005 11:12:37 AM UTC, comment #1: 

I can confirm "savedefault" does not work for me with 0.96 -- I get the message "Error 15: File not found." unless I remove the "savedefault" command from my grub.conf/menu.lst.

Wolfram Schlich <wschlich>
Fri 18 Feb 2005 06:07:42 AM UTC, original submission:  

Hello.

I wanted to try savedefault feature. So I created this config:

timeout 30
default saved
fallback 1
splashimage=/grub/splash.xpm.gz

# For booting GNU/Linux
title  GNU/Linux
root (hd0,1)
kernel /vmlinuz root=/dev/hda6 lapic=on
savedefault 1

# For booting Windows NT or Windows95 title Windows XP SP2
rootnoverify (hd0,0)
makeactive
chainloader  +1
savedefault

Now. An attempt to boot Linux ends with:
Error 1: Filename must be either an absoulute pathname or blocklist.

Booting windows have no results: in the consequent booting Linux remains to boot by default.

I don't know does the following information necessary but:
1. I'm installed grub in MBR.
2. I'm installing grub from linux. In command line I just issue grub and use setup command. (setup (hd0) (hd0,1)/grub/e2fs_stage1_5)
3. As you can see from 2. stages 2 and 1.5 are in (hd0,1).

Thank you for your attention.

Invalid User ID <#38697>

 

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

Attached Files
file #2751:  grub-0.96-savedefault-bugfix.patch added by natori (372B - text/plain - Patch for fixing the bug)
file #2745:  savedefault-v2.patch added by None (4KiB - text/x-patch - Patch which should fix the bug (2))
file #2739:  savedefault.patch added by None (4KiB - text/x-patch - Patch wich should fix the bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by robertmh (Updated 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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-12-15 robertmh Open/ClosedOpen Closed
    2005-03-19 natori Attached File- Added grub-0.96-savedefault-bugfix.patch, #2328
    2005-03-17 None Attached File- Added savedefault-v2.patch, #2322
    2005-03-16 None Attached File- Added savedefault.patch, #2316
    2005-03-06 wschlich Carbon-Copy- Added wschlich

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code