Skip to content

Commit f6851cb

Browse files
committed
Build deb on bookworm debian 12; minor improvements
1 parent 2820a4b commit f6851cb

File tree

8 files changed

+193
-175
lines changed

8 files changed

+193
-175
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
sudo apt-get install -y qemu-user-static
2626
2727
- name: Build
28-
run: make qemu_build
28+
run: |
29+
make qemu_build
30+
rm -f disk.raw # for some reason reusing the disc causes `pgpconf` to hang
2931
3032
- name: Build deb package
3133
run: make qemu_build_deb

Makefile

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-arm64.tar.xz
2-
# https://github.com/OpenIPC/sbc-groundstations/releases/download/zero3w-v1.7.0/radxaZero3wrev2.img.xz
3-
4-
DEBIAN_HOST=https://cloud.debian.org/images/cloud/bullseye
1+
DEBIAN_HOST=https://cloud.debian.org/images/cloud/bookworm
52
DEBIAN_RELEASE=latest
6-
DEBIAN_SYSTEM=debian-11-generic-arm64.tar
3+
DEBIAN_SYSTEM=debian-12-generic-arm64.tar
74
OUTPUT=output
85
DEB_VERSION=1.3.0
96

@@ -19,30 +16,48 @@ disk.raw: $(DEBIAN_SYSTEM).xz
1916
touch disk.raw
2017

2118
.PHONY: qemu_build
22-
qemu_build: disk.raw
19+
qemu_build:
2320
mkdir -p $(OUTPUT)
24-
sudo mount `sudo losetup -P --show -f disk.raw`p1 $(OUTPUT)
25-
sudo mkdir -p $(OUTPUT)/usr/src/PixelPilot_rk
26-
sudo mount -o bind `pwd` $(OUTPUT)/usr/src/PixelPilot_rk
21+
make mount
2722

28-
#sudo cp -r build.sh run.sh CMakeLists.txt pixelpilot_config.h.in src lvgl lv_conf.h $(OUTPUT)/home
2923
sudo rm $(OUTPUT)/etc/resolv.conf
3024
echo nameserver 1.1.1.1 | sudo tee -a $(OUTPUT)/etc/resolv.conf
31-
sudo chroot $(OUTPUT) /usr/src/PixelPilot_rk/tools/container_build.sh --wipe-boot
25+
LC_ALL=en_US.UTF-8 sudo chroot $(OUTPUT) /usr/src/PixelPilot_rk/tools/container_build.sh --wipe-boot --build-type bin
3226
sudo chroot $(OUTPUT) /usr/src/PixelPilot_rk/tools/container_run.sh --version
3327
sudo cp $(OUTPUT)/usr/src/PixelPilot_rk/build/pixelpilot .
34-
sudo umount $(OUTPUT)/usr/src/PixelPilot_rk
35-
sudo umount $(OUTPUT)
28+
make umount
3629

37-
-PHONY: qemu_build_deb
38-
qemu_build_deb: disk.raw
30+
.PHONY: qemu_build_deb
31+
qemu_build_deb:
3932
mkdir -p $(OUTPUT)
33+
make mount
34+
35+
sudo rm $(OUTPUT)/etc/resolv.conf
36+
echo nameserver 1.1.1.1 | sudo tee -a $(OUTPUT)/etc/resolv.conf
37+
LC_ALL=en_US.UTF-8 sudo chroot $(OUTPUT) /usr/src/PixelPilot_rk/tools/container_build.sh --wipe-boot --pkg-version $(DEB_VERSION) --build-type deb
38+
make umount
39+
40+
.PHONY: mount
41+
mount: disk.raw
4042
sudo mount `sudo losetup -P --show -f disk.raw`p1 $(OUTPUT)
4143
sudo mkdir -p $(OUTPUT)/usr/src/PixelPilot_rk
4244
sudo mount -o bind `pwd` $(OUTPUT)/usr/src/PixelPilot_rk
45+
mkdir .apt_cache || true
46+
sudo mount -o bind .apt_cache/ $(OUTPUT)/var/cache/apt
4347

44-
sudo rm $(OUTPUT)/etc/resolv.conf
45-
echo nameserver 1.1.1.1 | sudo tee -a $(OUTPUT)/etc/resolv.conf
46-
sudo chroot $(OUTPUT) /usr/src/PixelPilot_rk/tools/container_build_deb.sh --wipe-boot --pkg-version $(DEB_VERSION)
48+
.PHONY: umount
49+
umount:
50+
sudo umount $(OUTPUT)/var/cache/apt
4751
sudo umount $(OUTPUT)/usr/src/PixelPilot_rk
4852
sudo umount $(OUTPUT)
53+
sudo losetup --detach `losetup | grep disk.raw | cut -f 1 -d " "`
54+
55+
.PHONY: clean
56+
clean:
57+
rm -f pixelpilot-rk-dbgsym_$(DEB_VERSION)*.deb
58+
rm -f pixelpilot-rk_$(DEB_VERSION)*.buildinfo pixelpilot-rk_$(DEB_VERSION)*.changes pixelpilot-rk_$(DEB_VERSION)*.deb pixelpilot-rk_*.orig.tar.gz
59+
rm -rf pixelpilot-rk_$(DEB_VERSION)/
60+
rm -rf output
61+
rm -rf build
62+
rm -rf .apt_cache
63+
rm -f disk.raw

README.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,47 @@ This project is based on a unique frozen development [FPVue_rk](https://github.c
1313

1414
Tested on RK3566 (Radxa Zero 3W) and RK3588s (Orange Pi 5).
1515

16-
## Compilation
16+
## Installation
17+
18+
It can be installed as a binary DEB package or built from source.
19+
20+
### DEB package
21+
22+
Currently we have packages for Debian Bookworm (12).
23+
First you need to add a repository that contains `wfb-ng` dependency
24+
25+
```
26+
curl -s https://apt.wfb-ng.org/public.asc | sudo gpg --dearmor --yes -o /usr/share/keyrings/wfb-ng.gpg
27+
echo "deb [signed-by=/usr/share/keyrings/wfb-ng.gpg] https://apt.wfb-ng.org/ $(lsb_release -cs) master" | sudo tee /etc/apt/sources.list.d/wfb-ng.list
28+
sudo apt update
29+
```
30+
Also make sure Radxa's repositories are enabled
31+
32+
```
33+
$ ls /etc/apt/sources.list.d/*radxa*.list
34+
/etc/apt/sources.list.d/70-radxa.list /etc/apt/sources.list.d/80-radxa-rk3566.list
35+
$ cat /etc/apt/sources.list.d/*radxa*.list
36+
deb [signed-by="/usr/share/keyrings/radxa-archive-keyring.gpg"] https://radxa-repo.github.io/bookworm bookworm main
37+
deb [signed-by="/usr/share/keyrings/radxa-archive-keyring.gpg"] https://radxa-repo.github.io/rk3566-bookworm rk3566-bookworm main
38+
```
39+
40+
Then download the latest `.deb` package from "releases" section on Github and install it:
41+
42+
```
43+
sudo apt install ./pixelpilot-rk_*_arm64.deb
44+
```
45+
46+
Configuration files are:
47+
48+
* `/etc/pixelpilot/pixelpilot.yaml` - GPIO settings etc
49+
* `/etc/pixelpilot/osd_config.json` - OSD configuration
50+
* `/etc/default/pixelpilot` - systemd overrides / command line parameters
51+
52+
### Build from source
1753

1854
Build on the Rockchip linux system directly.
1955

20-
## Install dependencies
56+
#### Install dependencies
2157

2258
- drm, cairo, mpp, logging, json, msgpack, gpiod, yaml-cpp
2359

@@ -31,7 +67,7 @@ sudo apt install libdrm-dev libcairo-dev librockchip-mpp-dev libspdlog-dev nlohm
3167
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev
3268
```
3369

34-
## Build Instructions
70+
#### Build Instructions
3571

3672
Build and run application in production environment:
3773

@@ -63,6 +99,27 @@ Build and run gsmenu SDL simulator locally
6399
Simulator has w,a,s,d,Enter input.
64100
Press t to toggle drone detection.
65101

102+
### Build from source for arm64
103+
104+
To build it on a non-ARM host machine, it is possible to build with QEMU emulator.
105+
106+
```
107+
sudo apt-get install qemu-user-static
108+
```
109+
and then either build the binary:
110+
111+
```
112+
make qemu_build
113+
ls -l pixelpilot
114+
```
115+
116+
or build .deb package:
117+
118+
```
119+
make qemu_build_deb
120+
ls -l pixelpilot-rk_*.deb
121+
```
122+
66123
## Usage
67124

68125
Show command line options:
@@ -73,7 +130,7 @@ pixelpilot --help
73130
### OSD config
74131

75132
OSD is set-up declaratively in `/etc/pixelpilot/config_osd.json` file (or whatever is set via `--osd-config`
76-
command line key.
133+
command line key).
77134

78135
OSD is described as an array of widgets which may subscribe to fact updates (they receive each fact
79136
update they subscribe to) and those widgets are periodically rendered on the screen (in the order they
@@ -285,7 +342,8 @@ Pixelpilot starts several threads:
285342

286343
## Release
287344

288-
* update project version in `CMakeList.txt`, `project(pixelpilot, VERSION <X.Y.Z>)`, commit
345+
* update project version in `CMakeList.txt`: `project(pixelpilot, VERSION <X.Y.Z>)`, in
346+
`Makefile`: `DEB_VERSION`, and update `debian/changelog` (with `dch -v <X.Y.Z>`). Commit
289347
* push that commit to master (either directly or with PR)
290348
* tag the tip of the master branch with the same `<X.Y.Z>` version
291-
* run `git push --tags`; it will publish a new GitHub release
349+
* run `git push --tags`; it will trigger a build job that would publish a new GitHub release
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[Unit]
22
Description="OpenIPC Pixelpilot Server"
3-
StartLimitInterval=10s
4-
StartLimitBurst=2
53
Requires=wifibroadcast.service
64
After=wifibroadcast.service
75

86
[Service]
97
Type=simple
108
EnvironmentFile=/etc/default/pixelpilot
11-
ExecStart=/usr/bin/pixelpilot --osd --osd-custom-message --osd-config $OSD_PATH --screen-mode $SCREEN_MODE --dvr-framerate $DVR_FPS --dvr-fmp4 --dvr-sequenced-files --dvr-template $DVR_PATH/$DVR_TEMPLATE --config $CONFIG $EXTRA_OPTS
9+
ExecStart=/usr/bin/pixelpilot --osd --osd-custom-message --osd-config ${OSD_PATH} --screen-mode ${SCREEN_MODE} --dvr-framerate ${DVR_FPS} --dvr-fmp4 --dvr-sequenced-files --dvr-template ${DVR_PATH}/${DVR_TEMPLATE} --config ${CONFIG} $EXTRA_OPTS
1210
Restart=always
11+
# Sleep between 3 and 10 seconds between restart attempts; it will keep restarting forever
1312
RestartSec=3
13+
RestartSteps=5
14+
RestartMaxDelaySec=10
1415

1516
[Install]
16-
WantedBy=multi-user.target
17+
WantedBy=multi-user.target

debian/postinst.ex

Lines changed: 0 additions & 39 deletions
This file was deleted.

debian/prerm.ex

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)