luci-app-attendedsysupgrade: fix missing efi path
authorPaul Spooren <mail@aparcar.org>
Wed, 9 Mar 2022 10:29:59 +0000 (11:29 +0100)
committerPaul Spooren <mail@aparcar.org>
Wed, 9 Mar 2022 10:31:25 +0000 (11:31 +0100)
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>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js

index 8c1a5a84b181240a2a80c67378c5d83f91eee364..a82f7bdbed83d3581aad989c33abf4af56607855 100644 (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'),
                ]);