jack23912 / grub4dos-chenall

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

pxe boot broken since 2010-5-2 (2010-4-20 still ok) #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. copy grldr on tftp server
2. pxe boot ==> up to 2010-4-20 is working good
3. builds 2010-5-2 and after fails

What is the expected output? What do you see instead?
search for config file icluding portion of MAC address
instead it hangs after DHCP request

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by ruymbeke on 19 May 2010 at 8:04

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,
The problem seems to be connected to the latest add-on to the file 
stage2/fsys_pxe.c
If commented out (cf below) pxe boot works just fine.

...
    return 1;
  } 
//  if (pxe_dir ("/menu.lst"))
//  {
//      grub_strcpy (pxe_tftp_name, "/menu.lst");
//      ret = 1;
//      goto done;
//  } 

  grub_memcpy ((char *) saved_pxe_mac, (char *) pxe_mac, 6);
  saved_pxe_ip = pxe_yip;  
...
Hope this helps,
Gilles

Original comment by ruymbeke on 19 May 2010 at 8:24

GoogleCodeExporter commented 8 years ago
Hello,
It looks like that grub also hang (just after displaying the stage 1.5 message)
when installed on a ext3 partition. (grub4dos-0.4.4-2009-09-13 is working just 
fine)
Best Regards,
Gilles

Original comment by ruymbeke on 20 May 2010 at 8:53

GoogleCodeExporter commented 8 years ago
hi, ruymbeke. nice to see you again.

stage1.5...... that feature no longer maintained, and has never been maintained 
in
the past few years. The "stage1/1.5/2" boot method has known problems. The 
reliable
way is using grldr.

Original comment by tinyb...@gmail.com on 20 May 2010 at 12:58

GoogleCodeExporter commented 8 years ago
I tested and found no problems on pxe.
What you use the TFTP server?
and what menu file used on tftp server?

Original comment by chenall.cn on 20 May 2010 at 3:28

GoogleCodeExporter commented 8 years ago
Hello,
Yes it works using bootlace.com to load the grldr.mbr into the mbr.
(I was used to install grub using the built-in "setup" command of the grub 
binary.
Not a big deal, it just breaks the legacy install method used by a lot of OSes)

Yes PXE boot works if you have the file "menu.lst" in the root of the tftp 
server.
(I was used to the legacy way which have a "menu.lst" FOLDER
including the "default" grub config file. Not a big deal if you do not plan
to have multiple config files depending on the machine network interface MAC 
address.

As a suggestion, it could be great to support both options:
1) menu.lst folder with multiple MAC_based config files (legacy way) and
2) the simplified solution with the menu.lst file (in the tftp root folder 
which is
   consistent with the grub4dos approach having the menu.lst in the root folder)

Thank you very much both of you for your prompt replies and great work !
Gilles

Original comment by ruymbeke on 21 May 2010 at 7:35

GoogleCodeExporter commented 8 years ago
Thank you, Ruymbeke.

I just uploaded a build:

http://nufans.net/grub4dos/tinybit/grub4dos-0.4.5b-2010-05-21.zip

It now searches /main.lst and other configs in /menu.lst/ as before.

So this will hopefully solve that issue.

--------------

And about the legacy "setup" and "install", if they continue to fail for the 
coming
years, we could probably delete them.

Original comment by tinyb...@gmail.com on 21 May 2010 at 7:56

GoogleCodeExporter commented 8 years ago
Hi Tinybit
Yes, both options are now working great for me:
/main.lst and /menu.lst/[default|MAC]
(with that order of priority if both exist)

Nice to see all the new great improvements and
that your are still very active on this project.
Thank you very much !
Gilles

Original comment by ruymbeke on 21 May 2010 at 8:52

GoogleCodeExporter commented 8 years ago
Thank you again for your confirmation, dear Ruymbeke.

Original comment by tinyb...@gmail.com on 21 May 2010 at 11:36

GoogleCodeExporter commented 8 years ago
Hi Tinybit,
Do you have any plan to support ext4 as it become more and more popular ?
Thanks,
Gilles

Original comment by ruymbeke on 22 May 2010 at 6:57

GoogleCodeExporter commented 8 years ago
ext4 is already supported by the grub4dos kernel module in fsys_ext2fs.c.

