Skip to content

Commit 5bb6b8e

Browse files
committed
Build clean .ipks
2 parents bc82f52 + 039e891 commit 5bb6b8e

File tree

14 files changed

+107
-13
lines changed

14 files changed

+107
-13
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
*.o
22
osd_dji
33
msp_displayport_mux
4+
ipk/goggle/build
5+
ipk/airunit/build
6+
*.ipk
7+
repo

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./Makefile.dji

Makefile.dji

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ LIB_SHIMS = libshims/libduml_hal.so
99
OSD_DJI_LIBS := -L./libshims -lduml_hal
1010
#endif
1111

12+
.PHONY: repo
13+
1214
%.o: %.c $(DEPS)
1315
$(CC) -c -o $@ $< $(CFLAGS)
1416

@@ -32,8 +34,53 @@ libshims/lib%.so: libshims/%.c
3234

3335
libshims: $(LIB_SHIMS)
3436

35-
clean:
37+
goggle_ipk: osd_dji
38+
$(eval PKG_NAME := $(shell cat ./ipk/goggle/control/control | grep Package | cut -d" " -f2))
39+
$(eval ARCH := $(shell cat ./ipk/goggle/control/control | grep Architecture | cut -d" " -f2))
40+
$(eval VERSION :=$(shell cat ./ipk/goggle/control/control | grep Version | cut -d" " -f2))
41+
$(eval IPK_NAME := "${PKG_NAME}_${VERSION}_${ARCH}.ipk")
42+
mkdir -p ipk/goggle/build
43+
cp -r ipk/goggle/data ipk/goggle/build/
44+
mkdir -p ipk/goggle/build/data/opt/bin
45+
mkdir -p ipk/goggle/build/opt/fonts
46+
echo "2.0" > ipk/goggle/build/debian-binary
47+
cp -r ipk/goggle/control ipk/goggle/build/
48+
cp osd_dji ipk/goggle/build/data/opt/bin
49+
chmod +x ipk/goggle/build/data/opt/bin/osd_dji
50+
cp font.bin ipk/goggle/build/data/opt/fonts
51+
cd ipk/goggle/build/control && tar czvf ../control.tar.gz .
52+
cd ipk/goggle/build/data && tar czvf ../data.tar.gz .
53+
cd ipk/goggle/build && tar czvf "../../${IPK_NAME}" ./control.tar.gz ./data.tar.gz ./debian-binary
54+
55+
airunit_ipk: msp_displayport_mux
56+
$(eval PKG_NAME := $(shell cat ./ipk/airunit/control/control | grep Package | cut -d" " -f2))
57+
$(eval ARCH := $(shell cat ./ipk/airunit/control/control | grep Architecture | cut -d" " -f2))
58+
$(eval VERSION :=$(shell cat ./ipk/airunit/control/control | grep Version | cut -d" " -f2))
59+
$(eval IPK_NAME := "${PKG_NAME}_${VERSION}_${ARCH}.ipk")
60+
mkdir -p ipk/airunit/build
61+
echo "2.0" > ipk/airunit/build/debian-binary
62+
cp -r ipk/airunit/data ipk/airunit/build/
63+
cp msp_displayport_mux ipk/airunit/build/data/opt/bin
64+
chmod +x ipk/airunit/build/data/opt/bin/msp_displayport_mux
65+
cp -r ipk/airunit/control ipk/airunit/build/
66+
cd ipk/airunit/build/control && tar czvf ../control.tar.gz .
67+
cd ipk/airunit/build/data && tar czvf ../data.tar.gz .
68+
cd ipk/airunit/build && tar czvf "../../${IPK_NAME}" ./control.tar.gz ./data.tar.gz ./debian-binary
69+
70+
ipk: goggle_ipk airunit_ipk
71+
72+
repo: ipk
73+
mkdir -p repo
74+
cp ipk/*.ipk repo/
75+
../opkg-utils-0.5.0/opkg-make-index ./repo/ > repo/Packages
76+
http-server -p 8042 ./repo/
77+
78+
clean:
3679
rm -rf *.o
80+
rm -rf repo
3781
rm -rf libshims/*.so
3882
rm -rf msp_displayport_mux
3983
rm -rf osd_dji
84+
rm -rf ipk/goggle/build
85+
rm -rf ipk/airunit/build
86+
rm -rf ipk/*.ipk

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ set displayport_msp_serial = <ConfiguratorUART - 1>
5151
adb push msp_displayport_mux /blackbox
5252
setprop dji.hdvt_uav_service 0
5353
mv /dev/ttyS1 /dev/ttyS1_moved
54-
nohup /blackbox/msp_displayport_mux 192.168.41.2 /dev/ttyS1_moved /dev/ttyS1
54+
nohup /blackbox/msp_displayport_mux 192.168.41.2 /dev/ttyS1_moved /dev/ttyS1 &
5555
setprop dji.hdvt_uav_service 1
5656
```
5757
This tells the displayport mux to send data from /dev/ttyS1_moved to 192.168.41.2 (goggles) and to create a fake serial port at /dev/ttyS1 with the displayport messages filtered out.

ipk/airunit/control/control

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Package: msp-osd-airside
2+
Version: 0.1.0
3+
Maintainer: bri3d
4+
Description: MSP OSD service for the DJI HD FPV airunit.
5+
Architecture: armv7-3.2
6+
Depends: dinit

ipk/airunit/control/postinst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/system/bin/sh
2+
/opt/sbin/dinitctl -u enable airunit-osd-dji || true

ipk/airunit/control/prerm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/system/bin/sh
2+
/opt/sbin/dinitctl -u disable airunit-osd-dji || true
3+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/system/bin/sh
2+
setprop dji.hdvt_uav_service 0
3+
4+
if [ ! -e "/dev/ttyS1_moved" ]
5+
then
6+
mv /dev/ttyS1 /dev/ttyS1_moved
7+
fi
8+
9+
/opt/bin/msp_displayport_mux 192.168.41.2 /dev/ttyS1_moved /dev/ttyS1 &
10+
echo $! > /opt/var/run/airunit-osd-dji.pid
11+
setprop dji.hdvt_uav_service 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type = bgprocess
2+
command = /opt/bin/airunit-osd-start.sh
3+
pid-file = /opt/var/run/airunit-osd-dji.pid
4+
restart = true

ipk/goggle/control/control

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Package: msp-osd-goggles
2+
Version: 0.1.0
3+
Maintainer: bri3d
4+
Description: MSP OSD service for the DJI HD FPV goggles.
5+
Architecture: armv7-3.2
6+
Depends: dinit

0 commit comments

Comments
 (0)