AMT: Fix One Click Recovery support (#6301)
* add support for PXE reboot/power * AMT: Fix support for OneClickRecovery
wow committed
Aug 13, 2024 at 22:22 UTC
92385e3d7323788fcc6421f9bfe5392864f704c8
2 files changed
+7
-5
amtmanager.js
+6
-4
@@ -1069,7 +1069,7 @@ module.exports.CreateAmtManager = function (parent) {
1069
if (status != 200) { dev.consoleMsg("Failed to get security information (" + status + ")."); delete dev.ocrfile; return; }
1070
1071
// Check if this Intel AMT device supports OCR
1072
- if (responses['AMT_PublicKeyCertificate'].responses['ForceUEFIHTTPSBoot'] !== true) {
1072
+ if (responses['AMT_BootCapabilities'].response['ForceUEFIHTTPSBoot'] !== true) {
1073
dev.consoleMsg("This Intel AMT device does not support UEFI HTTPS boot (" + status + ")."); delete dev.ocrfile; return;
1074
}
1075
@@ -1099,11 +1099,14 @@ module.exports.CreateAmtManager = function (parent) {
1099
1100
// Generate the one-time URL.
1101
var cookie = obj.parent.encodeCookie({ a: 'f', f: dev.ocrfile }, obj.parent.loginCookieEncryptionKey)
1102
- var url = 'https://' + parent.webserver.certificates.AmtMpsName + ':' + ((parent.args.mpsaliasport != null) ? parent.args.mpsaliasport : parent.args.mpsport) + '/c/' + cookie + '.iso';
1102
+ var url = 'https://' + parent.webserver.certificates.AmtMpsName + ':' + ((parent.args.mpsaliasport != null) ? parent.args.mpsaliasport : parent.args.mpsport) + '/c/' + cookie + '.efi';
1103
delete dev.ocrfile;
1104
1105
// Generate the boot data for OCR with URL
1106
var r = response.Body;
1107
+ r['BIOSPause'] = false;
1108
+ r['BIOSSetup'] = false;
1109
+ r['EnforceSecureBoot'] = false;
1110
r['UefiBootParametersArray'] = Buffer.from(makeUefiBootParam(1, url) + makeUefiBootParam(20, 1, 1) + makeUefiBootParam(30, 0, 2), 'binary').toString('base64');
1111
r['UefiBootNumberOfParams'] = 3;
1112
r['BootMediaIndex'] = 0; // Do not use boot media index for One Click Recovery (OCR)
@@ -1124,8 +1127,7 @@ module.exports.CreateAmtManager = function (parent) {
1127
dev.amtstack.SetBootConfigRole(1, function (stack, name, response, status) {
1128
if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.
1129
if (status != 200) { dev.consoleMsg("Failed to set boot config role (" + status + ")."); return; }
1127
- var bootSource = 'Force OCR UEFI HTTPS Boot';
1128
- dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder((bootSource == null) ? bootSource : '<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: ' + bootSource + '</Selector></SelectorSet></ReferenceParameters>', function (stack, name, response, status) {
1130
+ dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder('<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: Force OCR UEFI HTTPS Boot</Selector></SelectorSet></ReferenceParameters>', function (stack, name, response, status) {
1131
if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.
1132
if (status != 200) { dev.consoleMsg("Failed to set boot config (" + status + ")."); return; }
1133
dev.amtstack.RequestPowerStateChange(10, function (stack, name, response, status) { // 10 = Reset, 2 = Power Up
views/default.handlebars
+1
-1
@@ -8511,7 +8511,7 @@
8511
// Intel AMT One Click Recovery (OCR)
8512
Q('d3localmodeform').action = 'oneclickrecovery.ashx';
8513
Q('d3auth').value = authCookie;
8514
- Q('d3filter').value = '.iso';
8514
+ Q('d3filter').value = '.efi';
8515
Q('d3attrib').value = currentNode._id;
8516
setDialogMode(3, "Intel® AMT One Click Recovery", 3, deviceActionOneClickRecovery);
8517
d3init();