1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

F #2481: UEFI firmware secure on Custom (#1489)

This commit is contained in:
Frederick Borges 2021-09-28 16:44:39 +02:00 committed by GitHub
parent 96e7a3bdbc
commit a55ca915d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,6 +138,7 @@ define(function(require) {
"EFI": false,
"/usr/share/OVMF/OVMF_CODE.fd": false,
"/usr/share/OVMF/OVMF_CODE.secboot.fd": true,
"custom": true
};
var distinct = function(value, index, self){
@ -278,6 +279,7 @@ define(function(require) {
that.initrdFilesTable.refreshResourceTableSelect();
$("#firmwareType", context).change(function() {
console.log($(this).val())
if (FIRMWARE_VALUES[$(this).val()]){
$("#firmwareSecure", context).show();
}
@ -360,6 +362,10 @@ define(function(require) {
osJSON["BOOT"] = boot;
}
if (FIRMWARE_VALUES[osJSON["FIRMWARE"]]){
osJSON["FIRMWARE_SECURE"] = $("#secureFirmwareValue", context).is(':checked') ? "YES" : "NO";
}
if (osJSON["FIRMWARE"]){
switch (osJSON["FIRMWARE"]) {
case "custom":
@ -373,10 +379,6 @@ define(function(require) {
}
}
if (FIRMWARE_VALUES[osJSON["FIRMWARE"]]){
osJSON["FIRMWARE_SECURE"] = $("#secureFirmwareValue", context).is(':checked') ? "YES" : "NO";
}
if (!$.isEmptyObject(osJSON)) {
templateJSON["OS"] = osJSON;
}
@ -412,10 +414,10 @@ define(function(require) {
$("input[value=\"initrd_path\"]", context).click();
}
if (!Object.keys(FIRMWARE_VALUES).includes(osJSON["FIRMWARE"])){
$("#firmwareType", context).val("custom");
$("#customFirmware", context).show();
$("#firmwareSecure", context).show();
$("#customFirmwarePath", context).val(osJSON["FIRMWARE"]);
delete osJSON["FIRMWARE"];
}