summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-04-21 15:37:38 +0200
committerKarel Kočí <cynerd@email.cz>2020-04-21 15:37:38 +0200
commit8eff39554cd59298791cef1852e1e9133443cd91 (patch)
treef3affb8ec8bb9f9e08a25136369261a62348cb67
parent92b7a6d42c807820ce64b1eec3c2ff395e8d021e (diff)
downloadlaminar-cnf-8eff39554cd59298791cef1852e1e9133443cd91.tar.gz
laminar-cnf-8eff39554cd59298791cef1852e1e9133443cd91.tar.bz2
laminar-cnf-8eff39554cd59298791cef1852e1e9133443cd91.zip
turris: patch openwrt version checkout
-rw-r--r--files/openwrt-hash.patch13
-rwxr-xr-xtemplates/turris.run1
2 files changed, 14 insertions, 0 deletions
diff --git a/files/openwrt-hash.patch b/files/openwrt-hash.patch
new file mode 100644
index 0000000..35a06c4
--- /dev/null
+++ b/files/openwrt-hash.patch
@@ -0,0 +1,13 @@
+diff --git a/compile_pkgs b/compile_pkgs
+index 3a04a5c..30d1ce7 100755
+--- a/compile_pkgs
++++ b/compile_pkgs
+@@ -62,7 +62,7 @@ openwrt_feed() {
+ # OpenWRT git repository URL
+ OPENWRT_URL="$(sed -n 's/# openwrt \([^;^]\+\).*/\1/p' "$src_dir/feeds.conf")"
+ # Git reference used to checkout OpenWRT repository
+- OPENWRT_BRANCH="$(sed -n 's/# openwrt [^;^]\+[;^]\([^\s]\+\).*/\1/p' "$src_dir/feeds.conf")"
++ OPENWRT_BRANCH="$(sed -n 's/# openwrt [^;^]\+[;^]\([^[:blank:]]\+\).*/\1/p' "$src_dir/feeds.conf")"
+ # Check if ^ is used to separate URL and branch and in such case it is hash not branch
+ grep -E '^# openwrt [^;^]+\^.+' "$src_dir/feeds.conf" && OPENWRT_BRANCH="#$OPENWRT_BRANCH"
+ [ -n "$OPENWRT_BRANCH" ] || OPENWRT_BRANCH="master"
diff --git a/templates/turris.run b/templates/turris.run
index 16bda3d..5608f06 100755
--- a/templates/turris.run
+++ b/templates/turris.run
@@ -24,6 +24,7 @@ else
git_fetch_t "https://gitlab.labs.nic.cz/turris/turris-build.git" turris-build "$ANIMAL"
(
cd turris-build
+ patch -p1 < "$FILES/openwrt-hash.patch"
"$FILES/turris_checkout_repo_branch.sh" "$ANIMAL"
cat feeds.conf
)