luci-app-attendedsysupgrade: fix missing efi path

If running on a non EFI system, the file `/sys/firmware/efi` is not
available and therefore results in an error of `fs.stat`. Wrap it with
`L.resolveDefault` to avoid the error message and make it work on
non-EFI devices again.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren 2022-03-09 11:29:59 +01:00
parent 1eddbe0f3f
commit 65266c490a

View file

@ -401,7 +401,7 @@ return view.extend({
return Promise.all([
L.resolveDefault(callPackagelist(), {}),
L.resolveDefault(callSystemBoard(), {}),
fs.stat("/sys/firmware/efi"),
L.resolveDefault(fs.stat("/sys/firmware/efi"), null),
fs.read("/proc/mounts"),
uci.load('attendedsysupgrade'),
]);