Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Method get/post?
2018-01-08, 19:07
Post: #1
Request Method get/post?
Hello everyone. I'm converting my environment to use the params command rather than build my own url. I'm finding that the request to the webserver (launching the boot.php) is not receiving the post when I start the build of my server.

I dumped all the php variables and I'm finding the request being received by my webserver is a "get" and not a "post". In turn is not getting any of the variables I'm defining to be passed to the linux server build.

What dictates from the ipxe side the get/post function?

I basically do...

params --name test
param --params test ip ${ip}
param --params test hostname ${hostname}

and so on. On the server itself being created I dumped when is being seen by the webserver and these are not appearing. Maybe I'm not understanding how to decode this on the server side. I do see the boot.php script but it looks to me like an encoded number.

/ks/html/boot.php?=PHPE98744F37-D428-11D2-A769

Any ideas?

Thanks
Find all posts by this user
Quote this message in a reply
2018-01-08, 20:15
Post: #2
RE: Request Method get/post?
I'm assuming you are using chain to load "stage2 script" ? How does that chain line look like?

From http://ipxe.org/cmd/params with the form renamed to test:
Code:
params --name test
  param --params test ip ${ip}
  param --params test hostname ${hostname}
  imgfetch http://192.168.0.1/ks/html/boot.php##params=test

My guess right now is that you are missing the "##params=test" part at the end of the url, which iPXEs fetch sees and in that case posts the form data in test.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-01-08, 23:06
Post: #3
RE: Request Method get/post?
Thanks for the reply. I was able to find out what was happening by looking at the syslog on the server being built itself. The ###params is not even being replaced by the forms data. I can actually see the "boot.php##params" in there.

I think I'm misusing this functionally. I do not chainload. Here is what it actually looks like:

params --name data1
param --params data1 ip ${ip}
param --params data1 hostname ${hostname}
param --params data1 netmask ${netmask}
param --params data1 gateway ${gateway}
param --params data1 ksfile ${ksfile}
param --params data1 rfcnum ${rfcnum}
param --params data1 owner ${owner}
param --params data1 dns ${dns}

set ks http://${ksaddress}/ks/html/boot.php?##params=data1

set uri ${bootdev} ${predictable} inst.ks=${ks} ip=${ip}::${gateway}:${netmask}:${hostname}::none inst.loglevel=debug root=live:${mirror}${liveos}

initrd ${mirror}${image}
kernel ${mirror}images/pxeboot/vmlinuz ${repo} ${uri}
boot

So it's probably not seeing this as a post since it's contained within the kernel line. I think if I want to do this, I'll have to re-write things.

Thanks for you assistance.
Find all posts by this user
Quote this message in a reply
2018-01-09, 06:49
Post: #4
RE: Request Method get/post?
(2018-01-08 23:06)glenc2004 Wrote:  I think I'm misusing this functionally. I do not chainload. Here is what it actually looks like:

set ks http://${ksaddress}/ks/html/boot.php?##params=data1

set uri ${bootdev} ${predictable} inst.ks=${ks} ip=${ip}::${gateway}:${netmask}:${hostname}::none inst.loglevel=debug root=live:${mirror}${liveos}

kernel ${mirror}images/pxeboot/vmlinuz ${repo} ${uri}

So it's probably not seeing this as a post since it's contained within the kernel line. I think if I want to do this, I'll have to re-write things.

Yes that's not going to work.
Just let me mention that if you had ##params after vmlinuz that would "work" as in posting the data, not that it makes sense but just to be clear on where params can be used.

What you do is that you send of an url to the kernel, which in turn is ignored but read by startup scripts. however params is an iPXE only feature, so that won't work. the fetch with params needs to be done within iPXE to work as you expect it to ... but I don't think there is any way to add the ks file to the cpio, so ks "can't" be fetched inside of iPXE.

Simplest solution is probably to use get parameters instead of post.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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