-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
48 lines (40 loc) · 1.3 KB
/
Makefile
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
.PHONY: build clean init update devshell show-envs switch-env
# Build the OpenWrt image.
# Note: execute this within the devshell.
build:
cd openwrt && make
# Initialize the OpenWrt environment.
init:
git submodule init
git submodule update
cp feeds.conf.default openwrt/feeds.conf.default
ln -s ../conf/.config openwrt/.config
ln -s ../conf/files openwrt/files
docker compose run --rm chirpstack-gateway-os openwrt/scripts/feeds update -a
docker compose run --rm chirpstack-gateway-os openwrt/scripts/feeds install -a
docker compose run --rm chirpstack-gateway-os quilt init
# Update OpenWrt + package feeds.
update:
git submodule update
cp feeds.conf.default openwrt/feeds.conf.default
cd openwrt && \
./scripts/feeds update -a && \
./scripts/feeds install -a
# Activate the devshell.
devshell:
docker compose run --rm chirpstack-gateway-os bash
# Switch configuration environment.,
# Note: execute this within the devshell.
switch-env:
@echo "Rollback previously applied patches"
-cd openwrt && quilt pop -a
@echo "Switching configuration"
rm -f conf/files conf/patches conf/.config
ln -s ${ENV}/files conf/files
ln -s ${ENV}/patches conf/patches
ln -s ${ENV}/.config conf/.config
@echo "Applying patches"
cd openwrt && quilt push -a
# Clean the OpenWrt environment.
clean:
rm -rf openwrt