2 Copyright
2008 Steven Barth
<steven@midlink.org
>
3 Copyright
2008-
2015 Jo-Philipp Wich
<jow@openwrt.org
>
4 Licensed to the public under the Apache License
2.0.
9 <h2 name=
"content"><%:Flash operations%
></h2>
11 <ul class=
"cbi-tabmenu">
12 <li class=
"cbi-tab"><a href=
"#"><%:Actions%
></a></li>
13 <li class=
"cbi-tab-disabled"><a href=
"<%=url('admin/system/flashops/backupfiles')%>"><%:Configuration%
></a></li>
16 <div class=
"cbi-section">
18 <div class=
"cbi-section-descr"><%:Click
"Generate archive" to download a tar archive of the current configuration files.%
></div>
19 <div class=
"cbi-section-node">
20 <form class=
"inline" method=
"post" action=
"<%=url('admin/system/flashops/backup')%>">
21 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
22 <div class=
"cbi-value<% if not reset_avail then %> cbi-value-last<% end %>">
23 <label class=
"cbi-value-title" for=
"image"><%:Download backup%
></label>
24 <div class=
"cbi-value-field">
25 <input class=
"cbi-button cbi-button-action important" type=
"submit" name=
"backup" value=
"<%:Generate archive%>" />
32 <div class=
"cbi-section-descr"><%:To restore configuration files, you can upload a previously generated backup archive here. To reset the firmware to its initial state, click
"Perform reset" (only possible with squashfs images).%
></div>
33 <div class=
"cbi-section-node">
34 <% if reset_avail then %
>
35 <form class=
"inline" method=
"post" action=
"<%=url('admin/system/flashops/reset')%>">
36 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
37 <div class=
"cbi-value cbi-value-last">
38 <label class=
"cbi-value-title"><%:Reset to defaults%
></label>
39 <div class=
"cbi-value-field">
40 <input onclick=
"return confirm('<%:Really reset all changes?%>')" class=
"cbi-button cbi-button-reset" type=
"submit" name=
"reset" value=
"<%:Perform reset%>" />
45 <form class=
"inline" method=
"post" action=
"<%=url('admin/system/flashops/restore')%>" enctype=
"multipart/form-data">
46 <div class=
"cbi-value cbi-value-last">
47 <label class=
"cbi-value-title" for=
"archive"><%:Restore backup%
></label>
48 <div class=
"cbi-value-field">
49 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
50 <input type=
"file" name=
"archive" id=
"archive" />
51 <input type=
"submit" class=
"cbi-button cbi-button-action important" name=
"restore" value=
"<%:Upload archive...%>" />
52 <% if reset_avail then %
>
53 <div class=
"cbi-value-description"><%:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%
></div>
58 <% if backup_invalid then %
>
59 <div class=
"cbi-section-error"><%:The backup archive does not appear to be a valid gzip file.%
></div>
63 <% local mtds = require(
"luci.sys").mtds(); if #mtds
> 0 then -%
>
64 <h3><%:Save mtdblock contents%
></h3>
65 <div class=
"cbi-section-descr"><%:Click
"Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )%
></div>
66 <div class=
"cbi-section-node">
67 <form class=
"inline" method=
"post" action=
"<%=url('admin/system/flashops/backupmtdblock')%>">
68 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
69 <div class=
"cbi-value">
70 <label class=
"cbi-value-title" for=
"mtdblockname"><%:Choose mtdblock%
></label>
71 <div class=
"cbi-value-field">
72 <select class=
"cbi-input-select" data-update=
"change" name=
"mtdblockname" id=
"mtdblockname">
73 <% for i, key in ipairs(mtds) do
74 if key and key.name ~=
"rootfs_data" then -%
>
76 attr(
"id",
"mtdblockname-" .. key.name) ..
77 attr(
"value", key.name .. '/'.. key.size .. '/' .. i -
1) ..
78 attr(
"data-index", i) ..
79 ifattr(key.name ==
"linux" or key.name ==
"firmware",
"selected",
"selected")
80 %
>><%=pcdata(key.name)%
></option>
86 <div class=
"cbi-value cbi-value-last<% if reset_avail then %> cbi-value-error<% end %>">
87 <label class=
"cbi-value-title" for=
"image"><%:Download mtdblock%
></label>
88 <div class=
"cbi-value-field">
89 <input type=
"submit" class=
"cbi-button cbi-button-action important" value=
"<%:Save mtdblock%>" />
98 <div class=
"cbi-section">
99 <h3><%:Flash new firmware image%
></h3>
100 <% if upgrade_avail then %
>
101 <form method=
"post" action=
"<%=url('admin/system/flashops/sysupgrade')%>" enctype=
"multipart/form-data">
102 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
103 <div class=
"cbi-section-descr"><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check
"Keep settings" to retain the current configuration (requires a compatible firmware image).%
></div>
104 <div class=
"cbi-section-node">
105 <div class=
"cbi-value">
106 <label class=
"cbi-value-title" for=
"keep"><%:Keep settings%
></label>
107 <div class=
"cbi-value-field">
108 <input type=
"checkbox" name=
"keep" id=
"keep" checked=
"checked" />
111 <% if image_invalid then %
>
112 <div class=
"cbi-value">
113 <label class=
"cbi-value-title" for=
"force"><%:Force upgrade%
></label>
114 <div class=
"cbi-value-field">
115 <input type=
"checkbox" name=
"force" id=
"force" />
117 <div class=
"cbi-section-error">
118 <%:The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform. %
>
119 <%:Select 'Force upgrade' to flash the image even if the image format check fails. Use only if you are sure that the firmware is correct and meant for your device! %
>
123 <div class=
"cbi-value cbi-value-last<% if image_invalid then %> cbi-value-error<% end %>">
124 <label class=
"cbi-value-title" for=
"image"><%:Image%
></label>
125 <div class=
"cbi-value-field">
126 <input type=
"file" name=
"image" id=
"image" />
127 <input type=
"submit" class=
"cbi-button cbi-button-action important" value=
"<%:Flash image...%>" />
133 <div class=
"cbi-section-descr"><%:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%
></div>