[v3] packages/fff: Merge meta packages for variants into config packages

Submitted by Adrian Schmutzler on Oct. 1, 2019, 10:07 p.m.

Details

Message ID 20191001220738.30186-1-freifunk@adrianschmutzler.de
State New
Headers show

Commit Message

Adrian Schmutzler Oct. 1, 2019, 10:07 p.m.
So far, we have meta packages and config packages for the variants
in parallel, e.g. fff-node and fff-variant-node.

Since the sole purpose of the meta packages is to define
dependencies, one can just merge them into the corresponding config
packages to reduce overhead.

This remove the install command in fff-node as there is no files
subfolder so far. Otherwise, build fails ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

Changes in v2:
- base package: fff/base rename to fff-base
- add eval so fff-base is found

Changes in v3:
- Remove install in fff-node
- Move variant and fff-base dependency to variant-xxx.mk

Build ist getestet mit meiner Firmware (und den entsprechenden
Anpassungen). Nicht getestet für offizielle FW (aber prinzipiell
angepasst).
---
 src/packages/fff/fff-gateway/Makefile  | 26 ++++++++++--
 src/packages/fff/fff-node/Makefile     | 11 ++++--
 src/packages/fff/fff/Makefile          | 55 ++------------------------
 src/packages/fff/fff/variant-layer3.mk |  3 +-
 src/packages/fff/fff/variant-node.mk   |  3 +-
 5 files changed, 39 insertions(+), 59 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-gateway/Makefile b/src/packages/fff/fff-gateway/Makefile
index 7a10544c..edc4519f 100644
--- a/src/packages/fff/fff-gateway/Makefile
+++ b/src/packages/fff/fff-gateway/Makefile
@@ -1,7 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-gateway
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/fff-gateway
 
@@ -10,9 +10,29 @@  include $(INCLUDE_DIR)/package.mk
 define Package/fff-gateway
 	SECTION:=base
 	CATEGORY:=Freifunk
-	TITLE:= Freifunk-Franken gateway configuration
+	TITLE:=Freifunk-Franken gateway configuration
 	URL:=https://www.freifunk-franken.de
-	DEPENDS:=+fff-boardname +fff-network
+	DEPENDS:=+fff-alfred-monitoring-proxy \
+	         +fff-babeld \
+	         +fff-boardname \
+	         +fff-dhcp \
+	         +fff-network \
+	         +fff-ra \
+	         +fff-wireguard \
+	         +arptables \
+	         +ebtables \
+	         +ebtables-utils \
+	         +kmod-ebtables-ipv4 \
+	         +kmod-ebtables-ipv6 \
+	         +gre \
+	         +@PACKAGE_grev4 \
+	         +@PACKAGE_grev6 \
+	         +iperf3 \
+	         +ip-full \
+	         +iptables-mod-filter \
+	         +iptables-mod-ipopt \
+	         +iptables-mod-conntrack-extra \
+	         +tcpdump
 endef
 
 define Package/fff-gateway/description
diff --git a/src/packages/fff/fff-node/Makefile b/src/packages/fff/fff-node/Makefile
index 5fb76793..eb8bb387 100644
--- a/src/packages/fff/fff-node/Makefile
+++ b/src/packages/fff/fff-node/Makefile
@@ -1,7 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-node
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/fff-node
 
@@ -10,8 +10,13 @@  include $(INCLUDE_DIR)/package.mk
 define Package/fff-node
 	SECTION:=base
 	CATEGORY:=Freifunk
-	TITLE:= Freifunk-Franken node configuration
+	TITLE:=Freifunk-Franken node configuration
 	URL:=https://www.freifunk-franken.de
+	DEPENDS:=+fff-batman-adv \
+	         +fff-fastd \
+	         +fff-firewall \
+	         +fff-hoods \
+	         +fff-uradvd
 endef
 
 define Package/fff-node/description
@@ -31,7 +36,7 @@  define Build/Compile
 endef
 
 define Package/fff-node/install
