Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE out of memory or something?
2012-10-21, 14:38 (This post was last modified: 2012-10-21 14:59 by Torgeir.)
Post: #1
iPXE out of memory or something?
How much memory does iPXE "have"? If I reload to a new php?with variables too many times, iPXE crash.

Using latest iPXE built from git (as of today). Specifically ipxe.pxe with EMBED=script

With "script"
Code:
#!ipxe
dhcp
chain http://web-server-address/test.php

This is my example:

With OR "choose xxx && goto xxx || "
On the 14 th run, after selected on the first menu, it redirects me straight to :failed.

Without OR "choose xxx && goto xxx " I get Error: No such file or directory
http://ipxe.org/err/2d02803b

Working example: http://127.0.0.1/test.php
PHP Code:
<?php

header 
"Content-type: text/plain" );
echo 
"#!ipxe \n";

$COUNT $_REQUEST['count'];
$MODE $_REQUEST['mode'];
$TYPE $_REQUEST['type'];
$DISTRO $_REQUEST['distro'];

$MENU_TITLE "Last selected ${TYPE} ${MODE} ${DISTRO} ${COUNT}";

echo 
"menu ${MENU_TITLE} \n";
echo 
"item domaininstall Domain Install \n";
echo 
"item standalone Standalone \n";
echo 
"item basic Basic \n";
echo 
"item server Server \n";
echo 
"item \n";
echo 
"item reboot Reboot \n";

echo 
"choose installtype && goto \${installtype} \n";

# store ipxe choice as a variable
$INSTALLTYPE "\${installtype}";

# Installtype
echo ":domaininstall \n";
echo 
":standalone \n";
echo 
":basic \n";
echo 
":server \n";

echo 
"menu ${MENU_TITLE} \n";
echo 
"item delete_all Delete_all \n";
echo 
"item linux_only Linux_only \n";
echo 
"item diskless Diskless \n";

echo 
"choose installmode && goto \${installmode} \n";

# store ipxe choice as a variable
$INSTALLMODE "\${installmode}";

# Installmode
echo ":delete_all \n";
echo 
":linux_only \n";
echo 
":diskless \n";

echo 
"menu ${MENU_TITLE} \n";
echo 
"item rhws5u2 rhws5u2 \n";
echo 
"item rhws5u3 rhws5u3 \n";
echo 
"item rhws5u4 rhws5u4 \n";

echo 
"choose distro && goto \${distro} \n";

# store ipxe choice as a variable
$DISTRO "\${distro}";

# Installmode
echo ":rhws5u2 \n";
echo 
":rhws5u3 \n";
echo 
":rhws5u4 \n";

#echo "prompt Press any key to Reload \n";
$COUNT++;

echo 
"chain http://"$_SERVER["SERVER_NAME"] . $_SERVER['PHP_SELF'] . "?count=${COUNT}&mode=${INSTALLMODE}&type=${INSTALLTYPE}&distro=${DISTRO} \n";

echo 
":failed \n";
echo 
"prompt Failed, press any key to reboot \n";
echo 
"reboot \n";

?>

Why is this not working on the 14th time?
Why would I want to do this over and over again? If I have user input that I want PHP to be able to work with, this was the only way I could get it to work.

I problably dont have to chain to another page 14 times, but was just curious why it did not work the 14th time.

As of now. I have configured adLDAP, and the use of SSH, after an login.

So we can authenticate userinput from iPXE login, in Active Directory, SSH to a linux box, run "ldapsearch -h dc ....." and look for our Admin group.

The reason I use SSH, was that I could not get adLDAPs built in fetch user/group info to work.

If we find this user in admin group, they can install a new computer. Regular users may not Smile
Find all posts by this user
Quote this message in a reply
2012-10-21, 18:40
Post: #2
RE: iPXE out of memory or something?
(2012-10-21 14:38)Torgeir Wrote:  How much memory does iPXE "have"? If I reload to a new php?with variables too many times, iPXE crash.

Use the (as yet undocumented) "--replace" option to the "chain" command. This causes iPXE to do the equivalent of exec() on the new script, i.e. the new script completely replaces the calling script rather than being nested within it.

You may also be interested in the "--autofree" option, which will cause a script to be "imgfree"d automatically after it completes executing.

For example:

Code:
chain -ar http://my.web.server/replacement_script.ipxe

Michael
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-10-21, 18:57
Post: #3
RE: iPXE out of memory or something?
That did it Smile
Thank you very much.

--Torgeir
Find all posts by this user
Quote this message in a reply
Post Reply 




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