-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKGBUILD
60 lines (48 loc) · 1.38 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pkgname=can-base
pkgver=6
pkgrel=3
pkgdesc="Meta-package with base system for an nspawn container."
arch=(any)
install=can-base.install
depends=(
base
less
nano
man-db
man-pages
diffutils
)
package() {
cd "$pkgdir"
### Network: batman-adv with global IPv6 to run some overlay on top of it
# Static network-config script is used here, as
# systemd-networkd breaks something and fails in every other release,
# and never worked for some interface types to begin with (e.g. mtu setting).
mkdir -p usr/local/bin etc/systemd/system{,/multi-user.target.wants}
cat >usr/local/bin/net <<'EOF'
#!/bin/bash
set -eEo pipefail
trap 'echo >&2 "----- FAILURE at line $LINENO :: $BASH_COMMAND"' ERR
ip -br link show bat0 &>/dev/null || ip link add bat0 type batadv
ip link set bat0 mtu 1440
ip link set host0 master bat0 up
## ip-ext ipv6-name -mbp 2a02:17d0:201:8b00::/64 can-name
# ip addr rep 2a02:17d0:201:8b00:.../64 dev bat0
ip link set bat0 mtu 1440 up
ip ro rep default via 2a02:17d0:201:8b00:fc27:c46f:b9a4:a2d4 dev bat0
EOF
chmod +x usr/local/bin/net
cat >etc/systemd/system/net.service <<'EOF'
[Unit]
Wants=network.target
After=network.target
Before=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/net
[Install]
WantedBy=multi-user.target
EOF
ln -s /etc/systemd/system/net.service etc/systemd/system/multi-user.target.wants/net.service
}