Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
poweroff command not working after memtest
2016-09-20, 13:23
Post: #1
poweroff command not working after memtest
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?
Find all posts by this user
Quote this message in a reply
2016-09-23, 22:58
Post: #2
RE: poweroff command not working after memtest
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.

Read the FAQ before posting.
Did you include relevant ipxe.org error urls?
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-09-26, 15:17 (This post was last modified: 2016-09-26 15:59 by johnpaul.)
Post: #3
RE: poweroff command not working after memtest
(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.
Find all posts by this user
Quote this message in a reply
2018-04-27, 07:57
Post: #4
RE: poweroff command not working after memtest
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.
Find all posts by this user
Quote this message in a reply
2018-04-27, 19:46 (This post was last modified: 2018-04-28 06:28 by NiKiZe.)
Post: #5
RE: poweroff command not working after memtest
(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: http://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

Read the FAQ before posting.
Did you include relevant ipxe.org error urls?
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-05-02, 09:28
Post: #6
RE: poweroff command not working after memtest
thank you nikze, i get what i need by following your suggestion.
Find all posts by this user
Quote this message in a reply
Post Reply 




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