Skip to content

Commit

Permalink
package sensor-config
Browse files Browse the repository at this point in the history
  • Loading branch information
scpcom committed Mar 2, 2025
1 parent 438e50b commit 1681c3a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
35 changes: 32 additions & 3 deletions scripts/addons/device-config/addon.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,43 @@ $(BUILDDIR)/firmware-vcodec-package-stamp:

firmware-vcodec: $(BUILDDIR)/firmware-vcodec-package-stamp

$(BUILDDIR)/device-config-stamp: firmware-vcodec
$(BUILDDIR)/sensor-config-install-stamp:
@mkdir -pv /rootfs/mnt/cfg/param/
@mkdir -pv /rootfs/mnt/data/
@if [ "$(BOARD)" = "licheervnano" ]; then \
cp -p addons/device-config/overlay/mnt/cfg/param/sipeed_gc4653_30fps_202403261356.bin /rootfs/mnt/cfg/param/cvi_sdr_bin ; \
elif [ "$(BOARD)" = "duo256" ]; then \
cp -p addons/device-config/overlay/mnt/cfg/param/cvi_sdr_bin_GC2083 /rootfs/mnt/cfg/param/cvi_sdr_bin && \
cp -p addons/device-config/overlay/mnt/data/sensor_cfg_GC2083.ini /rootfs/mnt/data/sensor_cfg.ini ; \
fi
@touch $@

$(BUILDDIR)/sensor-config-package-stamp:
@echo "$(COLOUR_GREEN)Packaging sensor-config for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)
@cp -r /builder/deb/sensor-config/* $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/
@mkdir -pv /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/
@rsync -avpPxH addons/device-config/overlay/mnt/cfg/param/ /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/
@rm -f /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/cfg/param/cvi_sdr_bin
@mkdir -pv /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/
@rsync -avpPxH addons/device-config/overlay/mnt/data/ /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/
@rm -f /$(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/mnt/data/sensor_cfg.ini
@sed -i 's/Version: 1.0.0/Version: $(MIDDLEWAREVERSION)/' $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/DEBIAN/control
@sed -i 's/Package: sensor-config/Package: sensor-config-$(BOARD)/' $(BUILDDIR)/package/sensor-config-$(BOARD)-$(MIDDLEWAREVERSION)/DEBIAN/control
@cd $(BUILDDIR)/package/ && dpkg-deb --build sensor-config-$(BOARD)-$(MIDDLEWAREVERSION) sensor-config-$(BOARD)_$(MIDDLEWAREVERSION)_$(DEB_ARCH).deb
@cp $(BUILDDIR)/package/sensor-config-$(BOARD)_$(MIDDLEWAREVERSION)_$(DEB_ARCH).deb /output/
@mkdir -p /rootfs/tmp/install/
@cp /output/sensor-config-*.deb /rootfs/tmp/install/
@touch $@

sensor-config: $(BUILDDIR)/sensor-config-install-stamp $(BUILDDIR)/sensor-config-package-stamp

$(BUILDDIR)/device-config-stamp: firmware-vcodec sensor-config
@echo "$(COLOUR_GREEN)Installing device-config for $(BOARD)$(END_COLOUR)"
@mkdir -pv /rootfs/etc/init.d/
@cp -a addons/device-config/S02config /rootfs/etc/init.d/
@chmod +x /rootfs/etc/init.d/S02config
@cp -a addons/device-config/device-config*.service /rootfs/etc/systemd/system/
@mkdir -pv /rootfs/mnt/
@rsync -avpPxH addons/device-config/overlay/mnt/ /rootfs/mnt/
@mkdir -p /rootfs/tmp/install/
@echo " device-config" >> /rootfs/tmp/install/systemd-enable
@touch $@
6 changes: 6 additions & 0 deletions scripts/deb/sensor-config/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Package: sensor-config
Architecture: riscv64
Maintainer: @scpcom
Priority: optional
Version: 1.0.0
Description: sensor-config for the CV18xx and SG200X series of RISC-V SoC's

0 comments on commit 1681c3a

Please sign in to comment.