But the grldrstart.S code cannot support grldr look-up on ext4 filesystems at 
present.

Anyway, it could be achieved in another manner. I have started a new 
semi-project,
currently no name, but can be called mini-grub4dos. This aims to build a 
grub4dos
kernel that can fit in 63 sectors ---- that is, the MBR track. After that work 
would
complete, we will have the ability to locate files in FAT/NTFS/EXT2/3/4 
partitions at
startup.

I have a post on http://www.boot-land.net/forums/index.php?showtopic=10891 and I
copy&paste it here for your reference:

GRLDR can be greatly cut down. FYI, with my cut-down version(still a work in
progress) of http://nufans.net/grub4dos/grubtmp-src.zip (you can only compile it
under Linux) the size of GRLDR is only 33KB, which of course have lost many 
functions
in grub4dos. The cut-down version has no menu system currently, so you can only 
enter
command line. But the cut-down version can execute external commands. GRLDR, 
NTLDR,
IO.SYS(of MSDOS7.xx), KERNEL.SYS(of FreeDOS), VMLINUZ(of Linux) and any single 
sector
boot record file, all can be run(as an executable file) under the cut-down 
version.
Examples:

CODE
command (hd0)+1
command (hd0,0)+1
command (hd0,0)/grldr
command (hd0,0)/ntldr
command (hd0,0)/io.sys
command (hd0,0)/kernel.sys
command (hd0,0)/vmlinuz (hd0,0)/initrd.img root=UUID=XXXXXXXXXXXXX ro quiet 
splash
acpi=noirq

Note that the initrd image(if it is needed) should be placed immediately after 
vmlinuz.

You may test&run the cut-down verion of GRLDR with normal grub4dos commands:

CODE
chainloader --force /grldr_cut_down
boot

Original comment by tinyb...@gmail.com on 22 May 2010 at 4:17

GoogleCodeExporter commented 8 years ago
Hi Tinybit,
I am glad to read that you are working on ext4 with a mini grldr solution.
I will give it a try... thank you so much !

But just as a curiosity, could it be possible to get ext4 support by having
the legacy stage 1/1.5/2 working again since fsys_ext2fs.c already supports 
ext4 ?
(if I am not mistaken, the legacy grub mbr does not need to understand
the file system since it is using "dumb" absolute disk blocks addressing)

At last, any plan to support gpt (to support >2TB drives or raids) ?
Best Regards,
Gilles

Original comment by ruymbeke on 23 May 2010 at 9:56

GoogleCodeExporter commented 8 years ago
Certainly you can try it. No one has ever changed the grub legacy code of
stage1/1.5/2 in grub4dos. ext3 and ext4 are treated as a different ext2. So the 
code
of fsys_ext2fs.c is modified accordingly. But other code related to 
stage1/1.5/2 has
never changed.

But the stage1/1.5/2 itself have its own problems, and it is very hard to 
locate the
bugs.

You might have to fix the possible bugs by yourself.

If you would have fixed it, you may post the patch on the forums, or send to 
maintainers.

And sorry, I have no plan to support GPT for now by myself. I hope this be
implemented by others.

Thanks.

Original comment by tinyb...@gmail.com on 24 May 2010 at 12:09

GoogleCodeExporter commented 8 years ago
hi ruymbeke.
  I just uploaded a new build.
  It now searches /menu.lst and other configs in /menu.lst/ again.
  Because there is a controversy here
  http://bbs.znpc.net/viewthread.php?tid=5934

  can you please test if it work?

Original comment by chenall.cn on 12 Jun 2010 at 8:51

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Chenall,
Sorry for the delay, I have been busy and did not read your post sooner...
It looks like that the test for a file called "/menu.lst"
or a folder called "/menu.lst/" has been reversed:
If I have a file call menu.lst, the display is showing
messages for searches within the folder /menu.lst/...
instead of using the file /menu.lst and obviously
does not find anything and end up with the grub shell.
On the other hand if I have a folder names /menu.lst/
grub hangs probably trying to use the folder as a config file.
I would have proposed a patch but I could not find a post
with the latest source code matching your binary.
Hope this helps,
Gilles

Original comment by ruymbeke on 18 Jun 2010 at 6:41

