summaryrefslogtreecommitdiff
path: root/maj
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2017-06-21 21:40:10 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2017-06-21 21:40:10 +0200
commit3a1d9159e1a22b02f5f3a28ec79e1f4da1f7740e (patch)
treee3557f5fbc098e477ad4c94a3e6f20f1747306d4 /maj
parent1c34ed8a1c6d668d1881ad8f96e5d99c91ead6a0 (diff)
downloadchd_openwrt-3a1d9159e1a22b02f5f3a28ec79e1f4da1f7740e.zip
chd_openwrt-3a1d9159e1a22b02f5f3a28ec79e1f4da1f7740e.tar.gz
chd_openwrt-3a1d9159e1a22b02f5f3a28ec79e1f4da1f7740e.tar.bz2
Improved previous tries with LEDE
- local mirroring of needed .ipk - little improovement of "profile" related legacy code (needs deeper changes)
Diffstat (limited to 'maj')
-rw-r--r--maj/gen-dev.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/maj/gen-dev.php b/maj/gen-dev.php
index 70f6966..1283bb4 100644
--- a/maj/gen-dev.php
+++ b/maj/gen-dev.php
@@ -1,19 +1,23 @@
<?php
/**
- * Copyright 2016 Ludovic Pouzenc <ludovic@pouzenc.fr>
+ *
+ * Renamed from "CHD OpenWRT" to "CHD LEDE" on 2017-06-21
+ *
+ * Copyright 2016-2017 Ludovic Pouzenc <ludovic@pouzenc.fr>
+ * Copyright 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
*
- * CHD OpenWRT is free software: you can redistribute it and/or modify
+ * CHD LEDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * CHD OpenWRT is distributed in the hope that it will be useful,
+ * CHD LEDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with CHD OpenWRT. If not, see <http://www.gnu.org/licenses/>.
+ * along with CHD LEDE. If not, see <http://www.gnu.org/licenses/>.
**/
function validate($regex, $index, $message, &$errors) {
@@ -67,20 +71,15 @@ switch ($_POST['profile']) {
case 'TLWR740':
switch($_POST['revision']) {
case '51':
- $profile="DEVICE_tl-wr740n-v5";
- $user_filename="mise-a-jour-routeur-TLWR740v5.1.bin";
- $gen_filename="bin/targets/ar71xx/generic/lede-17.01.2-ar71xx-generic-tl-wr740n-v5-squashfs-factory.bin";
+ $target="tl-wr740n-v5";
break;
case '4':
case '5':
case '6':
- $revision=str_replace('.', '', $_POST['revision']);
- $profile="DEVICE_tl-wr740n-v$revision";
- $user_filename="mise-a-jour-routeur-TLWR740v$revision.bin";
- $gen_filename="bin/targets/ar71xx/generic/lede-17.01.2-ar71xx-generic-tl-wr740n-v$revision-squashfs-factory.bin";
+ $target="tl-wr740n-v" . $_POST['revision'];
break;
default:
- $errors['revision'] = 'Routeur non supporté (' . (isset($_POST['revision'])?$_POST[$index]:'vide') . ')';
+ $errors['revision'] = 'Pas de mise à jour disponible pour l\'instant (' . (isset($_POST['revision'])?$_POST[$index]:'vide') . ')';
$res = false;
}
break;
@@ -89,22 +88,23 @@ switch ($_POST['profile']) {
case '9':
case '10':
case '11':
- $revision=$_POST['revision'];
- $profile="DEVICE_tl-wr841-v$revision";
- $user_filename="mise-a-jour-routeur-TLWR841v$revision.bin";
- $gen_filename="bin/targets/ar71xx/generic/lede-17.01.2-ar71xx-generic-tl-wr841-v$revision-squashfs-factory.bin";
+ $target="tl-wr841-v" . $_POST['revision'];
break;
default:
- $errors['revision'] = 'Routeur non supporté (' . (isset($_POST['revision'])?$_POST[$index]:'vide') . ')';
+ $errors['revision'] = 'Pas de mise à jour disponible pour l\'instant (' . (isset($_POST['revision'])?$_POST[$index]:'vide') . ')';
$res = false;
}
break;
default:
- $errors['profile'] = 'Routeur non supporté (' . (isset($_POST[$index])?$_POST['profile']:'vide') . ')';
+ $errors['profile'] = 'Pas de mise à jour disponible pour l\'instant (' . (isset($_POST[$index])?$_POST['profile']:'vide') . ')';
$res = false;
}
+$profile="DEVICE_$target";
+$user_filename="mise-a-jour-routeur-$target.bin";
+$gen_filename="bin/targets/ar71xx/generic/lede-17.01.2-ar71xx-generic-$target-squashfs-factory.bin";
+
if ( !$res ) {
echo "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\" />\n</head>\n<body>\n<h2>Oops, une erreur s'est produite</h2><div>Il y a un problème avec les renseignements fournis<br><ul>\n";
foreach ($errors as $k=>$v) {