Skip to content

Commit

Permalink
Fixes for v3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishamm committed Feb 21, 2024
1 parent 6aace8b commit e7de9ec
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 104 deletions.
23 changes: 8 additions & 15 deletions pkg/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,25 @@ chmod 440 /opt/dsf/plugins/MotionWebcamServer.json

chown -R dsf:dsf /opt/dsf/plugins/MotionWebcamServer
chmod 550 /opt/dsf/plugins/MotionWebcamServer/dsf/arm/motion
chmod 550 /opt/dsf/plugins/MotionWebcamServer/dsf/arm/startMotion.sh
chmod 550 /opt/dsf/plugins/MotionWebcamServer/dsf/arm64/motion
chmod 550 /opt/dsf/plugins/MotionWebcamServer/dsf/arm64/startMotion.sh

chown dsf:dsf /opt/dsf/sd/sys/motion.conf

# Reload the plugin manifest
if [ -f /opt/dsf/plugins/MotionWebcamServer/.start ]; then
rm /opt/dsf/plugins/MotionWebcamServer/.start
if (systemctl is-active -q duetcontrolserver && systemctl is-active -q duetpluginservice && systemctl is-active -q duetpluginservice-root); then
/opt/dsf/bin/PluginManager -q reload MotionWebcamServer
/opt/dsf/bin/PluginManager -q start MotionWebcamServer
else
echo "MotionWebcamServer" >> /opt/dsf/conf/plugins.txt
fi
if (systemctl is-active -q duetcontrolserver && systemctl is-active -q duetpluginservice && systemctl is-active -q duetpluginservice-root); then
/opt/dsf/bin/PluginManager -q reload MotionWebcamServer
if [ -f /opt/dsf/plugins/MotionWebcamServer/.start ]; then
/opt/dsf/bin/PluginManager -q start MotionWebcamServer
fi
else
echo "MotionWebcamServer" >> /opt/dsf/conf/plugins.txt
fi
rm -f /opt/dsf/plugins/MotionWebcamServer/.start

# Apply AppArmor profile
if [ -f /usr/sbin/apparmor_parser ]; then
apparmor_parser -r /etc/apparmor.d/dsf.MotionWebcamServer
fi

# Enable RPi webcam if applicable
if [ -f /usr/bin/raspi-config ]; then
raspi-config nonint do_camera 0
fi

# Don't block the configuration of other packages if DPS failed to start
exit 0
9 changes: 9 additions & 0 deletions pkg/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Reload the plugin manifest
if (systemctl is-active -q duetcontrolserver && systemctl is-active -q duetpluginservice && systemctl is-active -q duetpluginservice-root); then
/opt/dsf/bin/PluginManager -q reload MotionWebcamServer
fi

# Don't block the configuration of other packages if DPS failed to start
exit 0
1 change: 1 addition & 0 deletions pkg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mkdir -p /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/opt/dsf
cp -r $pwd/DEBIAN /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/DEBIAN
cp -r $pwd/etc /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/etc
cp -r ../src/dsf /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/opt/dsf/plugins/MotionWebcamServer/dsf
cp -r ../src/sd /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/opt/dsf/sd
cp ../src/plugin.json /tmp/motionwebcamserverplugin/motionwebcamserverplugin_$version/opt/dsf/plugins/MotionWebcamServer.json

echo "- Preparing package index"
Expand Down
14 changes: 7 additions & 7 deletions pkg/etc/apparmor.d/dsf.MotionWebcamServer
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#include <abstractions/nameservice>


/usr/bin/python{2.[4-7],3.[0-9]} ix,
/usr/bin/python{2.[4-7],3.[0-9]+} ix,
/usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9]}/{site,dist}-packages/** r,
/opt/vc/lib/** rm,
/etc/ssl/** r,

capability dac_override,
capability dac_read_search,
Expand All @@ -28,14 +29,13 @@
/opt/dsf/sd/sys/** r,
/** mix,
network,

/dev/dma_heap/linux,cma rw,
/dev/dma_heap/* rw,
/dev/media* rwmlk,
/dev/v4l-subdev* rw,
/dev/v4l-* rwmlk,
/dev/video* rwmlk,
/dev/tty rw,
/run/udev/data/* r,
/run/udev/data/** rwmlk,
/usr/bin/libcamerify rm,
/usr/share/libcamera/** r,
/usr/libexec/libcamera/* rm,
/usr/share/libcamera/** r,

}
40 changes: 0 additions & 40 deletions src/dsf/arm/startMotion.sh

This file was deleted.

40 changes: 0 additions & 40 deletions src/dsf/arm64/startMotion.sh

This file was deleted.

3 changes: 1 addition & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
"homepage": "https://github.com/Duet3D/MotionWebcamServerPlugin",
"sbcRequired": true,
"sbcDsfVersion": "3.5",
"sbcExecutable": "startMotion.sh",
"sbcExecutable": "motion",
"sbcExecutableArguments": "-c /opt/dsf/sd/sys/motion.conf",
"sbcExtraExecutables": ["motion"],
"sbcOutputRedirected": false,
"sbcConfigFiles": ["motion.conf"],
"sbcPackageDependencies": ["libavcodec58", "libavdevice58", "libavformat58", "libavutil56", "libc6", "libgnutls30", "libjpeg62-turbo", "libmariadb3", "libmicrohttpd12", "libpq5", "libsqlite3-0", "libswscale5", "libwebp6", "libwebpmux3", "zlib1g"],
Expand Down

0 comments on commit e7de9ec

Please sign in to comment.