1 muninlite's Makefile uses the shell and perl for placeholder substitution while generating munin-node
3 This breaks a few special characters in some plugins:
4 * dh: '\1' (breaks mountpoint parsing)
5 * if: '\t' (breaks removal of tab characters - probably irrelevant)
6 * memory: '\n' (breaks label string with linebreak - probably ignored by 'echo' anyway)
7 Index: on_firmware/packages/admin/muninlite/patches/300-fix-munin-node-assembly.patch
8 ===================================================================
10 +++ on_firmware/packages/admin/muninlite/patches/300-fix-munin-node-assembly.patch
15 + #PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats
17 + munin-node: plugins/* munin-node.conf
18 +- @VERSION=$$(cat VERSION); \
19 +- CONF=$$(grep -v '^#' munin-node.conf); \
20 ++ @export VERSION=$$(cat VERSION); \
21 ++ export CONF=$$(grep -v '^#' munin-node.conf); \
22 ++ export "PLUGINS=$(PLUGINS)"; \
23 + echo "Making munin-node for muninlite version $$VERSION"; \
25 +- for PLGIN in $(PLUGINS); \
27 ++ for PLGIN in $$PLUGINS; \
29 + echo "Adding plugin $$PLGIN"; \
30 +- PLSTR=$$(echo "$$PLSTR"; grep -v '^#' plugins/$$PLGIN); \
31 ++ PLSTR=$$(printf "%s\n" "$$PLSTR"; grep -v '^#' plugins/$$PLGIN); \
33 +- PLSTR=$$(echo "$$PLSTR" | sed -e 's/\\/\\\\/g' \
35 +- -e 's/\$$/\\$$/g'); \
37 +- "s/\@\@VERSION\@\@/$$VERSION/;s/\@\@CONF\@\@/$$CONF/;s/\@\@PLUGINS\@\@/$(PLUGINS)/;s/\@\@PLSTR\@\@/$$PLSTR/;" \
39 ++ s/\@\@VERSION\@\@/$$ENV{"VERSION"}/; \
40 ++ s/\@\@CONF\@\@/$$ENV{"CONF"}/; \
41 ++ s/\@\@PLUGINS\@\@/$$ENV{"PLUGINS"}/; \
42 ++ s/\@\@PLSTR\@\@/$$ENV{"PLSTR"}/;' \
43 + munin-node.in > munin-node
44 + @chmod +x munin-node