China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 18:28
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » [Help Needed]Is there a way to change the location of the default boot menu file for Grub for NTLDR? View 2,509 Replies 12
Original Poster Posted 2004-09-10 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
I know that grub for ntldr (i.e., grldr) is set in boot.ini by default as:
c:\grldr="Start Grub"
After this grub is started, it searches for (hd0,0)/boot/grub/menu.lst as the default boot menu. But suppose my NT system is installed in (hd0,1) and menu.lst is in the (hd0,1)/boot/grub directory. Then how should I set boot.ini so that grldr can start the menu.lst I specified?
I imagined it should be set like this:
c:\grldr="start Grub" configfile=(hd0,1)/boot/grub/menu.lst
But unfortunately, it doesn't work.
Also, please ask the grub experts not to be stingy with their advice!
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 2 Posted 2004-09-10 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Currently, GRLDR does not support command-line arguments. However, the latest few versions have included Chris's findroot and presetmenu patches, allowing it to boot the menu.lst file under (hd0,1).

When GRUB starts, it first searches for the /boot/grub/menu.lst file in each partition on the hard disk. If it fails, it then continues to search for the /boot/grub/menu.lst file on the floppy disk. And it uses the first found menu.lst file as the menu.

If the above process fails, it repeats the search process with /boot/menu.lst as the file name.

If the above process also fails, it repeats the search process with /menu.lst as the file name.

Should this be sufficient? (By the way, a special thanks to Chris for the wonderful patches!)
因为我们亲手创建,这个世界更加美丽。
Floor 3 Posted 2004-09-11 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
After applying Chris's patch, do I need to add any parameters during compilation? I am using the Chinese version of Grub 0.95 downloaded from http://159.226.20.15/grub_chs/ for compilation. In theory, this source code should include all patches, and indeed there is the findroot command in the command line mode, but I always get the "File not found" prompt when running this command. Also, my menu.lst is in the (hd0,1)/boot/grub directory, but it can't be found at all during startup. I don't know where the problem is.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 4 Posted 2004-09-11 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The Chinese version is handled by Gandalf. You should ask him for detailed information.
因为我们亲手创建,这个世界更加美丽。
Floor 5 Posted 2004-09-12 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Thanks, I'll try again.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 6 Posted 2004-09-12 00:00 ·  中国 河北 唐山 联通
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
The following is a quote from Climbing's post on September 10, 2004, at 9:32:11:

I know that grub for ntldr (i.e., grldr) is set in boot.ini by default as:
c:\grldr="Start Grub"
After this grub starts, it will search (hd0,0)/boot/grub/menu.lst as the default boot menu. But suppose my NT system is installed in (hd0,1) and menu.lst is in (hd0,1)/boot/grub directory, then how should I set boot.ini so that grldr can start the menu.lst I specified?

I imagined it should be set like this:
c:\grldr="start Grub" configfile=(hd0,1)/boot/grub/menu.lst

But unfortunately, it doesn't work.

Also, please ask the great grub experts to give advice!

Edit all paths in GRLDR in hexadecimal.
DOS之家 http://doshome.com 站长 葛明阳
Floor 7 Posted 2004-09-13 00:00 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
The following is a quote from gmy's post on 2004-9-12 20:03:02:
>
Edit all paths in GRLDR in hexadecimal.


Tried it, no good!
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 8 Posted 2004-09-13 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Dear Tinybit, can you modify grldr to support boot parameters? I think this shouldn't be too complicated, because NTLDR supports passing boot parameters. If grldr supports boot parameters, then the problem in the top post will be easily solved.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 9 Posted 2004-09-13 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Previously, there was consideration to add support for GRLDR command line, but it seemed not easy, so later CHRIS's findroot and preset menu patches were adopted.

This is basically sufficient, try to use this method. If it is really not enough, we can discuss again.

grub for dos 0.2.0 pre12 fully supports this dynamic search process. You can give it a try.
因为我们亲手创建,这个世界更加美丽。
Floor 10 Posted 2004-09-14 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Don't click. Through ./configure --help I have found that the compilation parameter for the preset menu should be: --enable-preset-menu=FILE. By referring to your written help, I have also clarified the usage of findroot. There are two questions to ask: 1. Should FILE in --enable-preset-menu=FILE be similar to this: (hd0,1)/boot/grub/menu.lst? If I compile grub like this, will grub change the default (hd0,0)/boot/grub/menu.lst to (hd0,1)/boot/grub/menu.lst? Then this compiled version will only be suitable for some special machines (the machines where menu.lst is placed in (hd0,1)/boot/grub), but not suitable for other machines (the machines where menu.lst is placed in partitions other than (hd0,1)). 2. Are the findroot command (and find) only usable in the interactive interface of grub, of course, on the premise that there is no default menu.lst for support. For example, my grub defaults to finding (hd0,0)/boot/grub/menu.lst as the default boot menu. If this file is not at that location, after starting grub, it directly enters the interactive interface. At this time, I can only manually enter: findroot /boot/grub/menu.lst
configfile /boot/grub/menu.lst to start the menu system. And now what I want to solve is that no matter where my menu.lst is in the partition (assuming it is fixed at /boot/grub/menu.lst), as long as I start grub, it will automatically search for /boot/grub/menu.lst in each partition and use the first found file as the default menu to boot. I wonder if grub for dos 0.2.0 pre12 supports this kind of search method?
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 11 Posted 2004-09-14 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Just compile according to the compile file in the release of grub for dos 0.2.0 pre12.

I have compiled presetmenu into it. findroot has been changed to find --set-root.

The find command can be used in the menu and also in the command line.

You don't need to do anything, just download and use pre12.
因为我们亲手创建,这个世界更加美丽。
Floor 12 Posted 2004-09-14 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
And now what I want to solve is that no matter which partition my menu.lst is in (assuming it is fixed at the /boot/grub/menu.lst location), as long as I boot grub, it will automatically search for /boot/grub/menu.lst in each partition, and take the first file found as the default menu to boot. I wonder if grub for dos 0.2.0pre12 supports this kind of search method?
----------------
Yes, it is fully supported. No settings are required. It automatically searches for /boot/grub/menu.lst by default. It first searches all partitions of the hard disk, and then all floppy disks. The first one found is used.
因为我们亲手创建,这个世界更加美丽。
Floor 13 Posted 2004-09-14 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Don't click,
Hey, I contacted Einstein/Gandalf/useronce on the Wuyou Boot Forum and you on the DOS Union Forum, and you're also in contact on the United DOS forum, which really wastes too much energy.
With the help of Gandalf, I have generally figured out the working principle of the Chris patch. I have seen the grub-0.95-patch4-findroot patch. You should have made simple modifications based on the Chris patch. I'm not very familiar with linux, so I don't know how to apply the patch to the source code. It should be using the diff command. It seems I can only hope that Gandalf will continue to release the grub source code with your pre12 patch applied and then recompile it.
In short, thanks.
The link to the post I discussed with Gandalf (useronce) on the Wuyou Boot Forum is:
http://bbs.wuyou.com/cgi-bin/topic.cgi?forum=34&topic=4225&show=0
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Forum Jump: