Skip to content

Commit

Permalink
Merge branch 'separate_patches-dir' (PR #714)
Browse files Browse the repository at this point in the history
Fixes Issue #734
  • Loading branch information
SvenRoederer committed Dec 8, 2019
2 parents 93e6ca8 + b810baa commit bdaa79b
Show file tree
Hide file tree
Showing 25 changed files with 426 additions and 152 deletions.
117 changes: 80 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,76 @@ PROFILES=$(shell cat $(FW_DIR)/profiles/$(MAINTARGET)-$(SUBTARGET).profiles)

FW_REVISION=$(shell $(REVISION))

define FEEDS
$(shell ./scripts/ffberlin_feeds.sh)
endef

default: firmwares

# clone openwrt
$(OPENWRT_DIR):
$(UMASK); \
git clone $(OPENWRT_SRC) $(OPENWRT_DIR)
## Gluon - Begin
# compatibility to Gluon.buildsystem
# * setup required makros and variables
# * create the modules-file from config.mk and feeds.conf

# check for spaces & resolve possibly relative paths
define mkabspath
ifneq (1,$(words [$($(1))]))
$$(error $(1) must not contain spaces)
endif
override $(1) := $(abspath $($(1)))
endef

# initialize (possibly already user set) directory variables
GLUON_TMPDIR ?= tmp
GLUON_PATCHESDIR ?= patches

$(eval $(call mkabspath,GLUON_TMPDIR))
$(eval $(call mkabspath,GLUON_PATCHESDIR))

export GLUON_TMPDIR GLUON_PATCHESDIR

# use .stamp-gluon-module-openwrt and .stamp-gluon-module- of each feed to create modules-file
$(FW_DIR)/modules: $(addprefix .stamp-gluon-module-,$(FEEDS)) .stamp-gluon-module-openwrt
rm -f $@
cat >>$@ .stamp-gluon-module-openwrt
cat >>$@ $(addprefix .stamp-gluon-module-,$(FEEDS))
echo >>$@ GLUON_FEEDS=\'$(FEEDS)\'

.stamp-gluon-module-openwrt: $(FW_DIR)/config.mk
rm -f $@
echo >>$@ "OPENWRT_REPO=$(OPENWRT_SRC)"
echo >>$@ "OPENWRT_COMMIT=$(OPENWRT_COMMIT)"
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev --refs openwrt-* $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 2 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "OPENWRT_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@

.stamp-gluon-module-%: $(FW_DIR)/feeds.conf
rm -f $@
# set the $FEED-REPO
@echo -n "PACKAGES_$*_REPO=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$3 }' >>$@
# set the $FEED-COMMIT
@echo -n "PACKAGES_$*_COMMIT=" | tr '[:lower:]' '[:upper:]' >>$@
@grep -E "^src-(git|svn)[[:space:]]$*[[:space:]].*" $(FW_DIR)/feeds.conf | \
awk -F '([[:space:]|^])' '{ print $$4 }' >>$@
# set the $FEED-Branch
git clone $$(grep _REPO $@ | cut -d "=" -f 2) $(GLUON_TMPDIR)/gluon_$@
cd $(GLUON_TMPDIR)/gluon_$@; git name-rev $$(grep _COMMIT $(FW_DIR)/$@ | \
cut -d "=" -f 2) | cut -d / -f 3 | cut -d \~ -f 1 >branchname.txt
cd $(GLUON_TMPDIR)/gluon_$@; grep -q master branchname.txt || \
printf >>$(FW_DIR)/$@ "PACKAGES_%s_BRANCH=%s\n" \
$$(echo $* | tr '[:lower:]' '[:upper:]') \
$$(cat branchname.txt)
rm -rf $(GLUON_TMPDIR)/gluon_$@

## Gluon - End

# clean up openwrt working copy
openwrt-clean: stamp-clean-openwrt-cleaned .stamp-openwrt-cleaned
Expand All @@ -60,38 +124,22 @@ openwrt-clean-bin:
rm -rf $(OPENWRT_DIR)/bin
rm -rf $(OPENWRT_DIR)/build_dir/target-*/*-{imagebuilder,sdk}-*

# update openwrt and checkout specified commit
openwrt-update: stamp-clean-openwrt-updated .stamp-openwrt-updated
.stamp-openwrt-updated: .stamp-openwrt-cleaned
cd $(OPENWRT_DIR); git checkout --detach $(OPENWRT_COMMIT)
touch $@

# patches require updated openwrt working copy
$(OPENWRT_DIR)/patches: | .stamp-openwrt-updated
ln -s $(FW_DIR)/patches $@

# feeds
$(OPENWRT_DIR)/feeds.conf: .stamp-openwrt-updated feeds.conf
cp $(FW_DIR)/feeds.conf $@

# update feeds
feeds-update: stamp-clean-feeds-updated .stamp-feeds-updated
.stamp-feeds-updated: $(OPENWRT_DIR)/feeds.conf unpatch
cd $(OPENWRT_DIR); ./scripts/feeds uninstall -a
$(UMASK); cd $(OPENWRT_DIR); ./scripts/feeds update
cd $(OPENWRT_DIR); ./scripts/feeds install -a
.stamp-feeds-updated: .stamp-patched
@$(UMASK); GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/feeds.sh
touch $@

# prepare patch
pre-patch: stamp-clean-pre-patch .stamp-pre-patch
.stamp-pre-patch: .stamp-feeds-updated $(wildcard $(FW_DIR)/patches/*) | $(OPENWRT_DIR)/patches
.stamp-pre-patch: $(FW_DIR)/modules
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update.sh
touch $@

# patch openwrt working copy
# patch openwrt and feeds working copy
patch: stamp-clean-patched .stamp-patched
.stamp-patched: .stamp-pre-patch
cd $(OPENWRT_DIR); quilt push -a
rm -rf $(OPENWRT_DIR)/tmp
.stamp-patched: .stamp-pre-patch $(wildcard $(GLUON_PATCHESDIR)/openwrt/*) $(wildcard $(GLUON_PATCHESDIR)/packages/*/*)
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/patch.sh
touch $@

