iPXE discussion forum
UEFI: command not found - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: UEFI: command not found (/showthread.php?tid=24961)



UEFI: command not found - dfear - 2020-07-16 23:49

Hi

I have a php based ipxe menu system based on:
https://github.com/skunkie/ipxe-phpmenu

However one of my scripts fails to work. the error message is:
UEFI: command not found
Could not boot: Exec format error (http://ipxe.org/2e022001)
Could not boot: Exec format error (http://ipxe.org/2e022001)

the script in question is: win10_64_home_autowipe_winpe81_ps_sqlite.php
contents:
PHP Code:
<?php
require_once($_SERVER['DOCUMENT_ROOT']."/php/pickleboot/params.php");

echo 
"cpuid --ext 29 && set arch x86_64 || set arch i386\n";
echo 
"param arch \${arch}\n";
echo 
"param wim_arch \${arch}\n";
echo 
"param wim_arch i386\n"//32-bit override
echo "param wim boot.wim\n";
echo 
"param wim_winver 8.1\n";
echo 
"param wim_stablilty testing\n";

echo 
"param platform \${platform}\n";
echo 
"param memsize \${memsize}\n";
echo 
"set winver:string 10\n";
echo 
"set winedition:string home\n";
echo 
"param winver \${winver}\n";
echo 
"param winedition \${winedition}\n";
echo 
"param uuid \${uuid}\n";

echo 
"imgfetch http://boot.lan/php/pickleboot/menu/root_sections/winpes/windows_install_data_sender.php##params || echo can't POST\n";

echo 
"chain --replace --autofree {$url}libs/wimboot.php##params\n";

?>

Even with the last two lines commented out I still get the same error,

the contents of: win10_64_home_autowipe_winpe81_ps_sqlite.php
are:
PHP Code:
<?php

require_once($_SERVER['DOCUMENT_ROOT']."/php/pickleboot/params.php");

$myfile fopen("/srv/http/boot.lan/php/pickleboot/menu/submenus/winpes/mydata""wb") or die("Unable to open file!");

function 
is_base64_encoded($data)
    {
        if (
preg_match('%^[a-zA-Z0-9/+]*={0,2}$%'$data)) {
            return 
TRUE;
        } else {
            return 
FALSE;
        }
    };

unset(
$_POST["username"]); 
unset(
$_POST["password"]);

$wim_arch $_POST["wim_arch"];
$wim $_POST["wim"];
$wim_winver $_POST["wim_winver"];
$wim_stablilty $_POST["wim_stablilty"];
unset(
$_POST["wim_arch"]);
unset(
$_POST["wim"]);
unset(
$_POST["wim_winver"]);
unset(
$_POST["wim_stablilty"]);

$txt json_encode($_POST);
fwrite($myfile$txt);
fclose($myfile);

?>


the contents of: win10_64_home_autowipe_winpe81_ps_sqlite.php
are:
PHP Code:
<?php

require_once($_SERVER['DOCUMENT_ROOT']."/php/pickleboot/params.php");

if (isset(
$_POST['wim_arch'])) { $wim_arch $_POST['wim_arch']; }
if (isset(
$_POST['wim'])) { $wim $_POST['wim']; }
if (isset(
$_POST['wim_winver'])) { $wim_winver $_POST['wim_winver']; }
if (isset(
$_POST['wim_stablilty'])) { $wim_stablilty $_POST['wim_stablilty']; }
if (isset(
$_POST['isCustom'])) { $isCustom $_POST['isCustom']; }
if (isset(
$_POST['customImageFolder'])) { $customImageFolder $_POST['customImageFolder']; }
if (isset(
$_POST['customImageBootmgrFolder'])) { $customImageBootmgrFolder $_POST['customImageBootmgrFolder']; }

//echo "initrd {$images_url}winpe/WIMS/{$wim_arch}/sources/{$wim}  boot.wim\n";
/* echo "initrd {$images_url}winpe/WIMS/{$wim_winver}/{$wim_arch}/{$wim_stablilty}/{$wim}  boot.wim\n"; */
if ($isCustom == 1) {
    echo 
"kernel {$url}bin/wimboot/wimboot\n";

    
//echo "initrd {$images_url}winpe/Win10PESE_rescue/\${wim_arch}/BOOTMGR         BOOTMGR\n";
    
echo "initrd {$images_url}winpe/Win10PESE_rescue/boot/\${wim_arch}/bootmgr.exe         bootmgr.exe\n";
    echo 
"initrd {$images_url}winpe/Win10PESE_rescue/\${wim_arch}/BOOT/BCD             BCD\n";
    echo 
"initrd {$images_url}winpe/Win10PESE_rescue/\${wim_arch}/BOOT/BOOT.SDI        BOOT.SDI\n";
    echo 
"initrd {$images_url}{$customImageFolder}/{$wim}  boot.wim\n";
    
//echo "imgfetch --name bootmgr.exe {$images_url}{$customImageBootmgrFolder}/bootmgr.exe bootmgr.exe\n";
} else {
    echo 
"kernel {$url}bin/wimboot/wimboot\n";
    echo 
"initrd {$url}bin/wimboot/{$wim_arch}/bootmgr.exe         bootmgr\n";
    echo 
"initrd {$url}bin/wimboot/{$wim_arch}/BCD             BCD\n";
    echo 
"initrd {$url}bin/wimboot/{$wim_arch}/boot.sdi        boot.sdi\n";
    echo 
"initrd {$images_url}winpe/WIMS/{$wim_winver}/{$wim_arch}/{$wim_stablilty}/{$wim}  boot.wim\n";
}
echo 
"boot\n";

?>


Please help me fix this error.

p.s. i typed "show platform" on the ixpe shell and the result was: builtin/platform:string = pcbios

Thanks

David