From 92385e3d7323788fcc6421f9bfe5392864f704c8 Mon Sep 17 00:00:00 2001 From: wow <11897160+wow0000@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:22:26 +0200 Subject: [PATCH] AMT: Fix One Click Recovery support (#6301) * add support for PXE reboot/power * AMT: Fix support for OneClickRecovery --- amtmanager.js | 10 ++++++---- views/default.handlebars | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/amtmanager.js b/amtmanager.js index 95f3c593..10e19647 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -1069,7 +1069,7 @@ module.exports.CreateAmtManager = function (parent) { if (status != 200) { dev.consoleMsg("Failed to get security information (" + status + ")."); delete dev.ocrfile; return; } // Check if this Intel AMT device supports OCR - if (responses['AMT_PublicKeyCertificate'].responses['ForceUEFIHTTPSBoot'] !== true) { + if (responses['AMT_BootCapabilities'].response['ForceUEFIHTTPSBoot'] !== true) { dev.consoleMsg("This Intel AMT device does not support UEFI HTTPS boot (" + status + ")."); delete dev.ocrfile; return; } @@ -1099,11 +1099,14 @@ module.exports.CreateAmtManager = function (parent) { // Generate the one-time URL. var cookie = obj.parent.encodeCookie({ a: 'f', f: dev.ocrfile }, obj.parent.loginCookieEncryptionKey) - var url = 'https://' + parent.webserver.certificates.AmtMpsName + ':' + ((parent.args.mpsaliasport != null) ? parent.args.mpsaliasport : parent.args.mpsport) + '/c/' + cookie + '.iso'; + var url = 'https://' + parent.webserver.certificates.AmtMpsName + ':' + ((parent.args.mpsaliasport != null) ? parent.args.mpsaliasport : parent.args.mpsport) + '/c/' + cookie + '.efi'; delete dev.ocrfile; // Generate the boot data for OCR with URL var r = response.Body; + r['BIOSPause'] = false; + r['BIOSSetup'] = false; + r['EnforceSecureBoot'] = false; r['UefiBootParametersArray'] = Buffer.from(makeUefiBootParam(1, url) + makeUefiBootParam(20, 1, 1) + makeUefiBootParam(30, 0, 2), 'binary').toString('base64'); r['UefiBootNumberOfParams'] = 3; r['BootMediaIndex'] = 0; // Do not use boot media index for One Click Recovery (OCR) @@ -1124,8 +1127,7 @@ module.exports.CreateAmtManager = function (parent) { dev.amtstack.SetBootConfigRole(1, function (stack, name, response, status) { if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. if (status != 200) { dev.consoleMsg("Failed to set boot config role (" + status + ")."); return; } - var bootSource = 'Force OCR UEFI HTTPS Boot'; - dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder((bootSource == null) ? bootSource : '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSettingIntel(r) AMT: ' + bootSource + '', function (stack, name, response, status) { + dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder('
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSettingIntel(r) AMT: Force OCR UEFI HTTPS Boot', function (stack, name, response, status) { if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. if (status != 200) { dev.consoleMsg("Failed to set boot config (" + status + ")."); return; } dev.amtstack.RequestPowerStateChange(10, function (stack, name, response, status) { // 10 = Reset, 2 = Power Up diff --git a/views/default.handlebars b/views/default.handlebars index 9aea63bf..b2c9847c 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -8511,7 +8511,7 @@ // Intel AMT One Click Recovery (OCR) Q('d3localmodeform').action = 'oneclickrecovery.ashx'; Q('d3auth').value = authCookie; - Q('d3filter').value = '.iso'; + Q('d3filter').value = '.efi'; Q('d3attrib').value = currentNode._id; setDialogMode(3, "Intel® AMT One Click Recovery", 3, deviceActionOneClickRecovery); d3init();