This repository has been archived on 2026-10-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
omarchy-pkgs/pkgbuilds/intel-ipu7-camera/camera-sleep-hook
T
792206539a Fix: intl-ipu7-camera resume hook (#110)
* Fix IPU7 camera resume hook

* Fix v4l2-relayd optional splash source

* Bump version to 1.0.4 and reset pkgrel

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2026-07-06 14:45:35 -07:00

25 lines
787 B
Bash

#!/bin/bash
# Handle camera service around suspend/resume.
#
# v4l2-relayd must be stopped before suspend to avoid GStreamer crashes,
# then restarted after resume once the camera hardware is ready.
#
# Avoid unloading/reloading IPU7 kernel modules from the sleep hook. Module
# reprobe during resume can hit fragile kernel PM paths and make wake less
# reliable than a recoverable camera failure.
case "$1" in
pre)
systemctl stop v4l2-relayd@ipu7.service 2>/dev/null || true
;;
post)
systemd-run --no-block --unit=camera-resume bash -c '
systemctl restart camera-init.service 2>/dev/null || true
systemctl reset-failed v4l2-relayd@ipu7.service 2>/dev/null || true
systemctl start v4l2-relayd@ipu7.service 2>/dev/null || true
'
;;
esac
exit 0