.stamp-build_rev: .FORCE
Expand All @@ -116,7 +164,7 @@ $(OPENWRT_DIR)/files: $(FW_DIR)/embedded-files
ln -s $(FW_DIR)/embedded-files $(OPENWRT_DIR)/files

# openwrt config
$(OPENWRT_DIR)/.config: .stamp-patched $(TARGET_CONFIG) $(TARGET_CONFIG_AUTOBUILD) .stamp-build_rev $(OPENWRT_DIR)/dl
$(OPENWRT_DIR)/.config: .stamp-feeds-updated $(TARGET_CONFIG) $(TARGET_CONFIG_AUTOBUILD) .stamp-build_rev $(OPENWRT_DIR)/dl
ifdef IS_BUILDBOT
cat $(TARGET_CONFIG) $(TARGET_CONFIG_AUTOBUILD) >$(OPENWRT_DIR)/.config
else
Expand All @@ -129,7 +177,7 @@ endif

# prepare openwrt working copy
prepare: stamp-clean-prepared .stamp-prepared
.stamp-prepared: .stamp-patched $(OPENWRT_DIR)/.config $(OPENWRT_DIR)/files
.stamp-prepared: .stamp-feeds-updated $(OPENWRT_DIR)/.config $(OPENWRT_DIR)/files
touch $@

# compile
Expand Down Expand Up @@ -235,17 +283,12 @@ stamp-clean-%:

stamp-clean:
rm -f .stamp-*

# unpatch needs "patches/" in openwrt
unpatch: $(OPENWRT_DIR)/patches
# RC = 2 of quilt --> nothing to be done
cd $(OPENWRT_DIR); quilt pop -a -f || [ $$? = 2 ] && true
rm -rf $(OPENWRT_DIR)/tmp
rm -f .stamp-patched
rm -f $(FW_DIR)/modules
rm -rf $(GLUON_TMPDIR)

clean: stamp-clean .stamp-openwrt-cleaned

