jack23912 / grub4dos-chenall

Automatically exported from code.google.com/p/grub4dos-chenall
0 stars 0 forks source link

Relative Path not working (any more) #109

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,
1) I am using pxe boot (the problem may also exist with normal boot)
2) I am using the same menu.lst configuration file with
   various versions of grldr (for the purpose of this test)
3) Relative path is working with old versions of grldr such as
   grub4dos-0.4.5c-2012-06-19 (i did not try every version afterwards)
4) Relative path is NOT working any more with new versions of grldr:
   path like "/file" now seems to always be refered to the device root
   "()/file" instead of being relative to the current folder such as
   "()/some/folder/file" previously set by a command like
   "root ()/some/folder"
Please let me know how I can help and if/when you have a solution.
Thank you very much for your time and effort in maintaining grldr.
Best Regards,
Gilles

Original issue reported on code.google.com by ruymbeke on 15 Jan 2013 at 12:28

GoogleCodeExporter commented 8 years ago

Original comment by tinyb...@gmail.com on 15 Jan 2013 at 12:45

GoogleCodeExporter commented 8 years ago
I tried it and found no problems.
e.g.
root ()/some/folder
cat /menu.lst   ==> ()/some/folder/menu.lst
cat ()/menu.lst ==> ()/menu.lst

Please re try it
If still have problems, please paste the commands you use here.

Original comment by chenall.cn on 15 Jan 2013 at 3:09

GoogleCodeExporter commented 8 years ago
Hi Chenall,
Thank you very much for your reply. I agree with your test results
using only the "root" and the "cat" commands. But it looks like that
the command "configfile" does reset the relative path to the device root.
Please try using the "configfile" command as below:

root ()/some/folder
cat /menu.lst   ==> ()/some/folder/menu.lst
configfile /menu.lst (menu.lst content: "title test" + "configfile /menu.lst")
cat /menu.lst   ==> ()/menu.lst (relative path has been reset to the device 
root)

Hope this helps. Best Regards,
Gilles

Original comment by ruymbeke on 15 Jan 2013 at 9:30

GoogleCodeExporter commented 8 years ago
Well, I see, ruymbeke.

This is a feature in the newer releases, not a bug. After configfile, the 
relative path will be reset to the device root, yes.

If you want a relative path in the new menu.lst, you may add a root ()/... 
command in the new menu.lst file.

Original comment by tinyb...@gmail.com on 15 Jan 2013 at 10:20

GoogleCodeExporter commented 8 years ago
Hi Tinybit,
This is very limiting and may not be considered as an improvement
as it breaks the backward compatibility and the relative path spirit.
Why always reset the path with the "configfile" command when it so simple
to start a menu.lst config file with a "root ()/" command ?
The local path information is very valuable and difficult to recover.
Could you please help and provide a solution to keep the local
(relative) path after using the "configfile" command ?
I can see a few options:
1) revert to the previous behavior (preferred)
2) add a new command with the previous behavior
3) add a switch to the "configfile" command in order to keep the local path
4) save the local path in a variable in order to recover it later
Best Regards,
Gilles

PS: if you decide to keep it as is, could you please help me find the source
code lines to change so I can create a patch file and have my own build ?

PS2: is there any other command (besides configfile) resetting the path ?

Original comment by ruymbeke on 15 Jan 2013 at 11:37

GoogleCodeExporter commented 8 years ago
Hello,
After using diff to find out about the differences in the configfile_func
my guess is that to revert back I just need to comment out the line 3594
of the file \stage2\builtins.c:
// *saved_dir = 0;  /* clear saved_dir */
This seems to work fine. Could you please confirm that this is the only
change I need to revert back ? Would you consider any of my options above ?
Thank you very much. Best Regards,
Gilles

Original comment by ruymbeke on 16 Jan 2013 at 2:59

GoogleCodeExporter commented 8 years ago
If I remember it rightly, it is the only change needed.

Your argument is reasonable. And yes, I agree with you. I have proposed to 
comment out the line you mentioned and revert back.

Original comment by tinyb...@gmail.com on 16 Jan 2013 at 6:16

GoogleCodeExporter commented 8 years ago
Thank you very much !
Gilles

Original comment by ruymbeke on 16 Jan 2013 at 6:33

GoogleCodeExporter commented 8 years ago

Original comment by tinyb...@gmail.com on 17 Jan 2013 at 10:38