Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FTP chainloading a menu.ipxe
2019-09-15, 03:03
Post: #1
FTP chainloading a menu.ipxe
Hello Everybody, it's my first post here. Smile

I'm in trouble chainloading a menu.ipxe by FTP
I've tried with and without EMBEDing script in ipxe.lkrn (compiled by hand or rom-o-matic with I think good options)

#!ipxe
dhcp
chain http://ftp.192.168.0.254/Disque%20dur/menu.ipxe

The script load then suddenly hang.
I must say I successfully boot a Linux one (kernel + initrd) by FTP.

ps: I must use FTP cause my Internet box have just a FTP inside.

Best regards.
Find all posts by this user
Quote this message in a reply
2019-09-18, 01:44
Post: #2
RE: FTP chainloading a menu.ipxe
ftp, no username or password are provided.

make sure that you really intent to use FTP and not TFTP.

Are you sure that you get a full hang, and not a error message of any kind? Have you tried running this from a shell, that is not using an embded script - which should always be what you test first before embedding (that is trying the basic parts in shell by typing it out)

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-09-18, 02:19
Post: #3
RE: FTP chainloading a menu.ipxe
Hi,

> ftp, no username or password are provided.

It's not a problem, I compiled ipxe with FTP debug enabled and it connect anonymous (user: anonymous , pass: ipxe@ipxe.org)

I've tested with password and it function as well:

initrd http://ftp.user:pass@192.168,0,254/Disque%20dur/rootfs.gz
kernel http://ftp.user:pass@192.168,0,254/Disque%20dur/bzImage64
boot

> make sure that you really intent to use FTP and not TFTP.

Nope... Really FTP.

> Are you sure that you get a full hang, and not a error message of any kind? Have you tried running this from a shell, that is not using an embded script - which should always be what you test first before embedding (that is trying the basic parts in shell by typing it out)

It don't hang, PC just reboot, no error message or no time to read.
Yes, I tried from shell.

EMBEDed script:

#!ipxe
dhcp
chain http://ftp.192.168.0.254/Disque%20dur/menu.ipxe

menu.ipxe (for testing):

#!ipxe
dhcp
shell

Also I can't do SANHOOK or SANBOOT with FTP.

Sad
Find all posts by this user
Quote this message in a reply
2019-09-18, 13:34
Post: #4
RE: FTP chainloading a menu.ipxe
san commands over FTP, probably to much of a nightmare.

Ok - so the actual error description that you should have in your opening post is: "when i chain over ftp, PC reboots"

When testing, I would use iPXE without embeded script.
add || shell at the end of your chain line - just to be sure that you get back to shell if it fails.

You might also want to use imgfetch instead of chain, followed by imgstat, to see that the script is detected correctly as an ipxe script and not a binary of some sort that it tries to run.
With that out of the way, my guess would be hardware issues, and I would start with running memtest to check for any issues with memory.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-09-18, 17:16
Post: #5
RE: FTP chainloading a menu.ipxe
> san commands over FTP, probably to much of a nightmare.

Ok, I forget it by now...

> Ok - so the actual error description that you should have in your opening post is: "when i chain over ftp, PC reboots"

Then what to do ? Changing the thread name ?

> When testing, I would use iPXE without embeded script.
add || shell at the end of your chain line - just to be sure that you get back to shell if it fails.

Yes, I tried it by shell commands:
dhcp
imgfetch http://ftp.192.168.0.254/Disque%20dur/menu.ipxe
( FTP Ok )
imgstat menu.ipxe
( menu.ipxe : 22 bytes [PXE-NBP] ) <--- don't know if it's good
chain menu.ipxe || shell

At this point PC reboots.

menu.ipxe is a simple script:
#!ipxe
dhcp
shell

I will try memtest...
Find all posts by this user
Quote this message in a reply
2019-09-18, 21:53 (This post was last modified: 2019-09-18 21:56 by alhyene.)
Post: #6
RE: FTP chainloading a menu.ipxe
Ok, I've tested with HTTP and don't look the same.

In a shell I've tested:
dhcp
imgfetch http://boot.ipxe.org/demo (the ipxe script exemple)
( HTTP Ok )
imgstat demo
( demo : nnn bytes [Script] ) and not [PXE-NBP] like with FTP
chain demo
(boot ipxe demo)

Then I think something is broken in FTP.
Am I on right ?
Find all posts by this user
Quote this message in a reply
2019-09-19, 04:45
Post: #7
RE: FTP chainloading a menu.ipxe
You should see Script.
if PXE-NBP then it runs as binary code.
So you are using different files to test.... could you donwload the ipxe script example and put on your server as is and test that?
make sure that your script is a valid script with #!ipxe in ASCII as the first bytes.
If it is - I would start to use tcpdump on the FTP box, since that is the only way that you will see what is actually going on.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-09-19, 06:48
Post: #8
RE: FTP chainloading a menu.ipxe
(2019-09-19 04:45)NiKiZe Wrote:  if PXE-NBP then it runs as binary code.

sometimes it's just because of text format.

e.g.

http download a script text file like this:
Code:
#!ipxe
echo hi
will be shown as [Script] ) and not [PXE-NBP], and execute normally

but if this text file is saved as UTF-8 with BOM, i.e. EF BB BF added at beginning, then it'd be shown as [PXE-NBP], and executing it causes hang
Find all posts by this user
Quote this message in a reply
2019-09-20, 00:33
Post: #9
RE: FTP chainloading a menu.ipxe
Big Grin Yeah Men ! You're on right !

It's a stupid thing, I don't saw that with Nano editor.
I put da menu.ipxe ina hex editor, et voila : EF BB BF as header, then it crunch the magic #!ipxe.

Now it works and by now I will pay more attention on this...
Thanks again for your help. Wink
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)