summaryrefslogtreecommitdiff
path: root/maj
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2017-11-07 14:30:24 +0100
committerLudovic Pouzenc <ludovic@pouzenc.fr>2017-11-07 14:32:18 +0100
commit265c646a5b6f6e8199d7915ae45783a6da143807 (patch)
tree356f707a64cc4dd793a444154fd1594c18769be5 /maj
parenta66d5fa3a144602d529d22623ff129486f285f14 (diff)
downloadchd_openwrt-265c646a5b6f6e8199d7915ae45783a6da143807.zip
chd_openwrt-265c646a5b6f6e8199d7915ae45783a6da143807.tar.gz
chd_openwrt-265c646a5b6f6e8199d7915ae45783a6da143807.tar.bz2
prod: Fix tx_power : allow 18dB max and default to 17. Tested on 740v5 and 841v9.
dev : rework all the presset config from vanilla LEDE 17.01.4. Set LuCI to fr.
Diffstat (limited to 'maj')
-rw-r--r--maj/gen-dev.php15
-rw-r--r--maj/index.php2
2 files changed, 11 insertions, 6 deletions
diff --git a/maj/gen-dev.php b/maj/gen-dev.php
index cc08e5d..d6004f2 100644
--- a/maj/gen-dev.php
+++ b/maj/gen-dev.php
@@ -107,7 +107,7 @@ switch ($_POST['profile']) {
$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$region.bin";
+$gen_fileglob="bin/targets/ar71xx/generic/lede-*-ar71xx-generic-$target-squashfs-factory$region.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";
@@ -153,21 +153,26 @@ if ( ! flock($fh, LOCK_EX) ) {
exit();
}
+// Run the imagebuilder make command
putenv("CACHE_DIR=$basepath/");
putenv("BUILD_DIR=$basepath/build/");
exec($command, $output, $return_val);
+// Match produced file against expected filename
+$gen_matchedfiles = glob("$basepath/build/$gen_fileglob");
+
// Dump script output in /tmp for troobleshooting
file_put_contents(tempnam('/tmp' , $scriptfile.'_'), array($command, "\n", print_r($output,true), "\n",$return_val,"\n"));
-
-if ( $return_val === 0 ) {
+if ( $return_val === 0 && count($gen_matchedfiles) === 1) {
header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=$user_filename");
- readfile("$basepath/build/$gen_filename");
+ readfile($gen_matchedfiles[0]);
} else {
echo "<pre>\n$command\n\n";
echo join($output, "\n") . "\n\n";
- echo "Command return value : "; var_dump($return_val);
+ echo "Expected file pattern : '$basepath/build/$gen_fileglob'"; echo "\n";
+ echo "Matched files : "; print_r($gen_matchedfiles); echo "\n";
+ echo "Command return value : "; var_dump($return_val); echo "\n";
}
fclose($fh);
diff --git a/maj/index.php b/maj/index.php
index ad6bea2..e5b478d 100644
--- a/maj/index.php
+++ b/maj/index.php
@@ -106,7 +106,7 @@ $( document ).ready(function() {
</span>
<label>Puissance d'émission WiFi&nbsp;:</label>
<span>
- <input id="field_txpower" style="width: 14.8em;" type="range" min="-1" max="16" value="13" title="Merci de choisir la puissance d'émission du WiFi à l'intérieur de l'habitat.&#10;L'échelle va de 0 dBm (1 mW) à 16 dBm (39 mW), hors gain d'antenne." name="txpower">
+ <input id="field_txpower" style="width: 14.8em;" type="range" min="-1" max="18" value="17" title="Merci de choisir la puissance d'émission du WiFi à l'intérieur de l'habitat.&#10;L'échelle va de 0 dBm (1 mW) à 18 dBm (63 mW)" name="txpower">
<table><tr><td style="width:8em">Désactivé</td><td style="width:9em;">Moyen</td><td>Fort</td></table>
</span>