]> git.plutz.net Git - blast/blob - modules/remo2hbo.mk
suppress network interfae renaming at boot
[blast] / modules / remo2hbo.mk
1 PACKAGES += chromium-browser ssh bridge-utils dnsmasq iptables make nmap openbsd-inetd bluez-tools
2 hostname := oktopus
3 users += oktopus
4
5 nodm_user := oktopus
6 webui := http://localhost/
7 include modules/nodm.mk
8
9 define RPICONFIG +=
10
11 dtoverlay=w1-gpio
12 dtparam=spi=on
13 dtoverlay=mcp3008:spi0-0-present,spi0-32768-speed
14
15 endef
16
17 export oktopus_dnsmasq oktopus_btnap oktopus_eth oktopus_rclocal
18
19 define oktopus_dnsmasq :=
20 listen-address=192.168.82.1
21 bind-interfaces
22
23 dhcp-authoritative
24 dhcp-range=192.168.82.16,192.168.82.254,48h
25
26 address=/#/192.168.82.1
27 endef
28
29 define oktopus_eth :=
30 auto eth0
31 allow-hotplug eth0
32 iface eth0 inet static
33         address 192.168.83.1
34         netmask 255.255.255.0
35 endef
36
37 define oktopus_btnap :=
38 auto br0
39 iface br0 inet static
40         address 192.168.82.1
41         netmask 255.255.255.0
42         bridge_ports    none
43         bridge_fd       5
44         bridge_stp      no
45 endef
46
47 define oktopus_rclocal :=
48 #!/bin/sh
49
50 modprobe w1-gpio pullup=1
51 modprobe w1-therm
52
53 while ! hciconfig hci0; do sleep 1; done
54 bt-network -s nap br0 &
55 hciconfig hci0 up
56 hciconfig hci0 sspmode 1
57 hciconfig hci0 piscan
58
59 while sleep 5; do
60   bt-device -l \
61   | grep -oE '[0-9A-F:]{17}' \
62   | while read mac; do
63     bt-device --set "$$mac" Trusted 1
64   done
65 done &
66
67 /srv/gummikraken/hatch.sh &
68 endef
69
70
71 _config: ${CFGROOT}/etc/dnsmasq.conf ${CFGROOT}/etc/network/interfaces.d/btnap ${CFGROOT}/etc/rc.local
72 _config: ${CFGROOT}/etc/inetd.conf ${CFGROOT}/etc/network/interfaces.d/eth
73 _config: ${CFGROOT}/usr/local/bin/teesock ${CFGROOT}/srv/gummikraken
74
75 ${CFGROOT}/etc/dnsmasq.conf: ${CFGROOT}
76         printf '%s\n' "$$oktopus_dnsmasq" >"$@"
77
78 ${CFGROOT}/etc/network/interfaces.d/btnap: ${CFGROOT}
79         mkdir -p "$(dir $@)"
80         printf '%s\n' "$$oktopus_btnap" >"$@"
81
82 ${CFGROOT}/etc/network/interfaces.d/eth: ${CFGROOT}
83         mkdir -p "$(dir $@)"
84         printf '%s\n' "$$oktopus_eth" >"$@"
85
86 ${CFGROOT}/etc/rc.local: ${CFGROOT}
87         # chroot "$${CFGROOT}" systemctl enable rc-local
88         printf '%s\n' "$$oktopus_rclocal" >"$@"
89         chmod 755 "$@"
90
91 ${CFGROOT}/usr/local/bin/teesock: teesock/teesock.arm ${CFGROOT}
92         cp "$<" "$@"
93
94 ${CFGROOT}/srv/gummikraken: gummikraken/ ${CFGROOT}
95         cp -au "$</." "$@"
96         sed -i 's;http://141.45.146.235:8200;http://oktopus:8200;' "$@/oktopus_frontend/dist/bundle.js"
97
98 .PHONY: gummikraken_clone
99 gummikraken_clone:
100         [ -d gummikraken/.git ] || git clone https://git.tools.f4.htw-berlin.de/phaensch/gummikraken.git "gummikraken/"
101
102 gummikraken/: gummikraken_clone
103         -git -C $@ pull
104         -git -C $@ submodule init
105         -git -C $@ submodule update --remote
106
107 teesock/teesock.arm: teesock/
108         make -C $< "$(notdir $@)"
109         chmod 755 "$@"
110
111 teesock/:
112         git clone https://git.tools.f4.htw-berlin.de/phaensch/teesock.git "$@"
113
114 ${CFGROOT}/etc/inetd.conf: gummikraken/
115         cp "$</inetd.conf" "$@"