luci-app-attendedsysupgrade: Fix logic error in EFI image selection
If a non-EFI image comes first in the list of images, it would have been selected even on an EFI system. Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
This commit is contained in:
parent
1e1c6b8531
commit
cb45737d1b
1 changed files with 13 additions and 13 deletions
|
@ -85,24 +85,24 @@ return view.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
selectImage: function (images) {
|
selectImage: function (images) {
|
||||||
let image;
|
let firmware = this.firmware;
|
||||||
for (image of images) {
|
let data = this.data;
|
||||||
if (this.firmware.filesystem == image.filesystem) {
|
var filesystemFilter = function(e) {
|
||||||
|
return (e.filesystem == firmware.filesystem);
|
||||||
|
}
|
||||||
|
var typeFilter = function(e) {
|
||||||
|
if (firmware.target.indexOf("x86") != -1) {
|
||||||
// x86 images can be combined-efi (EFI) or combined (BIOS)
|
// x86 images can be combined-efi (EFI) or combined (BIOS)
|
||||||
if(this.firmware.target.indexOf("x86") != -1) {
|
if (data.efi) {
|
||||||
if (this.data.efi && image.type == 'combined-efi') {
|
return (e.type == 'combined-efi');
|
||||||
return image;
|
} else {
|
||||||
} else if (image.type == 'combined') {
|
return (e.type == 'combined');
|
||||||
return image;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (image.type == 'sysupgrade' || image.type == 'combined') {
|
return (e.type == 'sysupgrade' || e.type == 'combined');
|
||||||
return image;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return images.filter(filesystemFilter).filter(typeFilter)[0];
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handle200: function (response) {
|
handle200: function (response) {
|
||||||
|
|
Loading…
Reference in a new issue