.PHONY: openwrt-clean openwrt-clean-bin openwrt-update patch feeds-update prepare compile firmwares stamp-clean clean
.PHONY: openwrt-clean openwrt-clean-bin patch feeds-update prepare compile firmwares stamp-clean clean
.NOTPARALLEL:
.FORCE:
.SUFFIXES:
10 changes: 0 additions & 10 deletions patches/703-policyrouting_fix_bypass-vpn.patch

This file was deleted.

11 changes: 0 additions & 11 deletions patches/704-policyrouting_ignore_ffuplink.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: mac80211_mesh_no_fwding_by_default

---


diff --git a/package/kernel/mac80211/patches/999-mac80211-mesh-no-forwarding-by-default.patch b/package/kernel/mac80211/patches/999-mac80211-mesh-no-forwarding-by-default.patch
new file mode 100644
index 0000000000..5bff861737
Expand All @@ -16,3 +23,7 @@ index 0000000000..5bff861737
+ .rssi_threshold = MESH_RSSI_THRESHOLD,
+ .ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED,
+ .dot11MeshHWMPactivePathToRootTimeout = MESH_PATH_TO_ROOT_TIMEOUT,
--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
commit 1dd4c2929696797625709537bc51f46f00999b6d
Author: Sven Roederer <[email protected]>
From: Sven Roederer <[email protected]>
Date: Tue May 3 11:31:49 2016 +0200

ramips: add target for Nexx WT3020-images
Subject: add target for Nexx WT3020-images

diff --git a/target/linux/ramips/mt7620/profiles/nexx.mk b/target/linux/ramips/mt7620/profiles/nexx.mk
new file mode 100644
Expand All @@ -27,3 +25,7 @@ index 0000000..9c668c5
+ Support for Nexx WT3020-series
+endef
+$(eval $(call Profile,WT3020))
--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: openwrt-release_use_configured_revision

---


diff -ur package_a/base-files/files/etc/openwrt_release package/base-files/files/etc/openwrt_release
--- a/package/base-files/files/etc/openwrt_release 2017-03-06 03:50:57.000000000 +0100
+++ b/package/base-files/files/etc/openwrt_release 2017-10-30 12:14:34.639257255 +0100
Expand All @@ -9,3 +16,7 @@ diff -ur package_a/base-files/files/etc/openwrt_release package/base-files/files
DISTRIB_TARGET='%S'
DISTRIB_ARCH='%A'
DISTRIB_DESCRIPTION='%D %V %C'
--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: hostapd_nolegacy_by_default

---


diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 1f28661..378b114 100644
--- a/package/network/services/hostapd/files/hostapd.sh
Expand All @@ -11,3 +18,7 @@ index 1f28661..378b114 100644

[ "$hwmode" = "b" ] && legacy_rates=1

--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: imagebuilder-custom-postinst-script

---


diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile
index 95df8bf113..0debd5a882 100644
--- a/target/imagebuilder/files/Makefile
Expand All @@ -12,3 +19,7 @@ index 95df8bf113..0debd5a882 100644
$(MAKE) -s build_image
$(MAKE) -s checksum

--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: banner-info

---


--- lede/package/base-files/files/etc/banner 2017-12-10 21:27:21.352612551 +0100
+++ /tmp/banner 2017-12-10 21:19:20.000000000 +0100
+++ new/package/base-files/files/etc/banner 2017-12-10 21:19:20.000000000 +0100
@@ -1,8 +1,20 @@
- _______ ________ __
- | |.-----.-----.-----.| | | |.----.| |_
Expand Down Expand Up @@ -28,3 +35,7 @@
+ For questions write a mail to <[email protected]>
+ or check https://berlin.freifunk.net/contact for our weekly meetings.
+
--
2.20.1


Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
From: template <nomail@local>
Date: Fri, 6 Sep 2019 08:29:50 +0000
Subject: mbedtls-accept-rsa-1024

---


Index: openwrt/package/libs/mbedtls/patches/201-accept-rsa-1024.patch
===================================================================
--- /dev/null
Expand All @@ -15,3 +22,7 @@ Index: openwrt/package/libs/mbedtls/patches/201-accept-rsa-1024.patch
+
+ /*
+
--
2.20.1


Loading

0 comments on commit bdaa79b

Please sign in to comment.