Skip to content

Commit 9b0506b

Browse files
committed
antennine.org: add hack for outdoor-8-64
1 parent 977eb7a commit 9b0506b

2 files changed

Lines changed: 48 additions & 5 deletions

File tree

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,56 @@
11
include $(TOPDIR)/rules.mk
22

33
PROFILE_DESCRIPTION:=Generic metapackage for 8MB flash and/or 64MB RAM devices
4-
PROFILE_DEPENDS:=+batctl-default \
4+
PKG_NAME:=profile-antennine.org-outdoor-8-64
5+
PKG_CONFLICTS:=\
6+
-dnsmasq \
7+
-odhcpd-ipv6only \
8+
-opkg \
9+
-ppp \
10+
-ppp-mod-pppoe
11+
PROFILE_DEPENDS:=\
12+
+batctl-default \
13+
+babeld-auto-gw-mode \
514
+check-date-http \
615
+lime-debug \
716
+lime-docs-minimal \
17+
+lime-hwd-openwrt-wan \
818
+lime-proto-anygw \
919
+lime-proto-babeld \
1020
+lime-proto-batadv \
1121
+owut \
12-
+prometheus-node-exporter-lua \
13-
+prometheus-node-exporter-lua-openwrt \
14-
+prometheus-node-exporter-lua-wifi \
15-
+prometheus-node-exporter-lua-wifi_stations \
1622
+shared-state \
1723
+shared-state-babeld_hosts \
1824
+shared-state-nodes_and_links
1925

26+
# hack to deselect openwrt's default_packages. To be used by at most by one metapackage/network-profile
27+
# warn: here TOPDIR is calculated by SDK, so it works with dockerized SDK and IB that use the same /builder
28+
define Package/$(PKG_NAME)/preinst
29+
#!/bin/sh
30+
[ -z "$${IPKG_INSTROOT}" ] && exit 0
31+
echo "########################################################################## Inside package preinst"
32+
grep -q IB_MODIFIED_BY_$(PKG_NAME) $(TOPDIR)/Makefile && exit 0
33+
echo "########################################################################## Determine make's target"
34+
R=$$(for cmd in $$(ls -l /proc/*/exe | grep make | sed 's|.*/proc/\(.*\)/exe.*|\1|' | tr '\n' ' ' | tr -d '\0' ) ; do cat "/proc/$${cmd}/cmdline"; done)
35+
make_target=$$(echo "$${R}" | grep -q manifest && echo 'manifest' || echo 'image')
36+
echo "make_target: $${make_target}"
37+
echo "########################################################################## Backup original Makefile"
38+
cp $(TOPDIR)/Makefile $(TOPDIR)/Makefile.orig
39+
echo "########################################################################## Terminate the execution after the second make image/manifest"
40+
cat << EOF > /tmp/hack_pkg_conflicts
41+
cp $(TOPDIR)/Makefile.orig $(TOPDIR)/Makefile
42+
kill $$(ls -l /proc/*/exe | grep make | sed 's|.*/proc/\(.*\)/exe.*|\1|' | tr '\n' ' ' )
43+
EOF
44+
[ "$${make_target}" = "image" ] \
45+
&& sed -i '/^manifest:\ /e cat /tmp/hack_pkg_conflicts' $(TOPDIR)/Makefile \
46+
|| sed -i '/^package_whatdepends:\ /e cat /tmp/hack_pkg_conflicts' $(TOPDIR)/Makefile
47+
echo "########################################################################## Add PKG_CONFLICTS to be removed in the main Makefile"
48+
sed -i 's|\($$(USER_PACKAGES)\) \($$(BUILD_PACKAGES)\)|\1 $(PKG_CONFLICTS) \2|' $(TOPDIR)/Makefile
49+
echo "# IB_MODIFIED_BY_$(PKG_NAME)" >> $(TOPDIR)/Makefile
50+
echo "########################################################################## Re-run make image with the untouched MAKEFLAGS"
51+
make "$${make_target}"
52+
endef
53+
2054
include ../../profile.mk
2155

2256
# call BuildPackage - OpenWrt buildroot signature
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# profile-antennine.org-outdoor-8-64
2+
3+
Profile for outdoor device with the following characteristics:
4+
- non-gateway (-ppp -ppp-mod-pppoe)
5+
- all default protocols babeld, batman and anygw:
6+
- usable with openwrt-24.xx and current main
7+
- default wifi modes are non-encrypted 802.11s and AP
8+
9+
Tested on ar9342_ubnt_litebeam-m5-xw and similars.

0 commit comments

Comments
 (0)