themes: warn if booted from initramfs
authorPaul Spooren <mail@aparcar.org>
Fri, 5 Mar 2021 02:41:20 +0000 (16:41 -1000)
committerPaul Spooren <mail@aparcar.org>
Wed, 6 Oct 2021 01:33:15 +0000 (15:33 -1000)
Some devices offer a full LuCI interface from their recovery interface.
As it's read-only it should only be used for installing sysupgrades and
therefore warn users that no settings are saved.

Signed-off-by: Paul Spooren <mail@aparcar.org>
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/luci-theme-material/luasrc/view/themes/material/header.htm
themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm
themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm

index 81a23d63af6df8c0260ddf81ea9cd30ab75f6f38..d762637d8a9731c07fbe69d30797f6f14876196a 100644 (file)
                                </div>
                        <%- end -%>
 
+                       <%- if boardinfo.rootfs_type == "initramfs" then -%>
+                               <div class="alert-message warning">
+                                       <h4><%:System running in recovery (initramfs) mode.%></h4>
+                                       <p><%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%></p>
+                                       <% if disp.lookup("admin/system/flash") then %>
+                                         <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
+                                       <% end %>
+                               </div>
+                       <%- end -%>
+
                        <noscript>
                                <div class="alert-message warning">
                                        <h4><%:JavaScript required!%></h4>
index 2b890da034662781a9e97ddb393939b5f617c8d6..a81991d0a04e4927c9523f30c49ea343cc1d0f13 100644 (file)
                                <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") and path ~= "admin-system-admin-password" then -%>
                                <%- end -%>
 
+                               <%- if boardinfo.rootfs_type == "initramfs" then -%>
+                                       <div class="alert-message warning">
+                                               <h4><%:Sytem running in recovery (initramfs) mode.%></h4>
+                                               <p><%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%></p>
+                                               <% if disp.lookup("admin/system/flash") then %>
+                                                 <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
+                                               <% end %>
+                                       </div>
+                               <%- end -%>
+
                                <noscript>
                                        <div class="alert-message warning">
                                                <h4><%:JavaScript required!%></h4>
index 28589ff78194bdfd80ec46a323ed78e536a647b3..34c52f4b12288ad2561c323c10c48369a72609db 100644 (file)
                </div>
                <%- end -%>
 
+               <%- if boardinfo.rootfs_type == "initramfs" then -%>
+               <div class="alert-message warning">
+                       <h4><%:System running in recovery (initramfs) mode.%></h4>
+                       <p><%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%></p>
+                       <% if disp.lookup("admin/system/flash") then %>
+                         <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
+                       <% end %>
+               </div>
+               <%- end -%>
+
                <div id="tabmenu" style="display:none"></div>
index a17f3502634082e41b1a4b9233a0fc36c92af6ea..1d95bae886b9a8db4d96e9f6e439ef29dc4590a4 100644 (file)
                        <% end %>
                </div>
                <%- end -%>
+
+               <%- if boardinfo.rootfs_type == "initramfs" then -%>
+               <div class="alert-message warning">
+                       <h4><%:System running in recovery (initramfs) mode.%></h4>
+                       <p><%:No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade%></p>
+                       <% if disp.lookup("admin/system/flash") then %>
+                         <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
+                       <% end %>
+               </div>
+               <%- end -%>