From 0bd55d7d61a06b913064eb986330682c5a3929a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 24 Sep 2018 23:09:11 +0300 Subject: [PATCH] Move image builder to OpenWrt 18.06.1 --- certidude/api/builder.py | 8 +++++--- certidude/builder/common.sh | 13 +++++++------ certidude/templates/server/builder.conf | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/certidude/api/builder.py b/certidude/api/builder.py index 24ae719..d612b16 100644 --- a/certidude/api/builder.py +++ b/certidude/api/builder.py @@ -55,8 +55,9 @@ class ImageBuilderResource(object): raise falcon.HTTPInternalServerError("Build script finished with non-zero exitcode") for dname in os.listdir(build): - if dname.startswith("lede-imagebuilder-"): - for root, dirs, files in os.walk(os.path.join(build, dname, "bin", "targets")): + if dname.startswith("openwrt-imagebuilder-") and ".tar." not in dname: + subdir = os.path.join(build, dname, "bin", "targets") + for root, dirs, files in os.walk(subdir): for filename in files: if filename.endswith(suffix): path = os.path.join(root, filename) @@ -64,5 +65,6 @@ class ImageBuilderResource(object): resp.body = open(path, "rb").read() resp.set_header("Content-Disposition", ("attachment; filename=%s" % suggested_filename)) return - raise falcon.HTTPNotFound() + raise falcon.HTTPNotFound(description="Couldn't find file ending with '%s' in directory %s" % (suffix, subdir)) + raise falcon.HTTPNotFound(description="Failed to find image builder directory in %s" % build) diff --git a/certidude/builder/common.sh b/certidude/builder/common.sh index 874e193..bbdeaba 100644 --- a/certidude/builder/common.sh +++ b/certidude/builder/common.sh @@ -4,17 +4,18 @@ set -e set -x umask 022 -VERSION=17.01.4 -BASENAME=lede-imagebuilder-$VERSION-ar71xx-generic.Linux-x86_64 +VERSION=18.06.1 +BASENAME=openwrt-imagebuilder-$VERSION-ar71xx-generic.Linux-x86_64 FILENAME=$BASENAME.tar.xz -URL=http://downloads.lede-project.org/releases/$VERSION/targets/ar71xx/generic/$FILENAME +URL=http://downloads.openwrt.org/releases/$VERSION/targets/ar71xx/generic/$FILENAME -# curl of vanilla LEDE doesn't support ECDSA at the moment -BASENAME=lede-imagebuilder-ar71xx-generic.Linux-x86_64 +# curl of vanilla OpenWrt a the moment +# - doesn't support ECDSA +# - is compiled against embedded TLS library which doesn't support OCSP +BASENAME=openwrt-imagebuilder-ar71xx-generic.Linux-x86_64 FILENAME=$BASENAME.tar.xz URL=https://www.koodur.com/$FILENAME - if [ ! -e $BUILD/$FILENAME ]; then wget -q $URL -O $BUILD/$FILENAME fi diff --git a/certidude/templates/server/builder.conf b/certidude/templates/server/builder.conf index 4c94dab..b9b9ae8 100644 --- a/certidude/templates/server/builder.conf +++ b/certidude/templates/server/builder.conf @@ -61,7 +61,7 @@ enabled = no title = Comfast E380AC (Access Point), TFTP-friendly command = {{ builder_path }}/ap.sh model = cf-e380ac-v2 -filename = cf-e380ac-v2-squashfs-factory.bin +filename = cf-e380ac-v2-squashfs-sysupgrade.bin rename = firmware_auto.bin