GoogleCodeExporter commented 8 years ago
Hi,ruymbeke
Thank you for your reply,I have upload a new version on downloads/list.

If you would have fixed it,that is well.

Look forward to your patch and reply.

Original comment by chenall.cn on 18 Jun 2010 at 11:06

GoogleCodeExporter commented 8 years ago
Hi Chenall,
The new version grub4dos-0.4.5b-2010-06-19.zip still does not work.
It finds the /menu.lst file properly but is not looking for data
within the /menu.lst/ directory. It looks like that grldr still
search for data within the /menu/ directory.
Can you post the latest source code ?
or should I get it from the trunc ?
or use the grub4dos_r38.diff file if it is up to date ?
Thanks,
Gilles

Original comment by ruymbeke on 19 Jun 2010 at 7:09

GoogleCodeExporter commented 8 years ago
I have upload the latest source code to download list.
or you can use svn to get it.

svn co http://grub4dos-chenall.googlecode.com/svn/trunk grub4dos
and then apply the patch against revision 38 you just downloaded:
cd grub4dos
patch -p0 < ../grub4dos_r38.diff

or can i take your account to Project committers?that you can update sources?

Original comment by chenall.cn on 19 Jun 2010 at 8:54

GoogleCodeExporter commented 8 years ago
Hi Chenall,
Please find attached my fsys_pxe.c.diff patch file.
It is a very simple way to solve this problem:
Basically it just look for the /menu.lst file
after looking for the content of the /menu.lst/ folder.

I understand that you would prefer to try the /menu.lst file first
(before scanning the folder) but I could not find an easy way yet
to understand if the menu.lst is a file or a folder without trying
to read it's content. Actually in my test the file size length
of the /menu.lst/ folder is 512 (which is correct) and could be
also a valid file size, and as such cannot be used to separate
the file/folder cases.

The next step would be to read the folder content (as a file)
and figure out some how that it is not a valid config content
or that the data length is zero (which I could not get to work yet)
Best Regards,
Gilles

224c224
<   #endif
---
> //    #endif
231a232
>   #endif
274a276,284
>   #if 1
>   if (pxe_dir (pxe_tftp_name))
>     {
>       ret = 1;
>       goto done;
>     }
> 
>   grub_strcpy (pxe_tftp_name, "/menu.lst");
>   #endif 

Original comment by ruymbeke on 20 Jun 2010 at 3:16

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,ruymbeke
thank you,but this is not I want.

what TFTP server do you use?

Maybe I can reproduce your error.

Original comment by chenall.cn on 20 Jun 2010 at 9:41

GoogleCodeExporter commented 8 years ago
Hi Chenall,
I am using:
1) "tftpd -s /tftpboot" started from inet.conf on a OpenBSD system
What exactly do you want ? Test for the /menu.lst before the /menu.lst/ folder ?
Best Regards,
Gilles

PS: I am almost sure I have seen the same problem on Linux tftpd servers:
2) "in.tftpd -c -s /tftpboot" started from inet.d on a OpenSuse 11.2 and
3) "in.tftpd -c -s /tftpboot" started from inet.d on a Debian (Knoppix live cd)
I will try to confirm this tomorrow...

Original comment by ruymbeke on 20 Jun 2010 at 11:29

GoogleCodeExporter commented 8 years ago
Hi ruymbeke,
1) Yes,use /menu.lst first.

I had tested tftpd on debian,it seems tftpd doesn't support grub4dos well.
grub4dos doesn't get any files from tftp server.

Original comment by chenall.cn on 21 Jun 2010 at 8:29

GoogleCodeExporter commented 8 years ago
Hi Chenall,
Surprisingly (at least to me) your latest version of grldr works just fine
on my two Linux test setup systems: Debian (Knoppix 32) and Open Suse 11.2 64.
Only the tftp daemon of my OpenBSD 3.9 server have a problem with grldr.
(Previously grldr had the same bad behaviour on all 3 platforms)
When possible I would like to investigate some more...
Best Regards,
Gilles

Original comment by ruymbeke on 22 Jun 2010 at 7:20

GoogleCodeExporter commented 8 years ago

Original comment by chenall.cn on 14 Aug 2010 at 7:46