summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2017-11-04 17:22:58 +0100
committerLudovic Pouzenc <ludovic@pouzenc.fr>2017-11-04 17:22:58 +0100
commita66d5fa3a144602d529d22623ff129486f285f14 (patch)
treec278fd5f6606adb50a022316f92300dcb0c65e6c
parenta43dc0686985f4e61088d0c8f9d0f92fe26fae93 (diff)
downloadchd_openwrt-a66d5fa3a144602d529d22623ff129486f285f14.zip
chd_openwrt-a66d5fa3a144602d529d22623ff129486f285f14.tar.gz
chd_openwrt-a66d5fa3a144602d529d22623ff129486f285f14.tar.bz2
gen-dev: Fix for 841v11, we need -eu.bin for upgrades. + dev to prod.
-rwxr-xr-xbuild-openwrt-dev.sh7
-rwxr-xr-xbuild-openwrt.sh76
-rw-r--r--maj/gen-dev.php8
-rw-r--r--maj/gen.php44
4 files changed, 43 insertions, 92 deletions
diff --git a/build-openwrt-dev.sh b/build-openwrt-dev.sh
index 2ea9583..ac2aad4 100755
--- a/build-openwrt-dev.sh
+++ b/build-openwrt-dev.sh
@@ -40,13 +40,6 @@ fi
dnslist="185.131.40.1 fe80::31"
profile=$1
-# case "$profile" in
-# TLWR740|TLWR841)
-# ;;
-# *) echo "Unsupported profile '$profile', should be TLWR740 or TLWR841"
-# exit 2
-# ;;
-# esac
ip4pub=$2
case "$ip4pub" in
diff --git a/build-openwrt.sh b/build-openwrt.sh
index ceb61cf..ac2aad4 100755
--- a/build-openwrt.sh
+++ b/build-openwrt.sh
@@ -1,31 +1,33 @@
#!/bin/bash
#
# Work derived from ./quick_740n_ttn_bb.sh (Laurent Guerby <laurent@guery.net>)
+# Renamed from "CHD OpenWRT" to "CHD LEDE" on 2017-06-21
#
-# Copyright 2016 Ludovic Pouzenc <ludovic@pouzenc.fr>
+# Copyright 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/>.
#
echo -n "$0 - " ; date
# Directories and source file URL
BUILD_DIR=${BUILD_DIR:-./build}
CACHE_DIR=${CACHE_DIR:-.}
-ORIG_TARBALL=OpenWrt-ImageBuilder-9a1fd3e-ar71xx-generic.Linux-x86_64.tar.bz2
-ORIG_URL=http://stg2.chd.sx/openwrt/chaos_calmer/15.05.1/ar71xx/generic/$ORIG_TARBALL
-PACKAGES="luci luci-mod-admin-full ip" # Base packages
-PACKAGES="$PACKAGES luci-i18n-base-en luci-i18n-firewall-en luci-i18n-base-fr luci-i18n-firewall-fr" # internationnalisation
+ORIG_TARBALL=lede-imagebuilder-17.01.2-ar71xx-generic.Linux-x86_64.tar.xz
+ORIG_URL=https://downloads.lede-project.org/releases/17.01.2/targets/ar71xx/generic/$ORIG_TARBALL
+PACKAGES="luci luci-mod-admin-full ip kmod-leds-gpio" # Base packages
+PACKAGES="$PACKAGES luci-i18n-base-en luci-i18n-firewall-en luci-i18n-base-fr luci-i18n-firewall-fr" # internationalisation
PACKAGES="$PACKAGES -kmod-ppp -kmod-pppoe -kmod-pppox" # Unusefull kernel modules
PACKAGES="$PACKAGES -luci-proto-ppp -ppp -ppp-mod-pppoe -odhcp6c" # Unusefull packages
@@ -38,13 +40,6 @@ fi
dnslist="185.131.40.1 fe80::31"
profile=$1
-case "$profile" in
- TLWR740|TLWR841)
- ;;
- *) echo "Unsupported profile '$profile', should be TLWR740 or TLWR841"
- exit 2
- ;;
-esac
ip4pub=$2
case "$ip4pub" in
@@ -99,20 +94,6 @@ if [ ! -f "$BUILD_DIR/Makefile" ]; then
wget -O "$CACHE_DIR/$ORIG_TARBALL" "$ORIG_URL"
fi
tar -x -C "$BUILD_DIR/" --strip-components=1 -f "$CACHE_DIR/$ORIG_TARBALL"
- # Hotfix about "logd" package not availble on chaos-calmer
- patch -d "$BUILD_DIR/" -p1 <<"EOT"
---- a/include/target.mk 2017-04-01 22:00:23.000000000 +0200
-+++ b/include/target.mk 2017-04-03 20:01:23.620028730 +0200
-@@ -12,7 +12,7 @@
- DEVICE_TYPE?=router
-
- # Default packages - the really basic set
--DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools logd
-+DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools
- # For nas targets
- DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
- # For router targets
-EOT
fi
cd "$BUILD_DIR/" || exit 5
@@ -124,22 +105,7 @@ mkdir -p extra_files/etc/config extra_files/etc/dropbear extra_files/etc/hotplug
###############################
# Use local replication of repositories
-cat > repositories.conf <<"EOT"
-## Place your custom repositories here, they must match the architecture and version.
-# src/gz chaos_calmer http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages
-# src custom file:///usr/src/openwrt/bin/ar71xx/packages
-
-## Remote package repositories
-src/gz chaos_calmer_base http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/base
-src/gz chaos_calmer_luci http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/luci
-#src/gz chaos_calmer_packages http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/packages
-src/gz chaos_calmer_routing http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/routing
-#src/gz chaos_calmer_telephony http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/telephony
-#src/gz chaos_calmer_management http://localhost/openwrt/chaos_calmer/15.05.1/ar71xx/generic/packages/management
-
-## This is the local package repository, do not remove!
-src imagebuilder file:packages
-EOT
+sed --in-place -e 's#downloads.lede-project.org#localhost/lede-project#' repositories.conf
cat > extra_files/etc/dropbear/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuRKy/uRhwFvR3JrCp2NKY0HUPl0m7INUjY9wemmEGA6pSH/9zb+MLX9ZfuDVo6gkMI2YZzdpwAZ7KE2tajDXHHl+KiycY3lcQizgQt3usxf7Eqz3pTWtZBOjrHs3hRloPugg8KXA8Sxko03f68v8lfUw+Kj4LHmnnozJc8Hxde3GjkFbyL9c9Z5rSYG82H217RWaSDnjYso9wyBZYkjTe6vu88fWls3+ZL8p8NdrgqMFO7C+zV38Mgk/G3PkC9SYdobgy58Cm/06jehWonuafZ6bXTH1J3qjogbcGfewNx4H4E7Lf1nl6UTdbAC24tZu3c/UXZQzND+yRRK1r0zen lpouzenc@ttn
@@ -390,35 +356,19 @@ cat > extra_files/etc/hotplug.d/button/01onoff <<"EOF"
}
EOF
-cat > extra_files/etc/banner <<"EOF"
- _______ ________ __
- | |.-----.-----.-----.| | | |.----.| |_
- | - || _ | -__| || | | || _|| _|
- |_______|| __|_____|__|__||________||__| |____|
- |__| W I R E L E S S F R E E D O M
- -----------------------------------------------------
- CHAOS CALMER (15.05.1, 9a1fd3e 2017-03-09)
- -----------------------------------------------------
- * 1 1/2 oz Gin Shake with a glassful
- * 1/4 oz Triple Sec of broken ice and pour
- * 3/4 oz Lime Juice unstrained into a goblet.
- * 1 1/2 oz Orange Juice
- * 1 tsp. Grenadine Syrup
- -----------------------------------------------------
-EOF
#######################
# Build Openwrt image #
#######################
make clean
-make image PROFILE=$profile PACKAGES="$PACKAGES" FILES="extra_files/"
+make image PROFILE=$profile PACKAGES="$PACKAGES" FILES="extra_files/" V=99
res=$?
echo
if [ $res -eq 0 ]
then echo "Image ready: "
- ls -la bin/ar71xx/openwrt*ar71xx-generic-tl-*-v*-squashfs-*
+ ls -la bin/targets/ar71xx/generic/*ar71xx-generic-tl-*-v*-squashfs-*
echo
else echo "Something went wrong, sorry"
fi
diff --git a/maj/gen-dev.php b/maj/gen-dev.php
index 1283bb4..cc08e5d 100644
--- a/maj/gen-dev.php
+++ b/maj/gen-dev.php
@@ -67,6 +67,7 @@ $res &= validate($pattern_int, 'txpower', 'Puissance d\'émission WiFi incorrect
$res &= checksame('pwd1', 'pwd2', 'Les mots de passes ne correspondent pas', $errors);
$res &= checksame('key1', 'key2', 'Les mots de passes ne correspondent pas', $errors);
+$region="";
switch ($_POST['profile']) {
case 'TLWR740':
switch($_POST['revision']) {
@@ -75,7 +76,7 @@ switch ($_POST['profile']) {
break;
case '4':
case '5':
- case '6':
+ /* case '6': # PAS TESTE, on en a pas */
$target="tl-wr740n-v" . $_POST['revision'];
break;
default:
@@ -87,8 +88,11 @@ switch ($_POST['profile']) {
switch($_POST['revision']) {
case '9':
case '10':
+ $target="tl-wr841-v" . $_POST['revision'];
+ break;
case '11':
$target="tl-wr841-v" . $_POST['revision'];
+ $region="-eu";
break;
default:
$errors['revision'] = 'Pas de mise à jour disponible pour l\'instant (' . (isset($_POST['revision'])?$_POST[$index]:'vide') . ')';
@@ -103,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.bin";
+$gen_filename="bin/targets/ar71xx/generic/lede-17.01.2-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";
diff --git a/maj/gen.php b/maj/gen.php
index e2d8486..e6bb308 100644
--- a/maj/gen.php
+++ b/maj/gen.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) {
@@ -63,24 +67,20 @@ $res &= validate($pattern_int, 'txpower', 'Puissance d\'émission WiFi incorrect
$res &= checksame('pwd1', 'pwd2', 'Les mots de passes ne correspondent pas', $errors);
$res &= checksame('key1', 'key2', 'Les mots de passes ne correspondent pas', $errors);
+$region="";
switch ($_POST['profile']) {
case 'TLWR740':
switch($_POST['revision']) {
case '51':
- $profile='TLWR740';
- $user_filename="mise-a-jour-routeur-TLWR740v5.1.bin";
- $gen_filename="bin/ar71xx/openwrt-ar71xx-generic-tl-wr740n-v5-squashfs-factory.bin";
+ $target="tl-wr740n-v5";
break;
case '4':
case '5':
- case '6':
- $profile='TLWR740';
- $revision=$_POST['revision'];
- $user_filename="mise-a-jour-routeur-TLWR740v$revision.bin";
- $gen_filename="bin/ar71xx/openwrt-ar71xx-generic-tl-wr740n-v$revision-squashfs-factory.bin";
+ /* case '6': # PAS TESTE, on en a pas */
+ $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;
@@ -88,23 +88,27 @@ switch ($_POST['profile']) {
switch($_POST['revision']) {
case '9':
case '10':
-/* case '11': XXX un 841n V11.1 a été briqué le 07/06/2017, à investiguer */
- $profile='TLWR841';
- $revision=$_POST['revision'];
- $user_filename="mise-a-jour-routeur-TLWR841v$revision.bin";
- $gen_filename="bin/ar71xx/openwrt-ar71xx-generic-tl-wr841n-v$revision-squashfs-factory.bin";
+ $target="tl-wr841-v" . $_POST['revision'];
+ break;
+ case '11':
+ $target="tl-wr841-v" . $_POST['revision'];
+ $region="-eu";
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$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";
foreach ($errors as $k=>$v) {