-	$(CP) ./files/* $(1)/
+	# $(CP) ./files/* $(1)/
 endef
 
 $(eval $(call BuildPackage,fff-node))
diff --git a/src/packages/fff/fff/Makefile b/src/packages/fff/fff/Makefile
index c94df8e3..4439ecfc 100644
--- a/src/packages/fff/fff/Makefile
+++ b/src/packages/fff/fff/Makefile
@@ -1,13 +1,13 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/fff
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/fff/base
+define Package/fff-base
 	SECTION:=base
 	CATEGORY:=Freifunk
 	TITLE:=Freifunk-Franken Base
@@ -27,57 +27,10 @@  define Package/fff/base
 			 +simple-tc
 endef
 
-define Package/fff/base/description
+define Package/fff-base/description
 	This is the Freifunk Franken Firmware Base package
 endef
 
-define Package/fff-variant-node
-	$(call Package/fff/base)
-	TITLE+=(Home node)
-	DEPENDS+=+fff-node \
-			 +fff-fastd \
-			 +fff-firewall \
-			 +fff-uradvd \
-			 +fff-batman-adv \
-			 +fff-hoods
-	VARIANT:=homenode
-endef
-
-define Package/fff-variant-node/description
-	$(call Package/fff/base/description)
-endef
-
-define Package/fff-variant-layer3
-	$(call Package/fff/base)
-	TITLE+=(Layer 3 Gateway)
-	DEPENDS+=+fff-gateway \
-			 +fff-dhcp \
-			 +fff-babeld \
-			 +fff-ra \
-			 +fff-wireguard \
-			 +iperf3 \
-			 +ip-full \
-			 +tcpdump \
-			 +arptables \
-			 +ebtables \
-			 +ebtables-utils \
-			 +kmod-ebtables-ipv4 \
-			 +kmod-ebtables-ipv6 \
-			 +iptables-mod-filter \
-			 +iptables-mod-ipopt \
-			 +iptables-mod-conntrack-extra \
-			 +gre \
-			 +@PACKAGE_grev4 \
-			 +@PACKAGE_grev6 \
-			 +fff-alfred-monitoring-proxy
-	VARIANT:=layer3
-endef
-
-define Package/fff-variant-layer3/description
-	$(call Package/fff/base/description)
-endef
-
-$(eval $(call BuildPackage,fff-variant-node))
-$(eval $(call BuildPackage,fff-variant-layer3))
+$(eval $(call BuildPackage,fff-base))
 
 include $(TOPDIR)/variant.mk
diff --git a/src/packages/fff/fff/variant-layer3.mk b/src/packages/fff/fff/variant-layer3.mk
index 80293ce1..57ce9c78 100644
--- a/src/packages/fff/fff/variant-layer3.mk
+++ b/src/packages/fff/fff/variant-layer3.mk
@@ -4,7 +4,8 @@  define Package/fff-default
 	DEFAULT:=y
 	TITLE:=Freifunk-Franken Base default switcher
 	URL:=http://www.freifunk-franken.de
-	DEPENDS:=+fff-variant-layer3
+	DEPENDS:=+fff-base +fff-gateway
+	VARIANT:=layer3
 endef
 
 define Package/fff-default/description
diff --git a/src/packages/fff/fff/variant-node.mk b/src/packages/fff/fff/variant-node.mk
index 3abbd069..8c238218 100644
--- a/src/packages/fff/fff/variant-node.mk
+++ b/src/packages/fff/fff/variant-node.mk
@@ -4,7 +4,8 @@  define Package/fff-default
 	DEFAULT:=y
 	TITLE:=Freifunk-Franken Base default switcher
 	URL:=http://www.freifunk-franken.de
-	DEPENDS:=+fff-variant-node
+	DEPENDS:=+fff-base +fff-node
+	VARIANT:=node
 endef
 
 define Package/fff-default/description

Comments

Fabian Blaese Oct. 2, 2019, 11:37 a.m.
Moin,

On 02.10.19 00:07, Adrian Schmutzler wrote:
> So far, we have meta packages and config packages for the variants
> in parallel, e.g. fff-node and fff-variant-node.
> 
> Since the sole purpose of the meta packages is to define
> dependencies, one can just merge them into the corresponding config
> packages to reduce overhead.
> 
> This remove the install command in fff-node as there is no files
> subfolder so far. Otherwise, build fails ...
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> Changes in v2:
> - base package: fff/base rename to fff-base
> - add eval so fff-base is found
> 
> Changes in v3:
> - Remove install in fff-node
An sich hast du recht, kollidiert jetzt halt aber mit "[PATCH 3/3] Move node-specific firewall rules to fff-node"..
Bei einem von beiden müssen wir da dann halt noch dran denken.

> - Move variant and fff-base dependency to variant-xxx.mk
> 
> Build ist getestet mit meiner Firmware (und den entsprechenden
> Anpassungen). Nicht getestet für offizielle FW (aber prinzipiell
> angepasst).
> ---

Was genau war denn dann jetzt in der v2 kaputt?
Die Änderungen sind ja beide eher kosmetischer Natur.

Gruß
Fabian
Adrian Schmutzler Oct. 6, 2019, 5:13 p.m.
Hallo,

> Was genau war denn dann jetzt in der v2 kaputt? 
> Die Änderungen sind ja beide eher kosmetischer Natur. 

Der Patch selbst war nicht das Problem, sondern zwei andere Sachen (der install im leeren fff-node und das Problem mit Switchen zwischen layer-3 und node aus der anderen).

Solange das install bei fff-node steht baut die Firmware aber tatsächlich nicht.

Grüße

Adrian