mirror of https://github.com/dirtbags/moth.git
Make more things auto-detect their directory
This commit is contained in:
parent
7995b8a245
commit
30be810f97
BIN
doc/smoke.xcf
BIN
doc/smoke.xcf
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
#! /bin/awk -f
|
#! /usr/bin/awk -f
|
||||||
|
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#! /bin/awk -f
|
#! /usr/bin/awk -f
|
||||||
|
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
ROUTER_PKGDIR = $(TARGET)/router
|
|
||||||
ROUTER_BUILDDIR = $(BUILD)/router
|
|
||||||
|
|
||||||
router-source:
|
|
||||||
|
|
||||||
router-build:
|
|
||||||
|
|
||||||
router-install: router-build
|
|
||||||
$(call COPYTREE, packages/router/service, $(ROUTER_PKGDIR)/service)
|
|
||||||
|
|
||||||
router-clean:
|
|
||||||
rm -rf $(ROUTER_PKGDIR) $(ROUTER_BUILDDIR)
|
|
||||||
|
|
||||||
|
|
||||||
##
|
|
||||||
## radvd
|
|
||||||
##
|
|
||||||
RADVD_VERSION = 1.8.4
|
|
||||||
RADVD_TARBALL = $(CACHE)/radvd-$(RADVD_VERSION).tar.gz
|
|
||||||
RADVD_URL = http://www.litech.org/radvd/dist/radvd-$(RADVD_VERSION).tar.gz
|
|
||||||
RADVD_SRCDIR = $(ROUTER_BUILDDIR)/radvd-$(RADVD_VERSION)
|
|
||||||
|
|
||||||
$(RADVD_TARBALL):
|
|
||||||
@ mkdir -p $(@D)
|
|
||||||
wget -O $@ $(RADVD_URL)
|
|
||||||
|
|
||||||
router-source: $(ROUTER_BUILDDIR)/radvd-source
|
|
||||||
$(ROUTER_BUILDDIR)/radvd-source: $(RADVD_TARBALL)
|
|
||||||
mkdir -p $(ROUTER_BUILDDIR)
|
|
||||||
zcat $(RADVD_TARBALL) | (cd $(ROUTER_BUILDDIR) && tar xf -)
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
router-build: $(ROUTER_BUILDDIR)/radvd-build
|
|
||||||
$(ROUTER_BUILDDIR)/radvd-build: $(ROUTER_BUILDDIR)/radvd-source
|
|
||||||
cd $(RADVD_SRCDIR) && ./configure $(CONFIG_XCOMPILE_FLAGS)
|
|
||||||
$(MAKE) -C $(RADVD_SRCDIR)
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
router-install: radvd-install
|
|
||||||
radvd-install:
|
|
||||||
mkdir -p $(ROUTER_PKGDIR)/bin
|
|
||||||
cp $(RADVD_SRCDIR)/radvd $(ROUTER_PKGDIR)/bin/
|
|
||||||
cp $(RADVD_SRCDIR)/radvdump $(ROUTER_PKGDIR)/bin/
|
|
||||||
|
|
||||||
|
|
||||||
##
|
|
||||||
## ecmh
|
|
||||||
##
|
|
||||||
ECMH_CACHE = $(CACHE)/ecmh.git
|
|
||||||
ECMH_BUILDDIR = $(ROUTER_BUILDDIR)/ecmh
|
|
||||||
ECMH_URL = http://woozle.org/~neale/projects/ecmh
|
|
||||||
|
|
||||||
$(ECMH_CACHE):
|
|
||||||
git clone --bare $(ECMH_URL) $@
|
|
||||||
|
|
||||||
router-source: $(ECMH_BUILDDIR)
|
|
||||||
$(ECMH_BUILDDIR): $(ECMH_CACHE)
|
|
||||||
git clone $< $@
|
|
||||||
|
|
||||||
router-build: $(ROUTER_BUILDDIR)/ecmh-build
|
|
||||||
$(ROUTER_BUILDDIR)/ecmh-build: $(ECMH_BUILDDIR)
|
|
||||||
$(MAKE) -C $(ECMH_BUILDDIR)/src ECMH_VERSION=dbtl-git STRIP=echo
|
|
||||||
$(MAKE) -C $(ECMH_BUILDDIR)/tools/mtrace6
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
router-install: ecmh-install
|
|
||||||
ecmh-install:
|
|
||||||
mkdir -p $(ROUTER_PKGDIR)/bin
|
|
||||||
cp $(ECMH_BUILDDIR)/src/ecmh $(ROUTER_PKGDIR)/bin
|
|
||||||
cp $(ECMH_BUILDDIR)/tools/mtrace6/mtrace6 $(ROUTER_PKGDIR)/bin
|
|
||||||
|
|
||||||
PACKAGES += router
|
|
|
@ -1,4 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec svlogd -tt $PWD
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
interface eth0 { AdvSendAdvert on; prefix fd84:b410:3441:0::/64; };
|
|
||||||
interface eth0.1 { AdvSendAdvert on; prefix fd84:b410:3441:1::/64; };
|
|
||||||
interface eth0.2 { AdvSendAdvert on; prefix fd84:b410:3441:2::/64; };
|
|
||||||
interface eth0.3 { AdvSendAdvert on; prefix fd84:b410:3441:3::/64; };
|
|
||||||
interface eth0.4 { AdvSendAdvert on; prefix fd84:b410:3441:4::/64; };
|
|
||||||
interface eth0.5 { AdvSendAdvert on; prefix fd84:b410:3441:5::/64; };
|
|
||||||
interface eth0.6 { AdvSendAdvert on; prefix fd84:b410:3441:6::/64; };
|
|
||||||
interface eth0.7 { AdvSendAdvert on; prefix fd84:b410:3441:7::/64; };
|
|
||||||
interface eth0.8 { AdvSendAdvert on; prefix fd84:b410:3441:8::/64; };
|
|
||||||
interface eth0.9 { AdvSendAdvert on; prefix fd84:b410:3441:9::/64; };
|
|
||||||
interface eth0.10 { AdvSendAdvert on; prefix fd84:b410:3441:10::/64; };
|
|
||||||
interface eth0.11 { AdvSendAdvert on; prefix fd84:b410:3441:11::/64; };
|
|
||||||
interface eth0.12 { AdvSendAdvert on; prefix fd84:b410:3441:12::/64; };
|
|
||||||
interface eth0.13 { AdvSendAdvert on; prefix fd84:b410:3441:13::/64; };
|
|
||||||
interface eth0.14 { AdvSendAdvert on; prefix fd84:b410:3441:14::/64; };
|
|
||||||
interface eth0.15 { AdvSendAdvert on; prefix fd84:b410:3441:15::/64; };
|
|
||||||
interface eth0.16 { AdvSendAdvert on; prefix fd84:b410:3441:16::/64; };
|
|
||||||
interface eth0.17 { AdvSendAdvert on; prefix fd84:b410:3441:17::/64; };
|
|
||||||
interface eth0.18 { AdvSendAdvert on; prefix fd84:b410:3441:18::/64; };
|
|
||||||
interface eth0.19 { AdvSendAdvert on; prefix fd84:b410:3441:19::/64; };
|
|
||||||
interface eth0.20 { AdvSendAdvert on; prefix fd84:b410:3441:20::/64; };
|
|
||||||
interface eth0.21 { AdvSendAdvert on; prefix fd84:b410:3441:21::/64; };
|
|
||||||
interface eth0.22 { AdvSendAdvert on; prefix fd84:b410:3441:22::/64; };
|
|
||||||
interface eth0.23 { AdvSendAdvert on; prefix fd84:b410:3441:23::/64; };
|
|
||||||
interface eth0.24 { AdvSendAdvert on; prefix fd84:b410:3441:24::/64; };
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
exec $CTF_BASE/packages/router/bin/radvd -C radvd.conf -d 1 -m stderr -p radvd.pid
|
|
|
@ -1,9 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
for i in $(seq 24); do
|
|
||||||
ip link del link dev eth0.$i
|
|
||||||
done
|
|
||||||
|
|
||||||
ip link set dev eth0 down
|
|
||||||
|
|
||||||
iptables -F INPUT
|
|
|
@ -1,4 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec svlogd -tt $PWD
|
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
#! /bin/sh -e
|
|
||||||
|
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
echo 8192 > /proc/sys/net/ipv6/neigh/default/gc_thresh3
|
|
||||||
echo 4096 > /proc/sys/net/ipv6/neigh/default/gc_thresh2
|
|
||||||
|
|
||||||
PFX=fd84:b410:3441
|
|
||||||
|
|
||||||
log () {
|
|
||||||
echo "router: $@"
|
|
||||||
echo "router: $@" > /dev/console
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ $(mount | grep -c /packages/) -gt 1 ]; then
|
|
||||||
log "cannot run alongside other packages" > /dev/console
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# I'm a router
|
|
||||||
hostname router
|
|
||||||
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
|
||||||
|
|
||||||
# Bring up main ethernet interface
|
|
||||||
ip addr add $PFX:0::1/64 dev eth0
|
|
||||||
ip link set eth0 up
|
|
||||||
|
|
||||||
# Bring up vlans
|
|
||||||
for i in $(seq 24); do
|
|
||||||
ip link add link eth0 name eth0.$i type vlan id $i
|
|
||||||
ip addr add $PFX:$i::1/64 dev eth0.$i
|
|
||||||
ip link set eth0.$i up
|
|
||||||
done
|
|
||||||
|
|
||||||
# Subnet route for SNL at TF4
|
|
||||||
ip route add fd80:1::/48 via fd84:b410:3441:24::2
|
|
||||||
|
|
||||||
# Drop SSH from non-management VLANs
|
|
||||||
ip6tables -A INPUT -s fd84:b410:3441:0::/64 -m tcp -p tcp --dport 22 -j ACCEPT
|
|
||||||
ip6tables -A INPUT -m tcp -p tcp --dport 22 -j DROP
|
|
||||||
ip6tables -A FORWARD -d fd84:b410:3441:0::/64 -m tcp -p tcp --dport 22 -j DROP
|
|
||||||
|
|
||||||
sleep 8100d
|
|
|
@ -1,3 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec svlogd -tt $PWD
|
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
echo 'root:$1$xAJ7KwiU$BeKJjYGs9r/hY9Ag4qv4I1:0:0' | chpasswd --encrypted
|
|
||||||
|
|
||||||
exec dropbear -r ./rsa.key -E -F
|
|
Loading…
Reference in New Issue