iPXE discussion forum

Full Version: poweroff command not working after memtest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using undionly.kpxe compiled with the POWEROFF_CMD line in config/general.h.

If I go to an interactive iPXE shell and type 'poweroff' it works fine.
If I then chain memtest with the following:

chain memtest.0 onepass onefail && set memtest GOOD || set memtest BAD

(downloaded from here: http://boot.ipxe.org/memtest.0) and then go back to the interactive shell and type 'poweroff' I get the following error:

Could not poweroff: No such file or directory (http://ipxe.org/2d90203b)

I get the same behaviour from within a script. Every now and then it does still work, but the majority of the time it gives the error above.
I can't determine if it's memtest that is breaking it or whether it's something else.
Anyone any ideas?
memtest pretty much cleanouts all of the memory state, as it seems from the error url the ACPI table used for doing poweroff does not exist, and that is likely due to memtest messing with things it shouldn't mess with.

Sorry I don't have any suggestions or workaround other then using reboot and chaining into ipxe again which could then do a poweroff with some serverside state and scripting.
(2016-09-23 22:58)NiKiZe Wrote: [ -> ]memtest pretty much cleanouts all of the memory state, as it seems from the error url the ACPI table used for doing poweroff does not exist, and that is likely due to memtest messing with things it shouldn't mess with.

Sorry I don't have any suggestions or workaround other then using reboot and chaining into ipxe again which could then do a poweroff with some serverside state and scripting.

OK. Rebooting and then powering off is an acceptable workaround. Thanks for the suggestion Smile
In case anyone else is interested. Here was my solution - it is definitely a bit of a hack!

I stuck this at the beginning of my script

Code:
chain poweroff/${mac:hexraw}.ipxe ||

and put the following in poweroff/poweroff.php

PHP Code:
#!ipxe

<?php

$mac 
$_GET["mac"];
$action $_GET["action"];

if (
$action == "create") {
    
file_put_contents("$mac.ipxe""#!ipxe\nchain poweroff.php?mac=$mac&action=delete");
    echo 
"reboot";
} elseif (
$action == "delete") {
    
unlink("$mac.ipxe");
    echo 
"poweroff";
}

?>

Then I called poweroff with
Code:
chain poweroff/poweroff.php?mac=${mac:hexraw}&action=create

Maybe that's useful for someone else.
Hi everybody

About "chain memtest.0 onepass onefail && set memtest GOOD || set memtest BAD " ,
means, memtest.0 run 1 round and stop,

but how to make memtest.0 run 4 rounds?

I've tried:
"chain memtest.0 4pass onefail && set memtest GOOD || set memtest BAD "
"chain memtest.0 fourpass onefail && set memtest GOOD || set memtest BAD "
but no luck,
any suggestion is appreciated.
(2018-04-27 07:57)rexqian Wrote: [ -> ]how to make memtest.0 run 4 rounds?

I've tried:
"chain memtest.0 4pass onefail && set memtest GOOD || set memtest BAD "
"chain memtest.0 fourpass onefail && set memtest GOOD || set memtest BAD "
but no luck,
any suggestion is appreciated.

There is no such option, and it don't make much difference from a diagnostics point of view, you can run 100times and still not get any errors, but get one at run 101, and you could also get one at the first run and not ever again. (cosmic radiation might even cause this)
If you would like to run it multiple times I would suggest that you restart memtest 3 times with a counter in the iPXE script instead.

If you really want "fourpass" to exist then you can easily add this to the sourcecode, see https://git.ipxe.org/people/mcb30/memtes...ain.c#l330

And finally I would like to mention b800.org which i created for logging the output from memtest, for example see: https://b800.org/using_ipxe.php (There is also a few screenshots on the page)


initial support for building memtest.0 for the 501 version was added in https://git.ipxe.org/people/mcb30/memtes...215a5b9ec9 so you need to check out the pxe501 branch of the above repo
thank you nikze, i get what i need by following your suggestion.
Reference URL's